mirror of
https://github.com/usatiuk/cardboy.git
synced 2025-10-28 15:17:48 +01:00
28 lines
747 B
C++
28 lines
747 B
C++
#pragma once
|
|
|
|
#include <cardboy/sdk/event_bus.hpp>
|
|
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/event_groups.h"
|
|
#include "freertos/queue.h"
|
|
|
|
namespace cardboy::backend::esp {
|
|
|
|
class EventBus final : public cardboy::sdk::IEventBus {
|
|
public:
|
|
EventBus();
|
|
~EventBus() override;
|
|
|
|
void signal(std::uint32_t bits) override;
|
|
void signalFromISR(std::uint32_t bits) override;
|
|
std::uint32_t wait(std::uint32_t mask, std::uint32_t timeout_ms) override;
|
|
void postEvent(const cardboy::sdk::AppEvent& event) override;
|
|
bool popEvent(cardboy::sdk::AppEvent& outEvent) override;
|
|
|
|
private:
|
|
EventGroupHandle_t group;
|
|
QueueHandle_t eventQueue;
|
|
};
|
|
|
|
} // namespace cardboy::backend::esp
|