Skip to content

Commit a3bc0e9

Browse files
committed
revert some space auto formatting
1 parent 79bec47 commit a3bc0e9

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

cores/esp8266/Updater.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ extern "C" {
1212

1313
extern "C" uint32_t _SPIFFS_start;
1414

15-
UpdaterClass::UpdaterClass()
15+
UpdaterClass::UpdaterClass()
1616
: _error(0)
1717
, _buffer(0)
1818
, _bufferLen(0)
1919
, _size(0)
2020
, _startAddress(0)
21-
, _currentAddress(0)
21+
, _currentAddress(0)
2222
{
2323
}
2424

@@ -39,18 +39,18 @@ bool UpdaterClass::begin(size_t size){
3939
#endif
4040
return false;
4141
}
42-
42+
4343
if(size == 0){
4444
_error = UPDATE_ERROR_SIZE;
4545
#ifdef DEBUG_UPDATER
4646
printError(DEBUG_UPDATER);
4747
#endif
4848
return false;
4949
}
50-
50+
5151
_reset();
5252
_error = 0;
53-
53+
5454
//size of current sketch rounded to a sector
5555
uint32_t currentSketchSize = (ESP.getSketchSize() + FLASH_SECTOR_SIZE - 1) & (~(FLASH_SECTOR_SIZE - 1));
5656
//address of the end of the space available for sketch and update
@@ -59,7 +59,7 @@ bool UpdaterClass::begin(size_t size){
5959
uint32_t roundedSize = (size + FLASH_SECTOR_SIZE - 1) & (~(FLASH_SECTOR_SIZE - 1));
6060
//address where we will start writing the update
6161
uint32_t updateStartAddress = updateEndAddress - roundedSize;
62-
62+
6363
//make sure that the size of both sketches is less than the total space (updateEndAddress)
6464
if(updateStartAddress < currentSketchSize){
6565
_error = UPDATE_ERROR_SPACE;
@@ -68,13 +68,13 @@ bool UpdaterClass::begin(size_t size){
6868
#endif
6969
return false;
7070
}
71-
71+
7272
//initialize
7373
_startAddress = updateStartAddress;
7474
_currentAddress = _startAddress;
7575
_size = size;
7676
_buffer = new uint8_t[FLASH_SECTOR_SIZE];
77-
77+
7878
return true;
7979
}
8080

@@ -85,30 +85,30 @@ bool UpdaterClass::end(bool evenIfRemaining){
8585
#endif
8686
return false;
8787
}
88-
88+
8989
if(hasError() || (!isFinished() && !evenIfRemaining)){
9090
#ifdef DEBUG_UPDATER
9191
DEBUG_UPDATER.printf("premature end: res:%u, pos:%u/%u\n", getError(), progress(), _size);
9292
#endif
93-
93+
9494
_reset();
9595
return false;
9696
}
97-
97+
9898
if(evenIfRemaining){
9999
if(_bufferLen > 0){
100100
_writeBuffer();
101101
}
102102
_size = progress();
103103
}
104-
104+
105105
eboot_command ebcmd;
106106
ebcmd.action = ACTION_COPY_RAW;
107107
ebcmd.args[0] = _startAddress;
108108
ebcmd.args[1] = 0x00000;
109109
ebcmd.args[2] = _size;
110110
eboot_command_write(&ebcmd);
111-
111+
112112
#ifdef DEBUG_UPDATER
113113
DEBUG_UPDATER.printf("Staged: address:0x%08X, size:0x%08X\n", _startAddress, _size);
114114
#endif
@@ -126,23 +126,23 @@ bool UpdaterClass::_writeBuffer(){
126126
_error = UPDATE_ERROR_WRITE;
127127
_currentAddress = (_startAddress + _size);
128128
#ifdef DEBUG_UPDATER
129-
printError(DEBUG_UPDATER);
129+
printError(DEBUG_UPDATER);
130130
#endif
131-
return false;
132-
}
133-
_currentAddress += _bufferLen;
134-
_bufferLen = 0;
135-
return true;
131+
return false;
132+
}
133+
_currentAddress += _bufferLen;
134+
_bufferLen = 0;
135+
return true;
136136
}
137137

138138
size_t UpdaterClass::write(uint8_t *data, size_t len) {
139139
size_t left = len;
140140
if(hasError() || !isRunning())
141141
return 0;
142-
142+
143143
if(len > remaining())
144144
len = remaining();
145-
145+
146146
while((_bufferLen + left) > FLASH_SECTOR_SIZE) {
147147
size_t toBuff = FLASH_SECTOR_SIZE - _bufferLen;
148148
memcpy(_buffer + _bufferLen, data + (len - left), toBuff);
@@ -170,7 +170,7 @@ size_t UpdaterClass::writeStream(Stream &data) {
170170
size_t toRead = 0;
171171
if(hasError() || !isRunning())
172172
return 0;
173-
173+
174174
while(remaining()) {
175175
toRead = FLASH_SECTOR_SIZE - _bufferLen;
176176
toRead = data.readBytes(_buffer + _bufferLen, toRead);

cores/esp8266/Updater.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define UPDATE_ERROR_SIZE 4
1212
#define UPDATE_ERROR_STREAM 5
1313

14-
#define DEBUG_UPDATER Serial1
14+
//#define DEBUG_UPDATER Serial1
1515

1616
class UpdaterClass {
1717
public:

0 commit comments

Comments
 (0)