snapshot
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user