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 LPC1768
pull/194/head
Sissors 2014-03-01 16:38:03 +01:00
parent 26f4773c60
commit 19ae097c62
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}