JAndrassy/ArduinoOTA

call function before flash

hedva92 opened this issue · 1 comments

Would it be possible to implement a method that would call some predefined function before flashing the firmware? Something like save variable values ​​to external memory (or etc), when this function ended, the firmware would be flashed. Ty

it is not in the examples, but there is onStart and beforeApply

 ArduinoOTA.onStart([]() {watchdogStop();});
 ArduinoOTA.beforeApply(shutdown);
void shutdown() {
  eventsSave();
  statsSave();
}