mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-01 03:26:58 +03:00
speed :) and prevent write if we are not running
This commit is contained in:
committed by
Ivan Grokhotkov
parent
703ab8df64
commit
1741bc68b6
@ -15,9 +15,8 @@ class UpdaterClass {
|
||||
public:
|
||||
UpdaterClass();
|
||||
/*
|
||||
Call this to check and erase the space needed for the update
|
||||
Call this to check the space needed for the update
|
||||
Will return false if there is not enough space
|
||||
Or the erase of the flash failed
|
||||
*/
|
||||
bool begin(size_t size);
|
||||
|
||||
@ -72,7 +71,7 @@ class UpdaterClass {
|
||||
template<typename T>
|
||||
size_t write(T &data){
|
||||
size_t written = 0;
|
||||
if(hasError())
|
||||
if(hasError()||!isRunning())
|
||||
return 0;
|
||||
size_t available = data.available();
|
||||
while(available){
|
||||
|
Reference in New Issue
Block a user