mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-27 07:18: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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user