feat(docs): update README and AGENTS.md with RTK instructions
This commit is contained in:
@@ -204,8 +204,6 @@ TouchEvent DisplayDriverTFT::readTouch() {
|
||||
return evt;
|
||||
}
|
||||
|
||||
uint16_t DisplayDriverTFT::getRawTouchZ() { return _tft.getTouchRawZ(); }
|
||||
|
||||
void DisplayDriverTFT::transformTouch(int* x, int* y) {
|
||||
// Resistive touch panel is rotated 90° vs display - swap coordinates
|
||||
int temp = *x;
|
||||
|
||||
@@ -11,7 +11,6 @@ public:
|
||||
void setBacklight(bool on) override;
|
||||
void render(const ScreenState& state) override;
|
||||
TouchEvent readTouch() override;
|
||||
uint16_t getRawTouchZ();
|
||||
HoldState updateHold(unsigned long holdMs) override;
|
||||
void updateHint(int x, int y, bool active) override;
|
||||
int width() override { return _tft.width(); }
|
||||
|
||||
@@ -146,11 +146,33 @@ void DisplayDriverTFT::drawDashboard(const ScreenState& st) {
|
||||
TouchEvent DisplayDriverTFT::readTouch() {
|
||||
TouchEvent evt;
|
||||
uint16_t tx, ty;
|
||||
if(_tft.getTouch(&tx, &ty)) {
|
||||
uint8_t touched = _tft.getTouch(&tx, &ty, 100);
|
||||
|
||||
// Detect transitions (press/release)
|
||||
if(touched && !_touchWasPressed) {
|
||||
// Press transition: finger just touched down
|
||||
evt.pressed = true;
|
||||
_touchDownX = tx;
|
||||
_touchDownY = ty;
|
||||
evt.downX = _touchDownX;
|
||||
evt.downY = _touchDownY;
|
||||
} else if(!touched && _touchWasPressed) {
|
||||
// Release transition: finger just lifted
|
||||
evt.released = true;
|
||||
evt.downX = _touchDownX;
|
||||
evt.downY = _touchDownY;
|
||||
}
|
||||
|
||||
// Current position if still touched
|
||||
if(touched) {
|
||||
evt.x = tx;
|
||||
evt.y = ty;
|
||||
evt.downX = _touchDownX;
|
||||
evt.downY = _touchDownY;
|
||||
}
|
||||
|
||||
// Track previous state for next call
|
||||
_touchWasPressed = touched;
|
||||
return evt;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,4 +29,9 @@ private:
|
||||
ScreenID _lastScreen = ScreenID::BOOT;
|
||||
BootStage _lastBootStage = BootStage::SPLASH;
|
||||
bool _needsRedraw = true;
|
||||
|
||||
// Touch tracking for press/release detection
|
||||
bool _touchWasPressed = false;
|
||||
int _touchDownX = -1;
|
||||
int _touchDownY = -1;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user