Ken Van Hoeylandt 9581978fc7
Re-implement Core2 and other improvements (#141)
- Create real drivers instead of wrapping M5Unified/M5GFX
- Display HAL improvements (better default base class behaviour)
- Fixed bug with LVGL statusbar service locking (would hang indefinitely waiting for mutex, causing WDT issues)
- Fixes for `Critical.h`
- Fixes and improvements for `Dispatcher` and `DispatcherThread`
2024-12-30 14:17:47 +01:00

33 lines
738 B
C++

#pragma once
#include "hal/Touch.h"
#include "TactilityCore.h"
#include "ft6x36/FT6X36.h"
class Core2Touch : public tt::hal::Touch {
private:
lv_indev_t* _Nullable deviceHandle = nullptr;
FT6X36 driver = FT6X36(I2C_NUM_0, GPIO_NUM_39);
tt::Thread driverThread;
bool interruptDriverThread = false;
tt::Mutex mutex;
lv_point_t lastPoint = { .x = 0, .y = 0 };
lv_indev_state_t lastState = LV_INDEV_STATE_RELEASED;
bool shouldInterruptDriverThread();
public:
Core2Touch();
bool start(lv_display_t* display) override;
bool stop() override;
void readLast(lv_indev_data_t* data);
lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; }
void driverThreadMain();
};