From c11a6030d39bc796a47bbe95b4f7fbdf2f8fe085 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 1 Nov 2019 21:15:34 +1100 Subject: [PATCH] HAL_ChibiOS: fixed SPI timeout bug thanks to CUAV for noticing --- libraries/AP_HAL_ChibiOS/SPIDevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/SPIDevice.cpp b/libraries/AP_HAL_ChibiOS/SPIDevice.cpp index 1404078be7..e3b3b27c77 100644 --- a/libraries/AP_HAL_ChibiOS/SPIDevice.cpp +++ b/libraries/AP_HAL_ChibiOS/SPIDevice.cpp @@ -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;