diff --git a/src/hasp_config.cpp b/src/hasp_config.cpp
index 386f6177..56a44a42 100644
--- a/src/hasp_config.cpp
+++ b/src/hasp_config.cpp
@@ -85,6 +85,18 @@ bool configSet(uint16_t& value, const JsonVariant& setting, const __FlashStringH
}
return false;
}
+bool configSet(int32_t& value, const JsonVariant& setting, const __FlashStringHelper* fstr_name)
+{
+ if(!setting.isNull()) {
+ int32_t val = setting.as();
+ if(value != val) {
+ confDebugSet(fstr_name);
+ value = val;
+ return true;
+ }
+ }
+ return false;
+}
bool configSet(lv_color_t& value, const JsonVariant& setting, const __FlashStringHelper* fstr_name)
{
lv_color32_t c32;
diff --git a/src/hasp_config.h b/src/hasp_config.h
index 6712dca1..b021e0cb 100644
--- a/src/hasp_config.h
+++ b/src/hasp_config.h
@@ -28,6 +28,7 @@ bool configSet(bool& value, const JsonVariant& setting, const __FlashStringHelpe
bool configSet(int8_t& value, const JsonVariant& setting, const __FlashStringHelper* fstr_name);
bool configSet(uint8_t& value, const JsonVariant& setting, const __FlashStringHelper* fstr_name);
bool configSet(uint16_t& value, const JsonVariant& setting, const __FlashStringHelper* fstr_name);
+bool configSet(int32_t& value, const JsonVariant& setting, const __FlashStringHelper* fstr_name);
bool configSet(lv_color_t& value, const JsonVariant& setting, const __FlashStringHelper* fstr_name);
void configMaskPasswords(JsonDocument& settings);
diff --git a/src/hasp_debug.cpp b/src/hasp_debug.cpp
index f8280c9a..f554cdd6 100644
--- a/src/hasp_debug.cpp
+++ b/src/hasp_debug.cpp
@@ -13,7 +13,6 @@
#define debug_print(io, ...) io->printf(__VA_ARGS__)
#define debug_newline(io) io->println()
-// bool debugSerialStarted = false;
#else
#include
#include
@@ -22,7 +21,6 @@
#define debug_print(io, ...) fprintf(stdout, __VA_ARGS__)
#define debug_newline(io) fprintf(stdout, "\n")
-// bool debugSerialStarted = true;
#endif
bool debugAnsiCodes = true;
@@ -125,24 +123,10 @@ void debugStart(void)
#endif
#endif
-
- /*
- if(debugSerialStarted) {
-
- // Serial.println();
- // Serial.println(debugHaspHeader());
- // debug_flush();
- }
-
- // prepare syslog configuration here (can be anywhere before first call of
- // log/logf method)
- */
}
void debugStop()
-{
- // if(debugSerialStarted) debug_flush();
-}
+{}
/* ===== Special Event Processors ===== */
diff --git a/src/lang/en_US.h b/src/lang/en_US.h
index 7bddf52f..f53bf654 100644
--- a/src/lang/en_US.h
+++ b/src/lang/en_US.h
@@ -40,6 +40,7 @@
#define D_SETTING_ENABLED "Enabled"
#define D_SETTING_DISABLED "Disabled"
+#define D_SETTING_DEFAULT "Default"
#define D_NETWORK_IP_ADDRESS_RECEIVED "Received IP address %s"
#define D_NETWORK_ONLINE "online"
diff --git a/src/lang/es_ES.h b/src/lang/es_ES.h
index 0c90f15f..ef75f967 100644
--- a/src/lang/es_ES.h
+++ b/src/lang/es_ES.h
@@ -40,6 +40,7 @@
#define D_SETTING_ENABLED "Habilitado" // New
#define D_SETTING_DISABLED "Deshabilitado" // New
+#define D_SETTING_DEFAULT "Default" // New
#define D_NETWORK_IP_ADDRESS_RECEIVED "Se recibió la dirección IP: %s"
#define D_NETWORK_ONLINE "en linea"
@@ -146,7 +147,9 @@
#define D_HTTP_MAIN_MENU "Menú principal"
#define D_HTTP_REBOOT "Reiniciar"
#define D_HTTP_CONFIGURATION "Configuración"
-#define D_HTTP_CONFIG_CHANGED "La configuración ha cambiado, haga clic en Reiniciar para guardar los cambios en la memoria flash."
+#define D_HTTP_CONFIG_CHANGED \
+ "La configuración ha cambiado, haga clic en Reiniciar para guardar los cambios en la " \
+ "memoria flash."
#define D_HTTP_SENDING_PAGE "Se envió pagina %S a %s"
#define D_HTTP_FOOTER "por Francis Van Roie"
diff --git a/src/lang/fr_FR.h b/src/lang/fr_FR.h
index bd73b687..05fd762f 100644
--- a/src/lang/fr_FR.h
+++ b/src/lang/fr_FR.h
@@ -40,6 +40,7 @@
#define D_SETTING_ENABLED "Activé"
#define D_SETTING_DISABLED "Désactivé"
+#define D_SETTING_DEFAULT "Défaut"
#define D_NETWORK_IP_ADDRESS_RECEIVED "Adresse IP reçue %s"
#define D_NETWORK_ONLINE "en ligne"
@@ -146,7 +147,9 @@
#define D_HTTP_MAIN_MENU "Menu principal"
#define D_HTTP_REBOOT "Redémarrer"
#define D_HTTP_CONFIGURATION "Configuration"
-#define D_HTTP_CONFIG_CHANGED "La configuration a changé, cliquez sur Redémarrer pour enregistrer les modifications dans le flash."
+#define D_HTTP_CONFIG_CHANGED \
+ "La configuration a changé, cliquez sur Redémarrer pour enregistrer les modifications dans " \
+ "le flash."
#define D_HTTP_SENDING_PAGE "La page %S envoyée à %s"
#define D_HTTP_FOOTER "par Francis Van Roie"
diff --git a/src/lang/hu_HU.h b/src/lang/hu_HU.h
index 5290b2c6..4dca9d0f 100644
--- a/src/lang/hu_HU.h
+++ b/src/lang/hu_HU.h
@@ -28,7 +28,7 @@
#define D_FILE_SIZE_MEGABYTES "MiB"
#define D_FILE_SIZE_GIGABYTES "GiB"
#define D_FILE_SIZE_DIVIDER 1024
-#define D_DECIMAL_POINT ","
+#define D_DECIMAL_POINT ","
#define D_SERVICE_STARTING "Indítás..."
#define D_SERVICE_STARTED "Elindítva"
@@ -40,6 +40,7 @@
#define D_SETTING_ENABLED "Engedélyezve"
#define D_SETTING_DISABLED "Letiltva"
+#define D_SETTING_DEFAULT "Alapértelmezett"
#define D_NETWORK_IP_ADDRESS_RECEIVED "Beállított IP-cím: %s"
#define D_NETWORK_ONLINE "online"
@@ -146,7 +147,8 @@
#define D_HTTP_MAIN_MENU "Főmenü"
#define D_HTTP_REBOOT "Újraindítás"
#define D_HTTP_CONFIGURATION "Beállítások"
-#define D_HTTP_CONFIG_CHANGED "A konfiguráció meg lett változtatva. Indítson újra a beállítások mentéséhez!"
+#define D_HTTP_CONFIG_CHANGED \
+ "A konfiguráció meg lett változtatva. Indítson újra a beállítások mentéséhez!"
#define D_HTTP_SENDING_PAGE "%S oldal küldése %s-re"
#define D_HTTP_FOOTER "készítette: Francis Van Roie"
diff --git a/src/lang/nl_NL.h b/src/lang/nl_NL.h
index 60388268..e9b57eb7 100644
--- a/src/lang/nl_NL.h
+++ b/src/lang/nl_NL.h
@@ -32,6 +32,7 @@
#define D_SETTING_ENABLED "Ingeschakeld"
#define D_SETTING_DISABLED "Uitgeschakeld"
+#define D_SETTING_DEFAULT "Standaard"
#define D_SERVICE_STARTING "Starten..."
#define D_SERVICE_STARTED "Gestart"
@@ -146,7 +147,8 @@
#define D_HTTP_MAIN_MENU "Hoofdmenu"
#define D_HTTP_REBOOT "Herstarten"
#define D_HTTP_CONFIGURATION "Configuratie"
-#define D_HTTP_CONFIG_CHANGED "De configuratie is gewijzigd, klik op Herstart om de wijzigingen naar flash te schrijven."
+#define D_HTTP_CONFIG_CHANGED \
+ "De configuratie is gewijzigd, klik op Herstart om de wijzigingen naar flash te schrijven."
#define D_HTTP_SENDING_PAGE "Pagina %S verstuurd naar %s"
#define D_HTTP_FOOTER "door Francis Van Roie"
diff --git a/src/lang/pt_PT.h b/src/lang/pt_PT.h
index b2f0ccce..f5d51cd4 100644
--- a/src/lang/pt_PT.h
+++ b/src/lang/pt_PT.h
@@ -41,6 +41,7 @@
#define D_SETTING_ENABLED "Ativado"
#define D_SETTING_DISABLED "Desativado"
+#define D_SETTING_DEFAULT "Default" // New
#define D_NETWORK_IP_ADDRESS_RECEIVED "Foi atribuído endereço IP: %s"
#define D_NETWORK_ONLINE "Online"
@@ -147,7 +148,8 @@
#define D_HTTP_MAIN_MENU "Menu Principal"
#define D_HTTP_REBOOT "Reiniciar"
#define D_HTTP_CONFIGURATION "Configuração"
-#define D_HTTP_CONFIG_CHANGED "Configuration has changed, please click Restart to save changes to flash." // New
+#define D_HTTP_CONFIG_CHANGED \
+ "Configuration has changed, please click Restart to save changes to flash." // New
#define D_HTTP_SENDING_PAGE "Foi enviado página %S a %s"
#define D_HTTP_FOOTER "por Francis Van Roie"
diff --git a/src/lang/ro_RO.h b/src/lang/ro_RO.h
index 08748e03..123b1ac9 100644
--- a/src/lang/ro_RO.h
+++ b/src/lang/ro_RO.h
@@ -32,6 +32,7 @@
#define D_SETTING_ENABLED "Activ"
#define D_SETTING_DISABLED "Inactiv"
+#define D_SETTING_DEFAULT "Implicit"
#define D_SERVICE_STARTING "Pornire..."
#define D_SERVICE_STARTED "Pornit"
@@ -146,7 +147,8 @@
#define D_HTTP_MAIN_MENU "Meniu principal"
#define D_HTTP_REBOOT "Repornire"
#define D_HTTP_CONFIGURATION "Setări"
-#define D_HTTP_CONFIG_CHANGED "Configurația s-a modificat, pentru a se salva, este necesară repornirea dispozitivului."
+#define D_HTTP_CONFIG_CHANGED \
+ "Configurația s-a modificat, pentru a se salva, este necesară repornirea dispozitivului."
#define D_HTTP_SENDING_PAGE "Pagina %S trimisă la %s"
#define D_HTTP_FOOTER "de Francis Van Roie"
diff --git a/src/log/hasp_debug.cpp b/src/log/hasp_debug.cpp
index 6c867844..6b382188 100644
--- a/src/log/hasp_debug.cpp
+++ b/src/log/hasp_debug.cpp
@@ -83,8 +83,7 @@ WiFiUDP* syslogClient = NULL;
// uint16_t serialInputIndex = 0; // Empty buffer
// char serialInputBuffer[220] = "";
// uint16_t historyIndex = sizeof(serialInputBuffer) - 1; // Empty buffer
-uint16_t debugSerialBaud = SERIAL_SPEED / 10; // Multiplied by 10
-// extern bool debugSerialStarted;
+int32_t debugSerialBaud = SERIAL_SPEED;
extern bool debugAnsiCodes;
extern dispatch_conf_t dispatch_setings;
@@ -142,7 +141,7 @@ bool debugGetConfig(const JsonObject& settings)
if(debugAnsiCodes != settings[FPSTR(FP_DEBUG_ANSI)]) changed = true;
settings[FPSTR(FP_DEBUG_ANSI)] = (uint8_t)debugAnsiCodes;
- if(debugSerialBaud != settings[FPSTR(FP_CONFIG_BAUD)].as()) changed = true;
+ if(debugSerialBaud != settings[FPSTR(FP_CONFIG_BAUD)]) changed = true;
settings[FPSTR(FP_CONFIG_BAUD)] = debugSerialBaud;
if(dispatch_setings.teleperiod != settings[FPSTR(FP_DEBUG_TELEPERIOD)].as()) changed = true;
@@ -179,11 +178,23 @@ bool debugSetConfig(const JsonObject& settings)
configOutput(settings, TAG_DEBG);
bool changed = false;
- /* Ansi Code Settings */
- changed |= configSet(debugAnsiCodes, settings[FPSTR(FP_DEBUG_ANSI)], F("debugAnsi"));
-
/* Serial Settings */
changed |= configSet(debugSerialBaud, settings[FPSTR(FP_CONFIG_BAUD)], F("debugSerialBaud"));
+ if(changed) { // baudrate was changed
+ switch(debugSerialBaud) {
+ case 960:
+ case 1920:
+ case 3840:
+ case 5760:
+ case 7488:
+ case 11520:
+ debugSerialBaud *= 10; // multiply old values
+ break;
+ }
+ }
+
+ /* Ansi Code Settings */
+ changed |= configSet(debugAnsiCodes, settings[FPSTR(FP_DEBUG_ANSI)], F("debugAnsi"));
/* Teleperiod Settings */
changed |= configSet(dispatch_setings.teleperiod, settings[FPSTR(FP_DEBUG_TELEPERIOD)], F("debugTelePeriod"));
@@ -346,38 +357,31 @@ void debugPrintSuffix(uint8_t tag, int level, Print* _logOutput)
// Start Serial Port at correct
void debugStartSerial()
{
- uint32_t baudrate = 0;
- if(debugSerialBaud == 0) {
- baudrate = SERIAL_SPEED;
- } else {
- baudrate = debugSerialBaud * 10;
+ if(debugSerialBaud < 0) {
+ LOG_WARNING(TAG_DEBG, F(D_SERVICE_DISABLED " (%u Bps)"), debugSerialBaud);
+ // return;
}
- if(baudrate >= 9600u) { /* the baudrates are stored divided by 10 */
+ uint32_t baudrate = debugSerialBaud;
+ if(baudrate < 9600) baudrate = SERIAL_SPEED;
#if defined(STM32F4xx) || defined(STM32F7xx)
-#ifndef STM32_SERIAL1 // Define what Serial port to use for log output
- Serial.setRx(PA3); // User Serial2
- Serial.setTx(PA2);
+#ifndef STM32_SERIAL1 // Define what Serial port to use for log output
+ Serial.setRx(PA3); // User Serial2
+ Serial.setTx(PA2);
#endif
#endif
- Serial.begin(baudrate); /* prepare for possible serial debug */
- delay(10);
- Log.registerOutput(0, &Serial, HASP_LOG_LEVEL, true); // LOG_LEVEL_VERBOSE
+ Serial.begin(baudrate); /* prepare for possible serial debug */
+ delay(10);
+ Log.registerOutput(0, &Serial, HASP_LOG_LEVEL, true); // LOG_LEVEL_VERBOSE
- // debugSerialStarted = true;
+ Serial.println();
+ debugPrintHaspHeader(&Serial);
+ Serial.flush();
- Serial.println();
- debugPrintHaspHeader(&Serial);
- Serial.flush();
-
- LOG_INFO(TAG_DEBG, F(D_SERVICE_STARTED " @ %u Bps"), baudrate);
- LOG_INFO(TAG_DEBG, F("Environment: " PIOENV));
-
- } else {
- LOG_WARNING(TAG_DEBG, F(D_SERVICE_DISABLED " (%u Bps)"), baudrate);
- }
+ LOG_INFO(TAG_DEBG, F(D_SERVICE_STARTED " @ %u bps"), debugSerialBaud);
+ LOG_INFO(TAG_DEBG, F(D_INFO_ENVIRONMENT ": " PIOENV));
}
// Do NOT call Log function before debugSetup is called
@@ -391,7 +395,9 @@ void debugSetup(JsonObject settings)
Log.unregisterOutput(3);
#if HASP_USE_CONFIG > 0
- debugSerialBaud = settings[FPSTR(FP_CONFIG_BAUD)].as();
+ if(!settings[FPSTR(FP_CONFIG_BAUD)].isNull()) {
+ debugSerialBaud = settings[FPSTR(FP_CONFIG_BAUD)].as();
+ }
#endif
}
diff --git a/src/sys/svc/hasp_http.cpp b/src/sys/svc/hasp_http.cpp
index f5b367a0..eee9bd51 100644
--- a/src/sys/svc/hasp_http.cpp
+++ b/src/sys/svc/hasp_http.cpp
@@ -82,11 +82,10 @@ extern const uint8_t SCRIPT_JS_GZ_END[] asm("_binary_data_script_js_gz_end");
HTTPUpload* upload;
-static const char HTTP_MENU_BUTTON[] PROGMEM =
- "
";
+// const char HTTP_MENU_BUTTON[] PROGMEM =
+// "";
const char MAIN_MENU_BUTTON[] PROGMEM = "" D_HTTP_MAIN_MENU "";
-const char MIT_LICENSE[] PROGMEM = "MIT License";
const char HTTP_DOCTYPE[] PROGMEM = "";
@@ -598,9 +597,6 @@ static void webHandleAbout()
if(!httpIsAuthenticated(F("about"))) return;
{ // Send Content
- String mitLicense((char*)0);
- mitLicense = FPSTR(MIT_LICENSE);
-
String httpMessage((char*)0);
httpMessage.reserve(HTTP_PAGE_SIZE);
@@ -1769,13 +1765,17 @@ static void webHandleDebugConfig()
uint16_t baudrate = settings[FPSTR(FP_CONFIG_BAUD)].as();
httpMessage += F("");
httpMessage += F("
");
// Telemetry Period
diff --git a/src/sys/svc/hasp_http_async.cpp b/src/sys/svc/hasp_http_async.cpp
index b4d1d35c..8f2ea422 100644
--- a/src/sys/svc/hasp_http_async.cpp
+++ b/src/sys/svc/hasp_http_async.cpp
@@ -96,8 +96,8 @@ AsyncWebSocket ws("/ws"); // access at ws://[esp ip]/ws
// HTTPUpload* upload;
-static const char HTTP_MENU_BUTTON[] PROGMEM =
- "";
+// static const char HTTP_MENU_BUTTON[] PROGMEM =
+// "";
const char MAIN_MENU_BUTTON[] PROGMEM =
"";