Files
ink-board/main/touch/touch.h
GW_MC e458256193 Add main application logic and touch handling functionality
- Implemented main application entry point in main.cpp, initializing queues and event groups.
- Created TouchHandler and EInkTouchHandler classes for handling touch events.
- Added a minimal event loop for touch processing in touch.cpp.
- Introduced unit tests for the hello world application in pytest_hello_world.py.
- Added configuration files for CI and Wokwi support.
- Created empty header files for network and UI modules.
2026-01-17 20:09:33 +08:00

33 lines
1.0 KiB
C++

#include "info/info.h"
class TouchHandler {
public:
TouchHandler(QueueHandle_t touch_queue);
// the system_event_group is used to set touch-calibrated bit
virtual void init(EventGroupHandle_t system_event_group) = 0;
virtual void start_event_loop() = 0;
virtual ~TouchHandler() = 0;
private:
TouchHandler(const TouchHandler&) = delete;
TouchHandler& operator=(const TouchHandler&) = delete;
};
class EInkTouchHandler : public TouchHandler {
public:
EInkTouchHandler(QueueHandle_t touch_queue);
void init(EventGroupHandle_t system_event_group) override;
void start_event_loop() override;
~EInkTouchHandler() override;
private:
// Task adapter used for FreeRTOS task creation. Forwards to
// `run_event_loop()` using the `this` pointer passed as the task param.
static void task_adapter(void* arg);
// Instance method implementing the touch event loop.
void run_event_loop();
// prevent copying
EInkTouchHandler(const EInkTouchHandler&) = delete;
EInkTouchHandler& operator=(const EInkTouchHandler&) = delete;
};