diff --git a/examples/companion_radio/MyMesh.h b/examples/companion_radio/MyMesh.h index e8c81cfd..2c49510c 100644 --- a/examples/companion_radio/MyMesh.h +++ b/examples/companion_radio/MyMesh.h @@ -165,6 +165,12 @@ protected: public: void savePrefs() { _store->savePrefs(_prefs, sensors.node_lat, sensors.node_lon); } +#if ENV_INCLUDE_GPS == 1 + void applyGpsPrefs() { + sensors.setSettingValue("gps", _prefs.gps_enabled ? "1" : "0"); + } +#endif + private: void writeOKFrame(); void writeErrFrame(uint8_t err_code); diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index eff9efca..876dc9c3 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -213,6 +213,10 @@ void setup() { sensors.begin(); +#if ENV_INCLUDE_GPS == 1 + the_mesh.applyGpsPrefs(); +#endif + #ifdef DISPLAY_CLASS ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved #endif