diff --git a/libraries/AP_CANManager/AP_CANSensor.cpp b/libraries/AP_CANManager/AP_CANSensor.cpp index 025dfd8036..8e300eba09 100644 --- a/libraries/AP_CANManager/AP_CANSensor.cpp +++ b/libraries/AP_CANManager/AP_CANSensor.cpp @@ -127,7 +127,7 @@ bool CANSensor::add_interface(AP_HAL::CANIface* can_iface) return false; } - if (!_can_iface->set_event_handle(&_event_handle)) { + if (!_can_iface->set_event_handle(&sem_handle)) { debug_can(AP_CANManager::LOG_ERROR, "Cannot add event handle"); return false; } diff --git a/libraries/AP_CANManager/AP_CANSensor.h b/libraries/AP_CANManager/AP_CANSensor.h index e340b71fac..2cd775f4c3 100644 --- a/libraries/AP_CANManager/AP_CANSensor.h +++ b/libraries/AP_CANManager/AP_CANSensor.h @@ -77,7 +77,7 @@ private: bool is_aux_11bit_driver; AP_CANDriver *_can_driver; - HAL_EventHandle _event_handle; + HAL_BinarySemaphore sem_handle; AP_HAL::CANIface* _can_iface; #ifdef HAL_BUILD_AP_PERIPH diff --git a/libraries/AP_CANManager/AP_SLCANIface.cpp b/libraries/AP_CANManager/AP_SLCANIface.cpp index dcd04dcff1..496e8850ed 100644 --- a/libraries/AP_CANManager/AP_SLCANIface.cpp +++ b/libraries/AP_CANManager/AP_SLCANIface.cpp @@ -561,11 +561,11 @@ void SLCAN::CANIface::update_slcan_port() } } -bool SLCAN::CANIface::set_event_handle(AP_HAL::EventHandle* evt_handle) +bool SLCAN::CANIface::set_event_handle(AP_HAL::BinarySemaphore *sem_handle) { // When in passthrough mode methods is handled through can iface if (_can_iface) { - return _can_iface->set_event_handle(evt_handle); + return _can_iface->set_event_handle(sem_handle); } return false; } diff --git a/libraries/AP_CANManager/AP_SLCANIface.h b/libraries/AP_CANManager/AP_SLCANIface.h index 2f3f35382c..a15ac4f588 100644 --- a/libraries/AP_CANManager/AP_SLCANIface.h +++ b/libraries/AP_CANManager/AP_SLCANIface.h @@ -111,7 +111,7 @@ public: void reset_params(); // Overriden methods - bool set_event_handle(AP_HAL::EventHandle* evt_handle) override; + bool set_event_handle(AP_HAL::BinarySemaphore *sem_handle) override; uint16_t getNumFilters() const override; uint32_t getErrorCount() const override; void get_stats(ExpandingString &) override;