mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-03 02:36:11 +00:00
fix: GPS shutdown active-level, buzzer octave-8 consistency, waypoint header read checks
- UITask::shutdown(): power GPS off using !PIN_GPS_EN_ACTIVE instead of hardcoded LOW, matching MicroNMEALocationProvider::stop() (still LOW on current active-high devices, but correct for a future active-low GPS). - buzzer _noteFreq(): clamp octave to 8 instead of 7 so the parser's accepted range (4-8) is fully consumed; previously an octave-8 digit was clamped away and could leak into the stream as the next note's duration. - Waypoint::readFrom(): check read() return for version/reserved/count header bytes so a truncated file is rejected instead of using garbage count. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
6c5a40a8ce
commit
fcdacaa3bc
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user