diff options
author | Christian Pointner <equinox@mur.at> | 2012-07-05 03:45:33 +0000 |
---|---|---|
committer | Christian Pointner <equinox@mur.at> | 2012-07-05 03:45:33 +0000 |
commit | 0066cb2480b4f3e5541d369d8bac4f50a4c22fe5 (patch) | |
tree | 1115a886105a47292733e1d099504738dd42789d /software/idm-test/idm-test.c | |
parent | ssp test works (diff) |
cleanup
git-svn-id: https://svn.spreadspace.org/mur.sat@577 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/idm-test/idm-test.c')
-rw-r--r-- | software/idm-test/idm-test.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/software/idm-test/idm-test.c b/software/idm-test/idm-test.c index a4c4535..9e10771 100644 --- a/software/idm-test/idm-test.c +++ b/software/idm-test/idm-test.c @@ -106,7 +106,7 @@ void SetupHardware(void) TCCR0B = (1 << CS02);
- SPI_Init(SPI_SPEED_FCPU_DIV_64 | SPI_MODE_MASTER | SPI_ORDER_MSB_FIRST |
+ SPI_Init(SPI_SPEED_FCPU_DIV_8 | SPI_MODE_MASTER | SPI_ORDER_MSB_FIRST |
SPI_SCK_LEAD_RISING | SPI_SAMPLE_LEADING);
SPI_CS_DDR |= (1<<CS);
SPI_CS_PORT |= (1<<CS);
@@ -157,12 +157,15 @@ void IDM_ReadData(void) RingBuffer_Insert(&SPItoUSB_Buffer, ReceivedByte);
tmp_cnt++;
- if(RingBuffer_IsFull(&SPItoUSB_Buffer))
+ /* if(RingBuffer_IsFull(&SPItoUSB_Buffer)) */
+ if(RingBuffer_GetFreeCount(&SPItoUSB_Buffer) == 1)
break;
- _delay_us(50);
+ _delay_us(70);
int_state = (INT_PIN & (1<<INT));
}
-
+
+ RingBuffer_Insert(&SPItoUSB_Buffer, 128);
+
_delay_us(30);
SPI_CS_PORT |= (1<<CS);
_delay_us(50);
|