Add API support signature to the CDC and DFU class bootloaders, so that the applicati...
[pub/USBasp.git] / Projects / USBtoSerial / USBtoSerial.c
index fe685d6..ad20217 100644 (file)
@@ -97,10 +97,10 @@ int main(void)
                        if (!(ReceivedByte < 0))
                          RingBuffer_Insert(&USBtoUSART_Buffer, ReceivedByte);
                }
                        if (!(ReceivedByte < 0))
                          RingBuffer_Insert(&USBtoUSART_Buffer, ReceivedByte);
                }
-               
+
                /* Check if the UART receive buffer flush timer has expired or the buffer is nearly full */
                uint16_t BufferCount = RingBuffer_GetCount(&USARTtoUSB_Buffer);
                /* Check if the UART receive buffer flush timer has expired or the buffer is nearly full */
                uint16_t BufferCount = RingBuffer_GetCount(&USARTtoUSB_Buffer);
-               if ((TIFR0 & (1 << TOV0)) || (BufferCount > 200))
+               if ((TIFR0 & (1 << TOV0)) || (BufferCount > (uint8_t)(sizeof(USARTtoUSB_Buffer_Data) * .75)))
                {
                        /* Clear flush timer expiry flag */
                        TIFR0 |= (1 << TOV0);
                {
                        /* Clear flush timer expiry flag */
                        TIFR0 |= (1 << TOV0);