ardupilot/libraries/AP_HAL_ChibiOS/EventSource.h

27 lines
790 B
C
Raw Normal View History

2020-05-31 09:20:46 -03:00
#pragma once
#include <AP_HAL/AP_HAL.h>
2020-05-31 09:20:46 -03:00
#include <stdint.h>
#include <AP_HAL/AP_HAL_Boards.h>
#include <AP_HAL/AP_HAL_Macros.h>
#include <AP_HAL/EventHandle.h>
#include "AP_HAL_ChibiOS_Namespace.h"
#include <ch.hpp>
#if CH_CFG_USE_EVENTS == TRUE
class ChibiOS::EventSource : public AP_HAL::EventSource {
// Single event source to be shared across multiple users
chibios_rt::EventSource ch_evt_src_;
public:
// generate event from thread context
void signal(uint32_t evt_mask) override;
// generate event from interrupt context
void signalI(uint32_t evt_mask) override;
// Wait on an Event handle, method for internal use by EventHandle
bool wait(uint16_t duration_us, AP_HAL::EventHandle* evt_handle) override;
2020-05-31 09:20:46 -03:00
};
#endif //#if CH_CFG_USE_EVENTS == TRUE