mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-22 17:57:32 +00:00
feat: T-Watch Ultra support
This commit is contained in:
@@ -198,6 +198,8 @@
|
||||
#define HW_VENDOR meshtastic_HardwareModel_HELTEC_V4
|
||||
#elif defined(M5STACK_UNITC6L)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_M5STACK_C6L
|
||||
#elif defined(T_WATCH_ULTRA)
|
||||
#define HW_VENDOR meshtastic_HardwareModel_T_WATCH_ULTRA
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
30
src/platform/extra_variants/t_watch_ultra/variant.cpp
Normal file
30
src/platform/extra_variants/t_watch_ultra/variant.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "configuration.h"
|
||||
|
||||
#ifdef T_DECK_ULTRA
|
||||
|
||||
#include "TouchDrvCST92xx.h"
|
||||
#include "input/TouchScreenImpl1.h"
|
||||
#include <Wire.h>
|
||||
|
||||
static TouchDrvCST92xx touchDrv;
|
||||
|
||||
static bool readTouch(int16_t *x, int16_t *y)
|
||||
{
|
||||
return touchDrv.isPressed() && touchDrv.getPoint(x, y, 1);
|
||||
}
|
||||
|
||||
// T-Watch Ultra specific init
|
||||
void lateInitVariant()
|
||||
{
|
||||
if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) {
|
||||
pinmode(TP_INT, INPUT_PULLUP);
|
||||
touchDrv.setPins(-1, TP_INT);
|
||||
if (touchDrv.begin(&Wire, 0x1A, I2C_SDA, I2C_SCL)) {
|
||||
touchScreenImpl1 = new TouchScreenImpl1(410, 502, readTouch);
|
||||
touchScreenImpl1->init();
|
||||
} else {
|
||||
LOG_ERROR("failed to initialize CST92xx");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user