mirror of https://github.com/ARMmbed/mbed-os.git
Fixed writable for LPC1768
Bit 6 (0x40) is true if the peripheral is completely empty. Bit 5 (0x20) is true if the transmit hold register is empty, which is sufficient for it to be writable. The TxIrq uses the same requirement, so now it works together and BufferedSerial doesn't go haywire on LPC1768pull/194/head
parent
26f4773c60
commit
19ae097c62
|
@ -368,7 +368,7 @@ int serial_writable(serial_t *obj) {
|
|||
if (NC != uart_data[obj->index].sw_cts.pin)
|
||||
isWritable = gpio_read(&uart_data[obj->index].sw_cts) == 0;
|
||||
if (isWritable)
|
||||
isWritable = obj->uart->LSR & 0x40;
|
||||
isWritable = obj->uart->LSR & 0x20;
|
||||
return isWritable;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue