mirror of https://github.com/ARMmbed/mbed-os.git
Fix UARTSerial emergency unbuffered write
The length calculation in UARTSerial::write_unbuffered was wrong, meaning it would truncate output data to half length. This would show up if `platform.stdio-buffered-serial` was configured to true, `platform.stdio-convert-newlines` was still false - `mbed_error` crashes would be garbled. This wasn't usually spotted because applications generally have both settings false or both true, and if newline conversion is on, then `mbed_error_puts` writes 1 character at a time to FileHandle::write, avoiding the length error.pull/10358/head
parent
71c84e851f
commit
380b27e741
|
@ -147,7 +147,6 @@ ssize_t UARTSerial::write_unbuffered(const char *buf_ptr, size_t length)
|
|||
|
||||
for (size_t data_written = 0; data_written < length; data_written++) {
|
||||
SerialBase::_base_putc(*buf_ptr++);
|
||||
data_written++;
|
||||
}
|
||||
|
||||
return length;
|
||||
|
|
Loading…
Reference in New Issue