Revision 694
reads first byte of left encoder correctly, still can't get second byte
spi.c | ||
---|---|---|
69 | 69 |
//char c=SPDR; |
70 | 70 |
//PORTB |= SS; |
71 | 71 |
if(spi_mode == FIRST_BYTE){ |
72 |
i = (uint16_t)SPDR << 8;
|
|
72 |
i = (uint16_t)SPDR; |
|
73 | 73 |
spi_recv_function(SPDR); |
74 | 74 |
spi_mode = SECOND_BYTE; |
75 | 75 |
SPDR = 'c'; |
76 |
} else if (spi_mode == SECOND_BYTE){ |
|
76 |
SPDR = 'c'; |
|
77 |
} else { |
|
78 |
usb_puts("second byte\r\n"); |
|
77 | 79 |
i = (uint16_t)SPDR << 8; |
78 | 80 |
spi_mode = 4; |
79 | 81 |
PORTB |= SS; |
Also available in: Unified diff