diff --git a/examples/companion_radio/DataStore.cpp b/examples/companion_radio/DataStore.cpp index ec4de9b1..7a252552 100644 --- a/examples/companion_radio/DataStore.cpp +++ b/examples/companion_radio/DataStore.cpp @@ -211,6 +211,10 @@ void DataStore::loadPrefsInt(const char *filename, NodePrefs& _prefs, double& no #endif #ifdef JOYSTICK_ROTATION _prefs.joystick_rotation = JOYSTICK_ROTATION; +#elif !FEAT_JOYSTICK_ROTATION_SETTING + // OLED: no rotation setting in UI — always reset to 0 so stale e-ink prefs + // (which could have a non-zero value) don't silently reverse the joystick. + _prefs.joystick_rotation = 0; #endif File file = openRead(_fs, filename); @@ -312,6 +316,8 @@ void DataStore::loadPrefsInt(const char *filename, NodePrefs& _prefs, double& no rd(&_prefs.trail_interval_idx, sizeof(_prefs.trail_interval_idx)); rd(&_prefs.trail_min_delta_idx, sizeof(_prefs.trail_min_delta_idx)); rd(&_prefs.trail_units_idx, sizeof(_prefs.trail_units_idx)); + rd(&_prefs.ch_fav_bitmask, sizeof(_prefs.ch_fav_bitmask)); + rd(&_prefs.ch_fav_only, sizeof(_prefs.ch_fav_only)); // Schema sentinel: bumped on layout changes. Mismatch means an older file // (or a different schema); rd() already zero-inits any fields not present, @@ -417,6 +423,8 @@ void DataStore::savePrefs(const NodePrefs& _prefs, double node_lat, double node_ file.write((uint8_t *)&_prefs.trail_interval_idx, sizeof(_prefs.trail_interval_idx)); file.write((uint8_t *)&_prefs.trail_min_delta_idx, sizeof(_prefs.trail_min_delta_idx)); file.write((uint8_t *)&_prefs.trail_units_idx, sizeof(_prefs.trail_units_idx)); + file.write((uint8_t *)&_prefs.ch_fav_bitmask, sizeof(_prefs.ch_fav_bitmask)); + file.write((uint8_t *)&_prefs.ch_fav_only, sizeof(_prefs.ch_fav_only)); // Tail sentinel — must be last. See NodePrefs::SCHEMA_SENTINEL. uint32_t sentinel = NodePrefs::SCHEMA_SENTINEL; diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 21bb1f0c..2b9f4c30 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -1590,7 +1590,18 @@ void UITask::loop() { if (!_locked && curr) { curr->handleInput(c); { uint32_t aoff = autoOffMillis(); if (aoff > 0) _auto_off = millis() + aoff; } // extend auto-off timer +#ifdef PIN_BUZZER + if (buzzer.isPlaying()) { + // Keep the next render at least 300 ms away so the blocking e-ink endFrame() + // doesn't extend the current note. 300 ms covers the slowest note at 120 BPM (1/4). + unsigned long deadline = millis() + 300; + if (_next_refresh < deadline) _next_refresh = deadline; + } else { + _next_refresh = 100; // trigger refresh immediately + } +#else _next_refresh = 100; // trigger refresh +#endif } else if (_locked) { // Locked: eat all keys — wake window is set only when display first turns on _next_refresh = 0;