mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_HAL_ChibiOS: fix infinite loop for large SPI transfers
len is 32 bits; i may integer-wrap back to zero at 65535+1
This commit is contained in:
parent
4f48233b43
commit
f780a5c358
@ -179,7 +179,7 @@ bool SPIDevice::do_transfer(const uint8_t *send, uint8_t *recv, uint32_t len)
|
||||
bool ret = true;
|
||||
|
||||
#if defined(HAL_SPI_USE_POLLED)
|
||||
for (uint16_t i=0; i<len; i++) {
|
||||
for (uint32_t i=0; i<len; i++) {
|
||||
uint8_t ret = spiPolledExchange(spi_devices[device_desc.bus].driver, send?send[i]:0);
|
||||
if (recv) {
|
||||
recv[i] = ret;
|
||||
|
Loading…
Reference in New Issue
Block a user