mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
UART1 - Fix interrupt race condition which resulted in UART randomly
stopping transmission of data.
This commit is contained in:
parent
9cc7a5aab1
commit
e8dbb77db5
1 changed files with 4 additions and 2 deletions
|
@ -254,9 +254,11 @@ uint8_t uartRead(serialPort_t *instance)
|
|||
void uartWrite(serialPort_t *instance, uint8_t ch)
|
||||
{
|
||||
uartPort_t *s = (uartPort_t *)instance;
|
||||
s->port.txBuffer[s->port.txBufferHead++] = ch;
|
||||
if (s->port.txBufferHead >= s->port.txBufferSize) {
|
||||
s->port.txBuffer[s->port.txBufferHead] = ch;
|
||||
if (s->port.txBufferHead + 1 >= s->port.txBufferSize) {
|
||||
s->port.txBufferHead = 0;
|
||||
} else {
|
||||
s->port.txBufferHead++;
|
||||
}
|
||||
|
||||
if (s->txDMAChannel) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue