Skip to content

Commit

Permalink
AP_Generator: avoid use of int16_t-read
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Jul 2, 2024
1 parent 42805aa commit 85f8981
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions libraries/AP_Generator/AP_Generator_IE_FuelCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ void AP_Generator_IE_FuelCell::update()
const uint32_t now = AP_HAL::millis();

// Read any available data
uint32_t nbytes = MIN(_uart->available(),30u);
while (nbytes-- > 0) {
const int16_t c = _uart->read();
if (c < 0) {
// Nothing to decode
for (uint8_t i=0; i<30; i++) { // process at most n bytes
uint8_t c;
if (!_uart->read(c)) {
break;
}

Expand Down

0 comments on commit 85f8981

Please sign in to comment.