mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-14 15:54:47 +00:00
Fixed save crash
This commit is contained in:
parent
4c92e592d6
commit
254e010594
@ -68,6 +68,7 @@ AmsMqttHandler* mqttHandler = NULL;
|
||||
HanReader hanReader;
|
||||
|
||||
Stream *hanSerial;
|
||||
SoftwareSerial *swSerial = NULL;
|
||||
|
||||
GpioConfig gpioConfig;
|
||||
MeterConfig meterConfig;
|
||||
@ -497,7 +498,12 @@ void setupHanPort(int pin, int newMeterType) {
|
||||
} else {
|
||||
debugD("Software serial");
|
||||
Serial.flush();
|
||||
SoftwareSerial *swSerial = new SoftwareSerial(pin);
|
||||
|
||||
if(swSerial != NULL) {
|
||||
swSerial->end();
|
||||
delete swSerial;
|
||||
}
|
||||
swSerial = new SoftwareSerial(pin);
|
||||
|
||||
switch(newMeterType) {
|
||||
case METER_TYPE_KAMSTRUP:
|
||||
|
||||
@ -191,7 +191,7 @@ void AmsWebServer::temperaturePost() {
|
||||
delay(1);
|
||||
}
|
||||
|
||||
if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
|
||||
//if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
|
||||
if(config->save()) {
|
||||
printD("Successfully saved temperature sensors");
|
||||
server.sendHeader("Location", String("/temperature"), true);
|
||||
@ -1068,7 +1068,7 @@ void AmsWebServer::handleSave() {
|
||||
|
||||
printI("Saving configuration now...");
|
||||
|
||||
if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
|
||||
//if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
|
||||
if (config->save()) {
|
||||
printI("Successfully saved.");
|
||||
if(config->isWifiChanged()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user