Adding a testtarget.

The testtarget can use the same hardware.
It is a spi master, and sends out spi packets occasionally.
This commit is contained in:
Stefan Beller 2012-05-20 15:37:50 +02:00
parent 2a3d0cebb7
commit a6b199d827
1 changed files with 15 additions and 0 deletions

View File

@ -363,6 +363,21 @@ int main(void) {
/* main event loop */
usbInit();
#ifdef TEST_TARGET_AS_SPI_MASTER
DDRB = (1 << PB2 | 1 << PB3 | 1 << PB5);
PORTB &= (1 << PB2);
SPCR = (1 << SPE | 1 << MSTR | 1 << SPR1 | 1 << SPR0);
sei();
for (;;) {
if (--blink_counter == 0) {
toggleLedRed();
blink_counter = (unsigned int)(1UL << 19);
SPDR = i++;
}
}
#endif
sei();
for (;;) {
usbPoll();