Fixed Benito project discarding incoming data from the USB virtual serial port when the USART is busy.

Minor documentation improvements.
This commit is contained in:
Dean Camera 2010-11-23 06:56:24 +00:00
parent 0595ac27d5
commit 423d4018f0
8 changed files with 29 additions and 8 deletions

View file

@ -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;