Skip to content

Commit f372bcb

Browse files
author
Cruz Monrreal
authored
Merge pull request #6611 from pauluap/compiler_warning_UARTSerial
Uninitialized variable warning in UARTSerial at -O3
2 parents a15c2f0 + d6c5f16 commit f372bcb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/UARTSerial.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,11 @@ void UARTSerial::rx_irq(void)
305305
void UARTSerial::tx_irq(void)
306306
{
307307
bool was_full = _txbuf.full();
308+
char data;
308309

309310
/* Write to the peripheral if there is something to write
310311
* and if the peripheral is available to write. */
311-
while (!_txbuf.empty() && SerialBase::writeable()) {
312-
char data;
313-
_txbuf.pop(data);
312+
while (SerialBase::writeable() && _txbuf.pop(data)) {
314313
SerialBase::_base_putc(data);
315314
}
316315

0 commit comments

Comments
 (0)