aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/XPLAINBridge/Lib/SoftUART.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-08-01 14:03:13 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-08-01 14:03:13 +0000
commitff09cf9c73bbc2623a8c1420918747840382cc5b (patch)
tree41967f96971d3e1ed2a00f5449f3c83b5a19eba3 /Projects/XPLAINBridge/Lib/SoftUART.c
parentfb0e6597b611731e31b5d1285e52fc81a5ffd559 (diff)
downloadlufa-ff09cf9c73bbc2623a8c1420918747840382cc5b.tar.gz
lufa-ff09cf9c73bbc2623a8c1420918747840382cc5b.tar.bz2
lufa-ff09cf9c73bbc2623a8c1420918747840382cc5b.zip
Fix XPLAINBridge project discarding characters from the USB interface due to a double read from the endpoint.
Make XPLAINBridge and USBtoSerial projects more reliable by forcing a flush if the UART-to-USB buffer becomes nearly full. Reduce locking in the LightweightRingBuffer.h header files by only locking on the update of the buffer count, and require insertions and removals from each buffer to occur in only one execution thread. Fix CDC_*_ReceiveByte() returning 0 when the interface is not configured, instead of the new -1 error value. Fix CDC_Host_ReceiveByte() not re-freezing the pipe if no packet has been received. Remove redundant Pipe token set commands in the CDC and RNDIS host class drivers.
Diffstat (limited to 'Projects/XPLAINBridge/Lib/SoftUART.c')
-rw-r--r--Projects/XPLAINBridge/Lib/SoftUART.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Projects/XPLAINBridge/Lib/SoftUART.c b/Projects/XPLAINBridge/Lib/SoftUART.c
index 05dd8a4b5..b96b45f4d 100644
--- a/Projects/XPLAINBridge/Lib/SoftUART.c
+++ b/Projects/XPLAINBridge/Lib/SoftUART.c
@@ -140,7 +140,7 @@ ISR(TIMER3_COMPA_vect, ISR_BLOCK)
TX_Data >>= 1;
TX_BitsRemaining--;
}
- else if (USBtoUART_Buffer.Count && !(RX_BitsRemaining))
+ else if (!(RX_BitsRemaining) && !(RingBuffer_IsEmpty(&USBtoUART_Buffer)))
{
/* Start bit - TX line low */
STXPORT &= ~(1 << STX);