From 353eca79b6075ccb349d8a8be928e3f31fd6f334 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Mar 2021 16:39:05 +1100 Subject: [PATCH] HAL_ChibiOS: fixed 32/64 micros bug in CAN select() --- libraries/AP_HAL_ChibiOS/CANFDIface.cpp | 4 ++-- libraries/AP_HAL_ChibiOS/CanIface.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/CANFDIface.cpp b/libraries/AP_HAL_ChibiOS/CANFDIface.cpp index 1e8121214a..b812e85e2c 100644 --- a/libraries/AP_HAL_ChibiOS/CANFDIface.cpp +++ b/libraries/AP_HAL_ChibiOS/CANFDIface.cpp @@ -994,7 +994,7 @@ bool CANIface::select(bool &read, bool &write, { const bool in_read = read; const bool in_write= write; - uint64_t time = AP_HAL::micros(); + uint64_t time = AP_HAL::micros64(); if (!read && !write) { //invalid request @@ -1018,7 +1018,7 @@ bool CANIface::select(bool &read, bool &write, if ((read && in_read) || (write && in_write)) { return true; } - time = AP_HAL::micros(); + time = AP_HAL::micros64(); } return false; } diff --git a/libraries/AP_HAL_ChibiOS/CanIface.cpp b/libraries/AP_HAL_ChibiOS/CanIface.cpp index 0c2a666bac..50d4485992 100644 --- a/libraries/AP_HAL_ChibiOS/CanIface.cpp +++ b/libraries/AP_HAL_ChibiOS/CanIface.cpp @@ -711,7 +711,7 @@ bool CANIface::select(bool &read, bool &write, { const bool in_read = read; const bool in_write= write; - uint64_t time = AP_HAL::micros(); + uint64_t time = AP_HAL::micros64(); if (!read && !write) { //invalid request @@ -737,7 +737,7 @@ bool CANIface::select(bool &read, bool &write, if ((read && in_read) || (write && in_write)) { return true; } - time = AP_HAL::micros(); + time = AP_HAL::micros64(); } #endif // #if !defined(HAL_BUILD_AP_PERIPH) && !defined(HAL_BOOTLOADER_BUILD) return true;