diff --git a/data_embed/index.html b/data_embed/index.html index 509925b..7429c7f 100644 --- a/data_embed/index.html +++ b/data_embed/index.html @@ -59,7 +59,7 @@
- +
@@ -117,19 +117,25 @@

Device Settings

+
+ + +
-
- - -
-
+ +
+
+ + +
+
diff --git a/include/taskWebServer.h b/include/taskWebServer.h index c3aa21e..3d14b40 100644 --- a/include/taskWebServer.h +++ b/include/taskWebServer.h @@ -43,6 +43,8 @@ static const char *const PREF_DEV_BT_EN = "bt_enabled"; static const char *const PREF_DEV_BT_EN_INIT = "bt_enabled_init"; static const char *const PREF_DEV_OL_EN = "oled_enabled"; static const char *const PREF_DEV_OL_EN_INIT = "ol_enabled_init"; +static const char *const PREF_DEV_SHOW_RX_TIME = "sh_rxtime"; +static const char *const PREF_DEV_SHOW_RX_TIME_INIT = "sh_rxtime_init"; typedef struct { String callsign; diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 9929abf..fcdb5d7 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -478,11 +478,20 @@ void setup(){ } fixed_beacon_enabled = preferences.getBool(PREF_APRS_FIXED_BEACON_PRESET); + if (!preferences.getBool(PREF_APRS_FIXED_BEACON_INTERVAL_PRESET_INIT)){ preferences.putBool(PREF_APRS_FIXED_BEACON_INTERVAL_PRESET_INIT, true); preferences.putInt(PREF_APRS_FIXED_BEACON_INTERVAL_PRESET, fix_beacon_interval/1000); } fix_beacon_interval = preferences.getInt(PREF_APRS_FIXED_BEACON_INTERVAL_PRESET) * 1000; + + if (!preferences.getBool(PREF_DEV_SHOW_RX_TIME_INIT)){ + preferences.putBool(PREF_DEV_SHOW_RX_TIME_INIT, true); + preferences.putInt(PREF_DEV_SHOW_RX_TIME, showRXTime/1000); + } + showRXTime = preferences.getInt(PREF_DEV_SHOW_RX_TIME) * 1000; + + if (clear_preferences){ delay(1000); if(digitalRead(BUTTON)==LOW){ diff --git a/src/taskWebServer.cpp b/src/taskWebServer.cpp index e0230bd..8157f94 100644 --- a/src/taskWebServer.cpp +++ b/src/taskWebServer.cpp @@ -122,6 +122,7 @@ void handle_Cfg() { jsonData += jsonLineFromPreferenceBool(PREF_DEV_OL_EN); jsonData += jsonLineFromPreferenceBool(PREF_APRS_SHOW_CMT); jsonData += jsonLineFromPreferenceBool(PREF_DEV_BT_EN); + jsonData += jsonLineFromPreferenceInt(PREF_DEV_SHOW_RX_TIME); jsonData += jsonLineFromString("FreeHeap", String(ESP.getFreeHeap()).c_str()); jsonData += jsonLineFromString("HeapSize", String(ESP.getHeapSize()).c_str()); jsonData += jsonLineFromString("FreeSketchSpace", String(ESP.getFreeSketchSpace()).c_str(), true); @@ -155,6 +156,7 @@ void handle_SaveAPRSCfg() { if (server.hasArg(PREF_APRS_LONGITUDE_PRESET)){ preferences.putString(PREF_APRS_LONGITUDE_PRESET, server.arg(PREF_APRS_LONGITUDE_PRESET)); } + preferences.putBool(PREF_APRS_SHOW_BATTERY, server.hasArg(PREF_APRS_SHOW_BATTERY)); preferences.putBool(PREF_APRS_SHOW_ALTITUDE, server.hasArg(PREF_APRS_SHOW_ALTITUDE)); preferences.putBool(PREF_APRS_FIXED_BEACON_PRESET, server.hasArg(PREF_APRS_FIXED_BEACON_PRESET)); @@ -168,7 +170,9 @@ void handle_SaveAPRSCfg() { void handle_saveDeviceCfg(){ preferences.putBool(PREF_DEV_BT_EN, server.hasArg(PREF_DEV_BT_EN)); preferences.putBool(PREF_DEV_OL_EN, server.hasArg(PREF_DEV_OL_EN)); - + if (server.hasArg(PREF_DEV_SHOW_RX_TIME)){ + preferences.putInt(PREF_DEV_SHOW_RX_TIME, server.arg(PREF_DEV_SHOW_RX_TIME).toInt()); + } server.sendHeader("Location", "/"); server.send(302,"text/html", ""); }