Browse Source
Merge pull request #2018 from got-root/fix/companion-radio-gps-persistence
fix(companion_radio): apply persisted GPS enabled setting on boot for ui-orig devices
pull/2149/head
Liam Cottle
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
10 additions and
0 deletions
-
examples/companion_radio/MyMesh.h
-
examples/companion_radio/main.cpp
|
|
@ -165,6 +165,12 @@ protected: |
|
|
public: |
|
|
public: |
|
|
void savePrefs() { _store->savePrefs(_prefs, sensors.node_lat, sensors.node_lon); } |
|
|
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: |
|
|
private: |
|
|
void writeOKFrame(); |
|
|
void writeOKFrame(); |
|
|
void writeErrFrame(uint8_t err_code); |
|
|
void writeErrFrame(uint8_t err_code); |
|
|
|
|
|
@ -213,6 +213,10 @@ void setup() { |
|
|
|
|
|
|
|
|
sensors.begin(); |
|
|
sensors.begin(); |
|
|
|
|
|
|
|
|
|
|
|
#if ENV_INCLUDE_GPS == 1 |
|
|
|
|
|
the_mesh.applyGpsPrefs(); |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#ifdef DISPLAY_CLASS |
|
|
#ifdef DISPLAY_CLASS |
|
|
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved
|
|
|
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved
|
|
|
#endif |
|
|
#endif |
|
|
|