summaryrefslogtreecommitdiff
path: root/software/idm-test/idm-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/idm-test/idm-test.c')
-rw-r--r--software/idm-test/idm-test.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/software/idm-test/idm-test.c b/software/idm-test/idm-test.c
index 49fe3fc..a4c4535 100644
--- a/software/idm-test/idm-test.c
+++ b/software/idm-test/idm-test.c
@@ -127,8 +127,20 @@ void IDM_SendCmd(uint8_t cmd)
led_off();
}
+unsigned char tmp_cnt = 0;
+
void IDM_ReadData(void)
{
+ /* uint8_t int_state = (INT_PIN & (1<<INT)); */
+ /* while(!int_state) { */
+ /* RingBuffer_Insert(&SPItoUSB_Buffer, tmp_cnt); */
+ /* /\* tmp_cnt = tmp_cnt >= 255 ? 32 : tmp_cnt+1; *\/ */
+ /* tmp_cnt++; */
+ /* if(RingBuffer_IsFull(&SPItoUSB_Buffer)) */
+ /* break; */
+ /* int_state = (INT_PIN & (1<<INT)); */
+ /* } */
+
led_on();
SPI_CS_PORT &= ~(1<<CS);
_delay_us(100);
@@ -138,7 +150,13 @@ void IDM_ReadData(void)
uint8_t int_state = (INT_PIN & (1<<INT));
while(!int_state) {
uint8_t ReceivedByte = SPI_TransferByte(0);
+ /* if(ReceivedByte == tmp_cnt) */
+ /* RingBuffer_Insert(&SPItoUSB_Buffer, '.'); */
+ /* else */
+ /* RingBuffer_Insert(&SPItoUSB_Buffer, 'e'); */
RingBuffer_Insert(&SPItoUSB_Buffer, ReceivedByte);
+ tmp_cnt++;
+
if(RingBuffer_IsFull(&SPItoUSB_Buffer))
break;
_delay_us(50);