diff --git a/zephcore/Kconfig b/zephcore/Kconfig index 14110e8..388a40b 100644 --- a/zephcore/Kconfig +++ b/zephcore/Kconfig @@ -766,6 +766,7 @@ config ZEPHCORE_REPEATER_GPS_INTERVAL_SEC config ZEPHCORE_GPS_NMEA_DUMP bool "Log every NMEA sentence received from the GNSS module" + depends on GNSS help Print each sentence the GNSS driver parses, plus everything else the module emits, to the console. For diagnosing a receiver that reports @@ -799,6 +800,12 @@ config ZEPHCORE_GPS_NAV_MODE config ZEPHCORE_GPS_SAT_DIAG bool "GPS per-constellation satellite diagnostics" + # Must depend on GNSS, not just select GNSS_SATELLITES: on a board with + # no GNSS at all (native Linux, xiao_nrf52840) GNSS is n, and y-selecting + # a symbol whose dependencies are unmet is a Kconfig error that aborts the + # build — not a warning. The repeater default below would otherwise turn + # this on for every GNSS-less repeater target. + depends on GNSS select GNSS_SATELLITES default y if ZEPHCORE_ROLE_REPEATER help diff --git a/zephcore/adapters/gps/ZephyrGPSManager.cpp b/zephcore/adapters/gps/ZephyrGPSManager.cpp index 6c49fcf..33dd3d9 100644 --- a/zephcore/adapters/gps/ZephyrGPSManager.cpp +++ b/zephcore/adapters/gps/ZephyrGPSManager.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #if defined(CONFIG_SOC_NRF52840) #include #endif @@ -82,6 +83,12 @@ LOG_MODULE_REGISTER(zephcore_gps, CONFIG_ZEPHCORE_GPS_LOG_LEVEL); #define HAS_GPS_POWER_REGULATOR 0 #endif +/* Runtime diagnostics toggle. Declared OUT here, not inside the HAS_GNSS + * block: gps_set_diag()/gps_get_diag()/gps_get_diag_report() are part of the + * unconditional public API and are compiled on boards with no GNSS at all, + * so a declaration hidden behind HAS_GNSS breaks every such board. */ +static bool gps_diag_on = false; + /* ========== GPS Power Strategy ========== * Module power is GPIO/regulator controlled — GNSS driver PM is not used * for the module itself: @@ -482,7 +489,6 @@ static struct { int64_t at_ms; /* uptime when configuration last ran */ } gps_cfg_diag; -static bool gps_diag_on = false; /* Module identification string, captured by the GNSS driver from the reply to * its version query (CASIC parts answer in-band as a $GPTXT sentence).