diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-11-23 06:56:24 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-11-23 06:56:24 +0000 |
commit | 423d4018f0be89a703832669c3d65b162fc437f3 (patch) | |
tree | 13029411dbef5fffbe6b0efc1e08f66f95fcd7fa /Projects/Benito/Benito.c | |
parent | 0595ac27d5aae235e58aa17816c1fc0e7bbb5e1f (diff) | |
download | lufa-423d4018f0be89a703832669c3d65b162fc437f3.tar.gz lufa-423d4018f0be89a703832669c3d65b162fc437f3.tar.bz2 lufa-423d4018f0be89a703832669c3d65b162fc437f3.zip |
Fixed Benito project discarding incoming data from the USB virtual serial port when the USART is busy.
Minor documentation improvements.
Diffstat (limited to 'Projects/Benito/Benito.c')
-rw-r--r-- | Projects/Benito/Benito.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Projects/Benito/Benito.c b/Projects/Benito/Benito.c index 0e6eacb48..fbb81840f 100644 --- a/Projects/Benito/Benito.c +++ b/Projects/Benito/Benito.c @@ -92,10 +92,9 @@ int main(void) for (;;) { /* Echo bytes from the host to the target via the hardware USART */ - int16_t ReceivedByte = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface); - if (!(ReceivedByte < 0) && (UCSR1A & (1 << UDRE1))) + if ((UCSR1A & (1 << UDRE1)) && CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface)) { - UDR1 = ReceivedByte; + UDR1 = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface); LEDs_TurnOnLEDs(LEDMASK_TX); PulseMSRemaining.TxLEDPulse = TX_RX_LED_PULSE_MS; |