AP_Periph: add and use a "bool read(c)" method to AP_HAL

this is much less likely to not work vs the int16_t equivalent
This commit is contained in:
Peter Barker 2023-02-21 20:35:58 +11:00 committed by Peter Barker
parent a649dff390
commit ba3aa0c158
1 changed files with 2 additions and 2 deletions

View File

@ -503,8 +503,8 @@ void AP_Periph_FW::check_for_serial_reboot_cmd(const int8_t serial_index)
const char reboot_string_len = sizeof(reboot_string)-1; // -1 is to remove the null termination
static uint16_t index[hal.num_serial];
const int16_t data = uart->read();
if (data < 0 || data > 0xff) {
uint8_t data;
if (!uart->read(data)) {
// read error
continue;
}