X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/b7ef7f49c9f6b4de962ae32776866bd1d5d59c3b..7eb4eb7cdd1ba6a9a6e1ae82968294445667f2e0:/Demos/Device/USBtoSerial/USBtoSerial.c diff --git a/Demos/Device/USBtoSerial/USBtoSerial.c b/Demos/Device/USBtoSerial/USBtoSerial.c index ef51a6eeb..7cef56560 100644 --- a/Demos/Device/USBtoSerial/USBtoSerial.c +++ b/Demos/Device/USBtoSerial/USBtoSerial.c @@ -256,16 +256,9 @@ TASK(CDC_Task) } } - /* Check if Rx buffer contains data */ + /* Check if Rx buffer contains data - if so, send it */ if (Rx_Buffer.Elements) - { - /* Initiate the transmission of the buffer contents if USART idle */ - if (!(Transmitting)) - { - Transmitting = true; - Serial_TxByte(Buffer_GetElement(&Rx_Buffer)); - } - } + Serial_TxByte(Buffer_GetElement(&Rx_Buffer)); /* Select the Serial Tx Endpoint */ Endpoint_SelectEndpoint(CDC_TX_EPNUM); @@ -303,19 +296,6 @@ TASK(CDC_Task) } } -/** ISR to handle the USART transmit complete interrupt, fired each time the USART has sent a character. This reloads the USART - * data register with the next byte from the Rx_Buffer circular buffer if a character is available, or stops the transmission if - * the buffer is currently empty. - */ -ISR(USART1_TX_vect, ISR_BLOCK) -{ - /* Send next character if available */ - if (Rx_Buffer.Elements) - UDR1 = Buffer_GetElement(&Rx_Buffer); - else - Transmitting = false; -} - /** ISR to handle the USART receive complete interrupt, fired each time the USART has received a character. This stores the received * character into the Tx_Buffer circular buffer for later transmission to the host. */ @@ -383,7 +363,7 @@ void ReconfigureUSART(void) UCSR1A = (1 << U2X1); /* Enable transmit and receive modules and interrupts */ - UCSR1B = ((1 << TXCIE1) | (1 << RXCIE1) | (1 << TXEN1) | (1 << RXEN1)); + UCSR1B = ((1 << RXCIE1) | (1 << TXEN1) | (1 << RXEN1)); /* Set the USART mode to the mask generated by the Line Coding options */ UCSR1C = ConfigMask;