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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/software/idm-test/idm-test.c b/software/idm-test/idm-test.c
index c72ab91..89363e6 100644
--- a/software/idm-test/idm-test.c
+++ b/software/idm-test/idm-test.c
@@ -104,7 +104,7 @@ void SetupHardware(void)
TCCR0B = (1 << CS02);
- SPI_Init(SPI_SPEED_FCPU_DIV_16 | 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);
@@ -158,7 +158,7 @@ int main(void)
int16_t BytesReceived = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface);
while(BytesReceived > 0) {
int16_t ReceivedByte = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);
- if (!(ReceivedByte < 0)) {
+ if (ReceivedByte >= 0) {
switch(ReceivedByte) {
case 'p': PWRDWN_PORT &= ~(1<<PWRDWN); break;
case 'P': PWRDWN_PORT |= (1<<PWRDWN); break;
@@ -176,8 +176,8 @@ int main(void)
if ((TIFR0 & (1 << TOV0)) || (BufferCount > (uint8_t)(sizeof(SPItoUSB_Buffer_Data) * .75))) {
TIFR0 |= (1 << TOV0);
while (BufferCount--) {
- if (CDC_Device_SendByte(&VirtualSerial_CDC_Interface,
- RingBuffer_Peek(&SPItoUSB_Buffer)) != ENDPOINT_READYWAIT_NoError)
+ if(CDC_Device_SendByte(&VirtualSerial_CDC_Interface,
+ RingBuffer_Peek(&SPItoUSB_Buffer)) != ENDPOINT_READYWAIT_NoError)
break;
RingBuffer_Remove(&SPItoUSB_Buffer);