mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-02-09 18:02:11 +00:00
Fixed issue where HAN stops working when debugging is disabled
This commit is contained in:
@@ -183,7 +183,7 @@ void setup() {
|
||||
}
|
||||
|
||||
DebugConfig debug;
|
||||
if(config.getDebugConfig(debug)) {
|
||||
if(config.getDebugConfig(debug) && (debug.serial || debug.telnet)) {
|
||||
Debug.setSerialEnabled(debug.serial);
|
||||
}
|
||||
#if DEBUG_MODE
|
||||
@@ -352,6 +352,7 @@ void loop() {
|
||||
longPressActive = false;
|
||||
} else {
|
||||
// Single press action
|
||||
debugD("Button was clicked, no action configured");
|
||||
}
|
||||
buttonActive = false;
|
||||
}
|
||||
@@ -376,12 +377,14 @@ void loop() {
|
||||
Debug.setPassword(web.password);
|
||||
}
|
||||
DebugConfig debug;
|
||||
if(config.getDebugConfig(debug)) {
|
||||
if(config.getDebugConfig(debug) && (debug.serial || debug.telnet)) {
|
||||
Debug.begin(wifi.hostname, (uint8_t) debug.level);
|
||||
Debug.setSerialEnabled(debug.serial);
|
||||
if(!debug.telnet) {
|
||||
Debug.stop();
|
||||
}
|
||||
} else {
|
||||
Debug.stop();
|
||||
}
|
||||
if(Debug.isActive(RemoteDebug::INFO)) {
|
||||
debugI("Successfully connected to WiFi!");
|
||||
|
||||
@@ -1237,18 +1237,22 @@ void AmsWebServer::handleSave() {
|
||||
debug.level = server.arg("debugLevel").toInt();
|
||||
|
||||
debugger->stop();
|
||||
if(webConfig.security > 0) {
|
||||
debugger->setPassword(webConfig.password);
|
||||
} else {
|
||||
debugger->setPassword("");
|
||||
}
|
||||
debugger->setSerialEnabled(debug.serial);
|
||||
WiFiConfig wifi;
|
||||
if(config->getWiFiConfig(wifi) && strlen(wifi.hostname) > 0) {
|
||||
debugger->begin(wifi.hostname, (uint8_t) debug.level);
|
||||
if(!debug.telnet) {
|
||||
debugger->stop();
|
||||
if(debug.telnet || debug.serial) {
|
||||
if(webConfig.security > 0) {
|
||||
debugger->setPassword(webConfig.password);
|
||||
} else {
|
||||
debugger->setPassword("");
|
||||
}
|
||||
debugger->setSerialEnabled(debug.serial);
|
||||
WiFiConfig wifi;
|
||||
if(config->getWiFiConfig(wifi) && strlen(wifi.hostname) > 0) {
|
||||
debugger->begin(wifi.hostname, (uint8_t) debug.level);
|
||||
if(!debug.telnet) {
|
||||
debugger->stop();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
debugger->stop();
|
||||
}
|
||||
config->setDebugConfig(debug);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user