BITBANG_TPIDATA_PORT |= BITBANG_TPIDATA_MASK;\r
\r
/* Fire timer capture ISR every 100 cycles to manage the software USART */\r
- OCR1A = 80;\r
+ OCR1A = 100;\r
TCCR1B = (1 << WGM13) | (1 << WGM12) | (1 << CS10);\r
TIMSK1 = (1 << ICIE1);\r
\r
asm volatile ("NOP"::);\r
\r
/* Fire timer compare ISR every 100 cycles to manage the software USART */\r
- OCR1A = 80;\r
+ OCR1A = 100;\r
TCCR1B = (1 << WGM12) | (1 << CS10);\r
TIMSK1 = (1 << OCIE1A);\r
\r
}\r
\r
/* Wait until a byte has been received before reading */\r
- while (!(UCSR1A & (1 << RXC1)));\r
+ while (!(UCSR1A & (1 << RXC1)) && TimeoutMSRemaining);\r
return UDR1;\r
#else\r
/* Switch to Rx mode if currently in Tx mode */\r
\r
/* Wait until a byte has been received before reading */\r
SoftUSART_BitCount = BITS_IN_USART_FRAME;\r
- while (SoftUSART_BitCount);\r
- \r
+ while (SoftUSART_BitCount && TimeoutMSRemaining);\r
+\r
/* Throw away the parity and stop bits to leave only the data (start bit is already discarded) */\r
return (uint8_t)SoftUSART_Data;\r
#endif\r