mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: drivers/UARTSerial.cpp
- Revision:
- 186:707f6e361f3e
- Parent:
- 180:96ed750bd169
- Child:
- 187:0387e8f68319
--- a/drivers/UARTSerial.cpp Thu Apr 19 17:12:19 2018 +0100 +++ b/drivers/UARTSerial.cpp Fri Jun 22 16:45:37 2018 +0100 @@ -305,12 +305,11 @@ void UARTSerial::tx_irq(void) { bool was_full = _txbuf.full(); + char data; /* Write to the peripheral if there is something to write * and if the peripheral is available to write. */ - while (!_txbuf.empty() && SerialBase::writeable()) { - char data; - _txbuf.pop(data); + while (SerialBase::writeable() && _txbuf.pop(data)) { SerialBase::_base_putc(data); }