Fix UART random stop when sending data really fast
This commit is contained in:
parent
4ce9c07fa5
commit
3df3a5fede
|
@ -137,7 +137,7 @@ size_t SerialUART::write(const uint8_t c) {
|
|||
|
||||
txBuffer[txEnd % BUFFER_SIZE] = c;
|
||||
txEnd++;
|
||||
if (txEnd == txStart + 1) {
|
||||
if (txEnd % BUFFER_SIZE == (txStart + 1) % BUFFER_SIZE) {
|
||||
HAL_UART_Transmit_IT(handle, &txBuffer[txStart % BUFFER_SIZE], 1);
|
||||
}
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue