@@ -113,9 +113,9 @@ bool UpdaterClass::begin(size_t size, int command, int ledPin, uint8_t ledOn) {
113
113
updateStartAddress = (updateEndAddress > roundedSize)? (updateEndAddress - roundedSize) : 0 ;
114
114
115
115
#ifdef DEBUG_UPDATER
116
- DEBUG_UPDATER.printf ( " [begin] roundedSize: 0x%08zX (%zd)\n " , roundedSize, roundedSize);
117
- DEBUG_UPDATER.printf ( " [begin] updateEndAddress: 0x%08zX (%zd)\n " , updateEndAddress, updateEndAddress);
118
- DEBUG_UPDATER.printf ( " [begin] currentSketchSize: 0x%08zX (%zd)\n " , currentSketchSize, currentSketchSize);
116
+ DEBUG_UPDATER.printf_P ( PSTR ( " [begin] roundedSize: 0x%08zX (%zd)\n " ) , roundedSize, roundedSize);
117
+ DEBUG_UPDATER.printf_P ( PSTR ( " [begin] updateEndAddress: 0x%08zX (%zd)\n " ) , updateEndAddress, updateEndAddress);
118
+ DEBUG_UPDATER.printf_P ( PSTR ( " [begin] currentSketchSize: 0x%08zX (%zd)\n " ) , currentSketchSize, currentSketchSize);
119
119
#endif
120
120
121
121
// make sure that the size of both sketches is less than the total space (updateEndAddress)
@@ -148,9 +148,9 @@ bool UpdaterClass::begin(size_t size, int command, int ledPin, uint8_t ledOn) {
148
148
_command = command;
149
149
150
150
#ifdef DEBUG_UPDATER
151
- DEBUG_UPDATER.printf ( " [begin] _startAddress: 0x%08X (%d)\n " , _startAddress, _startAddress);
152
- DEBUG_UPDATER.printf ( " [begin] _currentAddress: 0x%08X (%d)\n " , _currentAddress, _currentAddress);
153
- DEBUG_UPDATER.printf ( " [begin] _size: 0x%08zX (%zd)\n " , _size, _size);
151
+ DEBUG_UPDATER.printf_P ( PSTR ( " [begin] _startAddress: 0x%08X (%d)\n " ) , _startAddress, _startAddress);
152
+ DEBUG_UPDATER.printf_P ( PSTR ( " [begin] _currentAddress: 0x%08X (%d)\n " ) , _currentAddress, _currentAddress);
153
+ DEBUG_UPDATER.printf_P ( PSTR ( " [begin] _size: 0x%08zX (%zd)\n " ) , _size, _size);
154
154
#endif
155
155
156
156
if (!_verify) {
@@ -178,7 +178,7 @@ bool UpdaterClass::end(bool evenIfRemaining){
178
178
179
179
if (hasError () || (!isFinished () && !evenIfRemaining)){
180
180
#ifdef DEBUG_UPDATER
181
- DEBUG_UPDATER.printf ( " premature end: res:%u, pos:%zu/%zu\n " , getError (), progress (), _size);
181
+ DEBUG_UPDATER.printf_P ( PSTR ( " premature end: res:%u, pos:%zu/%zu\n " ) , getError (), progress (), _size);
182
182
#endif
183
183
184
184
_reset ();
@@ -196,7 +196,7 @@ bool UpdaterClass::end(bool evenIfRemaining){
196
196
if (_verify) {
197
197
ESP.flashRead (_startAddress + _size - sizeof (uint32_t ), &sigLen, sizeof (uint32_t ));
198
198
#ifdef DEBUG_UPDATER
199
- DEBUG_UPDATER.printf ( " [Updater] sigLen: %d\n " , sigLen);
199
+ DEBUG_UPDATER.printf_P ( PSTR ( " [Updater] sigLen: %d\n " ) , sigLen);
200
200
#endif
201
201
if (sigLen != _verify->length ()) {
202
202
_setError (UPDATE_ERROR_SIGN);
@@ -207,7 +207,7 @@ bool UpdaterClass::end(bool evenIfRemaining){
207
207
int binSize = _size - sigLen - sizeof (uint32_t ) /* The siglen word */ ;
208
208
_hash->begin ();
209
209
#ifdef DEBUG_UPDATER
210
- DEBUG_UPDATER.printf ( " [Updater] Adjusted binsize: %d\n " , binSize);
210
+ DEBUG_UPDATER.printf_P ( PSTR ( " [Updater] Adjusted binsize: %d\n " ) , binSize);
211
211
#endif
212
212
// Calculate the MD5 and hash using proper size
213
213
uint8_t buff[128 ];
@@ -219,7 +219,7 @@ bool UpdaterClass::end(bool evenIfRemaining){
219
219
_hash->end ();
220
220
#ifdef DEBUG_UPDATER
221
221
unsigned char *ret = (unsigned char *)_hash->hash ();
222
- DEBUG_UPDATER.printf ( " [Updater] Computed Hash:" );
222
+ DEBUG_UPDATER.printf_P ( PSTR ( " [Updater] Computed Hash:" ) );
223
223
for (int i=0 ; i<_hash->len (); i++) DEBUG_UPDATER.printf (" %02x" , ret[i]);
224
224
DEBUG_UPDATER.printf (" \n " );
225
225
#endif
@@ -231,7 +231,7 @@ bool UpdaterClass::end(bool evenIfRemaining){
231
231
}
232
232
ESP.flashRead (_startAddress + binSize, (uint32_t *)sig, sigLen);
233
233
#ifdef DEBUG_UPDATER
234
- DEBUG_UPDATER.printf ( " [Updater] Received Signature:" );
234
+ DEBUG_UPDATER.printf_P ( PSTR ( " [Updater] Received Signature:" ) );
235
235
for (size_t i=0 ; i<sigLen; i++) {
236
236
DEBUG_UPDATER.printf (" %02x" , sig[i]);
237
237
}
@@ -243,7 +243,7 @@ bool UpdaterClass::end(bool evenIfRemaining){
243
243
return false ;
244
244
}
245
245
#ifdef DEBUG_UPDATER
246
- DEBUG_UPDATER.printf ( " [Updater] Signature matches\n " );
246
+ DEBUG_UPDATER.printf_P ( PSTR ( " [Updater] Signature matches\n " ) );
247
247
#endif
248
248
} else if (_target_md5.length ()) {
249
249
_md5.calculate ();
@@ -253,7 +253,7 @@ bool UpdaterClass::end(bool evenIfRemaining){
253
253
return false ;
254
254
}
255
255
#ifdef DEBUG_UPDATER
256
- else DEBUG_UPDATER.printf ( " MD5 Success: %s\n " , _target_md5.c_str ());
256
+ else DEBUG_UPDATER.printf_P ( PSTR ( " MD5 Success: %s\n " ) , _target_md5.c_str ());
257
257
#endif
258
258
}
259
259
@@ -271,10 +271,10 @@ bool UpdaterClass::end(bool evenIfRemaining){
271
271
eboot_command_write (&ebcmd);
272
272
273
273
#ifdef DEBUG_UPDATER
274
- DEBUG_UPDATER.printf ( " Staged: address:0x%08X, size:0x%08zX\n " , _startAddress, _size);
274
+ DEBUG_UPDATER.printf_P ( PSTR ( " Staged: address:0x%08X, size:0x%08zX\n " ) , _startAddress, _size);
275
275
}
276
276
else if (_command == U_SPIFFS) {
277
- DEBUG_UPDATER.printf ( " SPIFFS: address:0x%08X, size:0x%08zX\n " , _startAddress, _size);
277
+ DEBUG_UPDATER.printf_P ( PSTR ( " SPIFFS: address:0x%08X, size:0x%08zX\n " ) , _startAddress, _size);
278
278
#endif
279
279
}
280
280
@@ -301,12 +301,12 @@ bool UpdaterClass::_writeBuffer(){
301
301
if (_currentAddress == _startAddress + FLASH_MODE_PAGE) {
302
302
flashMode = ESP.getFlashChipMode ();
303
303
#ifdef DEBUG_UPDATER
304
- DEBUG_UPDATER.printf ( " Header: 0x%1X %1X %1X %1X\n " , _buffer[0 ], _buffer[1 ], _buffer[2 ], _buffer[3 ]);
304
+ DEBUG_UPDATER.printf_P ( PSTR ( " Header: 0x%1X %1X %1X %1X\n " ) , _buffer[0 ], _buffer[1 ], _buffer[2 ], _buffer[3 ]);
305
305
#endif
306
306
bufferFlashMode = ESP.magicFlashChipMode (_buffer[FLASH_MODE_OFFSET]);
307
307
if (bufferFlashMode != flashMode) {
308
308
#ifdef DEBUG_UPDATER
309
- DEBUG_UPDATER.printf ( " Set flash mode from 0x%1X to 0x%1X\n " , bufferFlashMode, flashMode);
309
+ DEBUG_UPDATER.printf_P ( PSTR ( " Set flash mode from 0x%1X to 0x%1X\n " ) , bufferFlashMode, flashMode);
310
310
#endif
311
311
312
312
_buffer[FLASH_MODE_OFFSET] = flashMode;
0 commit comments