1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-29 05:21:37 +03:00

minor enchancement

This commit is contained in:
John Doe
2015-07-03 16:14:04 +03:00
committed by Ivan Grokhotkov
parent ace974aede
commit 3427299065
2 changed files with 5 additions and 3 deletions

View File

@ -57,10 +57,10 @@ class UpdaterClass {
void clearError(){ _error = UPDATE_ERROR_OK; }
bool hasError(){ return _error != UPDATE_ERROR_OK; }
bool isRunning(){ return _size > 0; }
bool isFinished(){ return hasError()?true:(_currentAddress == (_startAddress + _size)); }
bool isFinished(){ return _currentAddress == (_startAddress + _size); }
size_t size(){ return _size; }
size_t progress(){ return _currentAddress - _startAddress; }
size_t remaining(){ return hasError()?0:(size() - progress()); }
size_t remaining(){ return _size - (_currentAddress - _startAddress); }
/*
Template to write from objects that expose
@ -116,4 +116,4 @@ class UpdaterClass {
extern UpdaterClass Update;
#endif
#endif