HAL_ChibiOS: fixed SPI timeout bug

thanks to CUAV for noticing
This commit is contained in:
Andrew Tridgell 2019-11-01 21:15:34 +11:00 committed by Randy Mackay
parent a140ab1415
commit c11a6030d3
1 changed files with 1 additions and 1 deletions

View File

@ -200,7 +200,7 @@ bool SPIDevice::do_transfer(const uint8_t *send, uint8_t *recv, uint32_t len)
// expect this timeout to trigger unless there is a severe MCU
// error
const uint32_t timeout_us = 20000U + len * 32U;
msg_t msg = osalThreadSuspendTimeoutS(&spi_devices[device_desc.bus].driver->thread, TIME_MS2I(timeout_us));
msg_t msg = osalThreadSuspendTimeoutS(&spi_devices[device_desc.bus].driver->thread, TIME_US2I(timeout_us));
osalSysUnlock();
if (msg == MSG_TIMEOUT) {
ret = false;