M2 step 3: GNSS Service, with standby and the clock from a Fix

The GNSS Service reads the receiver (UART 15/13, 115200, 1 KB buffer)
from its 50 ms tick and feeds the NMEA parser. With a Fix it sets the
clock (GNSS is the most trusted TimeSource) and refreshes it every 10
min. Settings gets GNSS On/Off and the coordinate format (Q64).

Off puts the receiver in standby with $PCAS12,65535, renewed hourly; On
wakes it with a hot start, $PCAS10,0. Both measured on the device: the
output stops within a second, and a command wakes it within a second.

Commands: gnss status (Fix, satellites per constellation, bytes and
sentences), gnss nmea on|off, gnss send <sentence>, gnss restart. The
probe is gone; never drive GPIO 15 (the receiver's output): the first
probe's swapped-pin attempt silenced it until a power cycle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-04 22:26:53 +02:00
co-authored by Claude Opus 5.5
parent c9b1ecb772
commit 988253ef02
13 changed files with 257 additions and 32 deletions
@@ -107,6 +107,19 @@ void test_names_are_text_rows_with_their_byte_limits() {
TEST_ASSERT_EQUAL_STRING("RORO", f.menu.value(shortName).c_str());
}
void test_gnss_and_coordinate_rows_toggle() {
Fixture f;
int gnss = f.row(SettingsMenu::Row::Gnss), coords = f.row(SettingsMenu::Row::Coordinates);
TEST_ASSERT_EQUAL_STRING("On", f.menu.value(gnss).c_str());
TEST_ASSERT_EQUAL_STRING("Decimal", f.menu.value(coords).c_str());
f.menu.toggle(gnss);
f.menu.toggle(coords);
TEST_ASSERT_FALSE(f.settings.getBool(Setting::GnssEnabled));
TEST_ASSERT_TRUE(f.settings.getBool(Setting::CoordinatesDms));
TEST_ASSERT_EQUAL_STRING("Off", f.menu.value(gnss).c_str());
TEST_ASSERT_EQUAL_STRING("Deg min sec", f.menu.value(coords).c_str());
}
int main() {
UNITY_BEGIN();
RUN_TEST(test_every_row_has_a_label);
@@ -118,5 +131,6 @@ int main() {
RUN_TEST(test_brightness_steps_with_left_right_within_bounds);
RUN_TEST(test_wifi_is_a_page);
RUN_TEST(test_names_are_text_rows_with_their_byte_limits);
RUN_TEST(test_gnss_and_coordinate_rows_toggle);
return UNITY_END();
}