1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-11 15:22:13 +03:00

Utilized UPDATE_ERROR_ERASE, added _setError function and refactored code (#4190)

* Added _setError function in the header file

_setError function wraps a few lines to eliminate repetitiveness when debugging for errors.

* Added _setError function

_setError function wraps a few lines to eliminate repetitiveness when debugging for errors.
This commit is contained in:
egemenertugrul
2018-01-18 19:34:35 +03:00
committed by Develo
parent b08ff10269
commit d5c43f0102
2 changed files with 36 additions and 46 deletions

View File

@ -61,11 +61,11 @@ class UpdaterClass {
If all bytes are written
this call will write the config to eboot
and return true
If there is already an update running but is not finished and !evenIfRemainanig
If there is already an update running but is not finished and !evenIfRemaining
or there is an error
this will clear everything and return false
the last error is available through getError()
evenIfRemaining is helpfull when you update without knowing the final size first
evenIfRemaining is helpful when you update without knowing the final size first
*/
bool end(bool evenIfRemaining = false);
@ -148,6 +148,8 @@ class UpdaterClass {
bool _verifyHeader(uint8_t data);
bool _verifyEnd();
void _setError(int error);
bool _async;
uint8_t _error;
uint8_t *_buffer;