mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
fixed gps init value
This commit is contained in:
parent
678915ef3b
commit
4aebc57add
2 changed files with 10 additions and 9 deletions
|
|
@ -807,15 +807,6 @@ void MyMesh::begin(bool has_display) {
|
|||
|
||||
radio_set_params(_prefs.freq, _prefs.bw, _prefs.sf, _prefs.cr);
|
||||
radio_set_tx_power(_prefs.tx_power_dbm);
|
||||
|
||||
#if ENV_INCLUDE_GPS == 1
|
||||
sensors.setSettingValue("gps", _prefs.gps_enabled ? "1" : "0");
|
||||
if (_prefs.gps_interval > 0) {
|
||||
char interval_str[12]; // Max: 24 hours = 86400 seconds (5 digits + null)
|
||||
sprintf(interval_str, "%u", _prefs.gps_interval);
|
||||
sensors.setSettingValue("gps_interval", interval_str);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *MyMesh::getNodeName() {
|
||||
|
|
|
|||
|
|
@ -216,6 +216,16 @@ void setup() {
|
|||
|
||||
sensors.begin();
|
||||
|
||||
#if ENV_INCLUDE_GPS == 1
|
||||
// Apply GPS preferences after sensors.begin() so gps_detected is set
|
||||
sensors.setSettingValue("gps", the_mesh.getNodePrefs()->gps_enabled ? "1" : "0");
|
||||
if (the_mesh.getNodePrefs()->gps_interval > 0) {
|
||||
char interval_str[12];
|
||||
sprintf(interval_str, "%u", the_mesh.getNodePrefs()->gps_interval);
|
||||
sensors.setSettingValue("gps_interval", interval_str);
|
||||
}
|
||||
#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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue