This commit is contained in:
2026-02-16 11:53:09 -08:00
parent 7763aadf51
commit 5313222f4f
4 changed files with 189 additions and 70 deletions

View File

@@ -16,6 +16,24 @@ struct HoldState {
float progress = 0.0f; // 0.0 to 1.0
};
// Add near the top, alongside existing structs
struct HintAnim {
bool running = false;
unsigned long startMs = 0;
unsigned long lastPlayMs = 0;
// Timing (ms)
static const unsigned long INITIAL_DELAY = 1500; // pause before first hint
static const unsigned long FILL_DUR = 400; // ease-in to peak
static const unsigned long HOLD_DUR = 250; // dwell at peak
static const unsigned long DRAIN_DUR = 500; // ease-out back to 0
static const unsigned long REPEAT_DELAY = 5000; // gap before replaying
static constexpr float PEAK = 0.35f; // fill to 35%
unsigned long totalDur() const { return FILL_DUR + HOLD_DUR + DRAIN_DUR; }
};
class DisplayManager {
public:
DisplayManager();
@@ -26,8 +44,14 @@ public:
int dashboardTouch(uint16_t x, uint16_t y);
HoldState updateHold(unsigned long requiredMs);
void startHintCycle(); // call when entering alert screen
void stopHint(); // call when real hold begins or leaving alert
bool updateHint(); // call each loop; returns true if it drew something
private:
HintAnim _hint;
void drawHintBar(float progress); // ← add this
TFT_eSPI _tft;
Dashboard _dash;