From 710b9ea956dcfcf292884a03e7d6cc00bf23b68c Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Fri, 20 Dec 2024 14:51:51 +1100 Subject: [PATCH] AP_HAL: add option to disable rx callback for CAN iface --- libraries/AP_HAL/CANIface.cpp | 7 ++++--- libraries/AP_HAL/CANIface.h | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libraries/AP_HAL/CANIface.cpp b/libraries/AP_HAL/CANIface.cpp index 74fa742f9cb77..2d13aa4e0815c 100644 --- a/libraries/AP_HAL/CANIface.cpp +++ b/libraries/AP_HAL/CANIface.cpp @@ -64,9 +64,9 @@ int16_t AP_HAL::CANIface::receive(CANFrame& out_frame, uint64_t& out_ts_monotoni #ifndef HAL_BOOTLOADER_BUILD WITH_SEMAPHORE(callbacks.sem); #endif - for (auto &cb : callbacks.cb) { - if (cb != nullptr) { - cb(get_iface_num(), out_frame); + for (uint8_t i=0; i