mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 02:52:11 +01:00
Add FS recovery for failed FS updates.
This commit is contained in:
parent
2bb23e6d3e
commit
a3cb1d63fe
6 changed files with 41 additions and 4 deletions
|
|
@ -7,12 +7,14 @@
|
|||
#include "Sockets.h"
|
||||
#include "MQTT.h"
|
||||
#include "ConfigFile.h"
|
||||
#include "GitOTA.h"
|
||||
|
||||
extern Preferences pref;
|
||||
extern SomfyShadeController somfy;
|
||||
extern SocketEmitter sockEmit;
|
||||
extern ConfigSettings settings;
|
||||
extern MQTTClass mqtt;
|
||||
extern GitUpdater git;
|
||||
|
||||
|
||||
uint8_t rxmode = 0; // Indicates whether the radio is in receive mode. Just to ensure there isn't more than one interrupt hooked.
|
||||
|
|
@ -545,6 +547,7 @@ bool SomfyShadeController::begin() {
|
|||
return true;
|
||||
}
|
||||
void SomfyShadeController::commit() {
|
||||
if(git.lockFS) return;
|
||||
ShadeConfigFile file;
|
||||
file.begin();
|
||||
file.save(this);
|
||||
|
|
@ -553,6 +556,7 @@ void SomfyShadeController::commit() {
|
|||
this->lastCommit = millis();
|
||||
}
|
||||
void SomfyShadeController::writeBackup() {
|
||||
if(git.lockFS) return;
|
||||
ShadeConfigFile file;
|
||||
file.begin("/controller.backup", false);
|
||||
file.backup(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue