mirror of https://github.com/ArduPilot/ardupilot
AP_CANManager: reimplement with BinarySemaphore
This commit is contained in:
parent
5d1eb145cd
commit
e22e07fbbd
|
@ -127,7 +127,7 @@ bool CANSensor::add_interface(AP_HAL::CANIface* can_iface)
|
||||||
return false;
|
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");
|
debug_can(AP_CANManager::LOG_ERROR, "Cannot add event handle");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ private:
|
||||||
bool is_aux_11bit_driver;
|
bool is_aux_11bit_driver;
|
||||||
|
|
||||||
AP_CANDriver *_can_driver;
|
AP_CANDriver *_can_driver;
|
||||||
HAL_EventHandle _event_handle;
|
HAL_BinarySemaphore sem_handle;
|
||||||
AP_HAL::CANIface* _can_iface;
|
AP_HAL::CANIface* _can_iface;
|
||||||
|
|
||||||
#ifdef HAL_BUILD_AP_PERIPH
|
#ifdef HAL_BUILD_AP_PERIPH
|
||||||
|
|
|
@ -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
|
// When in passthrough mode methods is handled through can iface
|
||||||
if (_can_iface) {
|
if (_can_iface) {
|
||||||
return _can_iface->set_event_handle(evt_handle);
|
return _can_iface->set_event_handle(sem_handle);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ public:
|
||||||
void reset_params();
|
void reset_params();
|
||||||
|
|
||||||
// Overriden methods
|
// 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;
|
uint16_t getNumFilters() const override;
|
||||||
uint32_t getErrorCount() const override;
|
uint32_t getErrorCount() const override;
|
||||||
void get_stats(ExpandingString &) override;
|
void get_stats(ExpandingString &) override;
|
||||||
|
|
Loading…
Reference in New Issue