diff --git a/examples/companion_radio/Waypoint.h b/examples/companion_radio/Waypoint.h index 23c58cbd..ba57d1cb 100644 --- a/examples/companion_radio/Waypoint.h +++ b/examples/companion_radio/Waypoint.h @@ -74,9 +74,9 @@ public: if (magic != SAVE_MAGIC) return false; uint8_t ver = 0, res = 0; uint16_t cnt = 0; - file.read(&ver, 1); - file.read(&res, 1); - file.read((uint8_t*)&cnt, sizeof(cnt)); + if (file.read(&ver, 1) != 1) return false; + if (file.read(&res, 1) != 1) return false; + if (file.read((uint8_t*)&cnt, sizeof(cnt)) != (int)sizeof(cnt)) return false; if (ver != SAVE_VERSION) return false; if (cnt > CAPACITY) cnt = CAPACITY; _count = 0; diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 449a152a..01f867bd 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -1523,8 +1523,12 @@ void UITask::shutdown(bool restart){ // Power off GPS before SYSTEMOFF — GPIO pins retain state in NRF52 SYSTEMOFF, // so without this the GPS stays powered and drains the battery. // gps_enabled is already persisted to flash; applyGpsPrefs() restores it on next boot. + // Use the same active level as MicroNMEALocationProvider::stop() (default active-high). + #ifndef PIN_GPS_EN_ACTIVE + #define PIN_GPS_EN_ACTIVE HIGH + #endif pinMode(PIN_GPS_EN, OUTPUT); - digitalWrite(PIN_GPS_EN, LOW); + digitalWrite(PIN_GPS_EN, !PIN_GPS_EN_ACTIVE); #endif _board->powerOff(); } diff --git a/src/helpers/ui/buzzer.cpp b/src/helpers/ui/buzzer.cpp index 0aa4066d..02deb5da 100644 --- a/src/helpers/ui/buzzer.cpp +++ b/src/helpers/ui/buzzer.cpp @@ -41,7 +41,7 @@ uint16_t genericBuzzer::_noteFreq(char letter, bool sharp, uint8_t octave) { uint8_t idx = NOTE_IDX[letter - 'a']; if (sharp) { if (++idx >= 12) { idx = 0; octave++; } } if (octave < 4) octave = 4; - if (octave > 7) octave = 7; + if (octave > 8) octave = 8; // parser accepts octaves 4-8; B8 (~7.9 kHz) is within range uint32_t f = (uint32_t)CHROM4[idx] << (octave - 4); return (uint16_t)(f > 25000 ? 25000 : f); }