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:
parent
2a3d0cebb7
commit
a6b199d827
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user