Skip to content

Commit 3ce0b9e

Browse files
committed
Save data to flash in case of restart from console
1 parent b8282ef commit 3ce0b9e

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/OpenKNX/Common.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,8 @@ namespace OpenKNX
768768

769769
openknx.flash.save();
770770
logIndentDown();
771+
logInfoP("System will restart now");
772+
delay(10);
771773
}
772774

773775
void Common::processBeforeTablesUnload()
@@ -1018,8 +1020,7 @@ namespace OpenKNX
10181020

10191021
void Common::restart()
10201022
{
1021-
logInfoP("System will restart now");
1022-
delay(10);
1023+
openknx.common.processBeforeRestart(); // this function also saves the flash
10231024
knx.platform().restart();
10241025
}
10251026

src/OpenKNX/Flash/Default.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ namespace OpenKNX
192192
if (moduleSize > 0 && !loadedModules[moduleId])
193193
{
194194
logDebugP("Init unloaded module %s (%i)", module->name().c_str(), moduleId);
195-
module->readFlash(new uint8_t[0], 0);
195+
module->readFlash(nullptr, 0);
196196
}
197197
}
198198
}

0 commit comments

Comments
 (0)