From c2011570f742ad8d47b523afaa4e04231bd54885 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 30 Dec 2023 08:52:44 +1100 Subject: [PATCH] HAL_ChibiOS: use chSysLock for CAN critical section this avoids an assert in some code paths that combine with hrt functions --- libraries/AP_HAL_ChibiOS/CANFDIface.h | 4 ++-- libraries/AP_HAL_ChibiOS/CANIface.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/CANFDIface.h b/libraries/AP_HAL_ChibiOS/CANFDIface.h index 9b21444161..81815fdaa0 100644 --- a/libraries/AP_HAL_ChibiOS/CANFDIface.h +++ b/libraries/AP_HAL_ChibiOS/CANFDIface.h @@ -73,11 +73,11 @@ class ChibiOS::CANIface : public AP_HAL::CANIface struct CriticalSectionLocker { CriticalSectionLocker() { - chSysSuspend(); + chSysLock(); } ~CriticalSectionLocker() { - chSysEnable(); + chSysUnlock(); } }; diff --git a/libraries/AP_HAL_ChibiOS/CANIface.h b/libraries/AP_HAL_ChibiOS/CANIface.h index 47809fa79b..b85ed4e538 100644 --- a/libraries/AP_HAL_ChibiOS/CANIface.h +++ b/libraries/AP_HAL_ChibiOS/CANIface.h @@ -69,11 +69,11 @@ class ChibiOS::CANIface : public AP_HAL::CANIface struct CriticalSectionLocker { CriticalSectionLocker() { - chSysSuspend(); + chSysLock(); } ~CriticalSectionLocker() { - chSysEnable(); + chSysUnlock(); } };