refactor: replace hint feedback with debug crosshair

This commit is contained in:
2026-02-19 15:12:02 -08:00
parent ec8ec4cd18
commit dd1c13fbbc
10 changed files with 16 additions and 91 deletions

View File

@@ -348,11 +348,3 @@ HoldState DisplayDriverTFT::updateHold(unsigned long holdMs) {
}
return h;
}
void DisplayDriverTFT::updateHint(int x, int y, bool active) {
float period = active ? 500.0f : 2000.0f;
float t = fmodf(millis(), period) / period;
uint8_t v = static_cast<uint8_t>(30.0f + 30.0f * sinf(t * 2.0f * PI));
uint16_t col = _tft.color565(v, v, v);
_tft.drawRect(x - 40, y - 20, 80, 40, col);
}

View File

@@ -12,7 +12,6 @@ public:
void render(const ScreenState& state) override;
TouchEvent readTouch() override;
HoldState updateHold(unsigned long holdMs) override;
void updateHint(int x, int y, bool active) override;
int width() override { return _tft.width(); }
int height() override { return _tft.height(); }

View File

@@ -326,11 +326,3 @@ HoldState DisplayDriverTFT::updateHold(unsigned long holdMs) {
}
return h;
}
void DisplayDriverTFT::updateHint(int x, int y, bool active) {
float period = active ? 500.0f : 2000.0f;
float t = fmodf(millis(), period) / period;
uint8_t v = static_cast<uint8_t>(30.0f + 30.0f * sinf(t * 2.0f * PI));
uint16_t col = _tft.color565(v, v, v);
_tft.drawRect(x - 40, y - 20, 80, 40, col);
}

View File

@@ -13,7 +13,6 @@ public:
TouchEvent readTouch() override;
int dashboardTouch(int x, int y);
HoldState updateHold(unsigned long holdMs) override;
void updateHint(int x, int y, bool active) override;
int width() override { return DISPLAY_WIDTH; }
int height() override { return DISPLAY_HEIGHT; }

View File

@@ -433,21 +433,11 @@ void DisplayDriverGFX::drawDashboard(const ScreenState& state) {
}
}
void DisplayDriverGFX::updateHint(int x, int y, bool active) {
void DisplayDriverGFX::drawDebugTouch(int x, int y) {
if(!_gfx)
return;
static uint32_t lastTime = 0;
uint32_t now = millis();
if(now - lastTime < 100)
return;
lastTime = now;
// active=true: faster pulse (500ms), active=false: slower pulse (2000ms)
float period = active ? 500.0f : 2000.0f;
float t = fmodf(now, period) / period;
uint8_t v = static_cast<uint8_t>(30.0f + 30.0f * sinf(t * 2.0f * 3.14159f));
uint16_t col = _gfx->color565(v, v, v);
_gfx->drawCircle(x, y, 50, col);
const int size = 20;
_gfx->drawLine(x - size, y, x + size, y, TFT_RED);
_gfx->drawLine(x, y - size, x, y + size, TFT_RED);
}

View File

@@ -13,7 +13,7 @@ public:
TouchEvent readTouch() override;
HoldState updateHold(unsigned long holdMs) override;
void updateHint(int x, int y, bool active) override;
void drawDebugTouch(int x, int y) override;
int width() override;
int height() override;