We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 399c42b commit 2b1fcf1Copy full SHA for 2b1fcf1
src/emonesp.h
@@ -161,4 +161,6 @@
161
extern String currentfirmware;
162
extern String buildenv;
163
164
+void restart_system();
165
+
166
#endif // _EMONESP_H
src/main.cpp
@@ -256,3 +256,19 @@ void hardware_setup()
256
257
enableLoopWDT();
258
}
259
260
+class SystemRestart : public MicroTasks::Alarm
261
+{
262
+ public:
263
+ void Trigger()
264
+ {
265
+ DBUGLN("Restarting...");
266
+ net_wifi_disconnect();
267
+ ESPAL.reset();
268
+ }
269
+} systemRestartAlarm;
270
271
+void restart_system()
272
273
+ systemRestartAlarm.Set(1000, false);
274
+}
0 commit comments