wrong count checked for uartWrite
This commit is contained in:
parent
38513ed804
commit
fb8f1244b7
@ -250,7 +250,7 @@ void uartWrite(uart_t* uart, uint8_t c)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UART_MUTEX_LOCK();
|
UART_MUTEX_LOCK();
|
||||||
while(uart->dev->status.rxfifo_cnt == 0x7F);
|
while(uart->dev->status.txfifo_cnt == 0x7F);
|
||||||
uart->dev->fifo.rw_byte = c;
|
uart->dev->fifo.rw_byte = c;
|
||||||
UART_MUTEX_UNLOCK();
|
UART_MUTEX_UNLOCK();
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ void uartWriteBuf(uart_t* uart, const uint8_t * data, size_t len)
|
|||||||
}
|
}
|
||||||
UART_MUTEX_LOCK();
|
UART_MUTEX_LOCK();
|
||||||
while(len) {
|
while(len) {
|
||||||
while(len && uart->dev->status.rxfifo_cnt < 0x7F) {
|
while(len && uart->dev->status.txfifo_cnt < 0x7F) {
|
||||||
uart->dev->fifo.rw_byte = *data++;
|
uart->dev->fifo.rw_byte = *data++;
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user