AP_IOMCU: read many bytes using read(buffer, len) method

This commit is contained in:
Peter Barker 2023-02-22 10:27:43 +11:00 committed by Tom Pittenger
parent e0728aa088
commit a6831805f1
1 changed files with 1 additions and 5 deletions

View File

@ -516,11 +516,7 @@ bool AP_IOMCU::read_registers(uint8_t page, uint8_t offset, uint8_t count, uint1
protocol_fail_count++;
return false;
}
for (uint8_t i=0; i<n; i++) {
if (i < sizeof(pkt)) {
b[i] = uart.read();
}
}
uart.read(b, MIN(n, sizeof(pkt)));
uint8_t got_crc = pkt.crc;
pkt.crc = 0;