Optimize Update class

- add roll back API to switch the running partition
- do not write the partition magic until the end to prevent booting
into partially written update
This commit is contained in:
me-no-dev
2017-06-02 18:24:26 +03:00
parent dcdf8132d6
commit 063d608e18
2 changed files with 70 additions and 7 deletions

View File

@ -137,6 +137,15 @@ class UpdateClass {
return written;
}
/*
check if there is a firmware on the other OTA partition that you can bootinto
*/
bool canRollBack();
/*
set the other OTA partition as bootable (reboot to enable)
*/
bool rollBack();
private:
void _reset();
void _abort(uint8_t err);