File tree Expand file tree Collapse file tree 2 files changed +17
-13
lines changed
hardware/esp8266com/esp8266
libraries/ESP8266WebServer/examples/WebUpdate Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -51,18 +51,6 @@ bool UpdaterClass::begin(size_t size){
51
51
return false ;
52
52
}
53
53
54
- // erase the neede space
55
- noInterrupts ();
56
- int rc = SPIEraseAreaEx (updateStartAddress, roundedSize);
57
- interrupts ();
58
- if (rc){
59
- _error = UPDATE_ERROR_ERASE;
60
- #ifdef DEBUG_UPDATER
61
- printError (DEBUG_UPDATER);
62
- #endif
63
- return false ;
64
- }
65
-
66
54
// initialize
67
55
_startAddress = updateStartAddress;
68
56
_currentAddress = _startAddress;
@@ -122,7 +110,19 @@ bool UpdaterClass::end(bool evenIfRemaining){
122
110
bool UpdaterClass::_writeBuffer (){
123
111
WDT_FEED ();
124
112
noInterrupts ();
125
- int rc = SPIWrite (_currentAddress, _buffer, _bufferLen);
113
+ int rc = SPIEraseSector (_currentAddress/FLASH_SECTOR_SIZE);
114
+ interrupts ();
115
+ if (rc){
116
+ _error = UPDATE_ERROR_ERASE;
117
+ #ifdef DEBUG_UPDATER
118
+ printError (DEBUG_UPDATER);
119
+ #endif
120
+ return false ;
121
+ }
122
+
123
+ WDT_FEED ();
124
+ noInterrupts ();
125
+ rc = SPIWrite (_currentAddress, _buffer, _bufferLen);
126
126
interrupts ();
127
127
if (rc) {
128
128
_error = UPDATE_ERROR_WRITE;
Original file line number Diff line number Diff line change
1
+ /*
2
+ To upload through terminal you can use: curl -F "[email protected] " esp8266-webupdate.local/update
3
+ */
4
+
1
5
#include < ESP8266WiFi.h>
2
6
#include < WiFiClient.h>
3
7
#include < ESP8266WebServer.h>
You can’t perform that action at this time.
0 commit comments