mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-07 16:23:38 +03:00
add more debug to Updater.cpp
This commit is contained in:
parent
0389657614
commit
49536c78d3
@ -38,14 +38,14 @@ void UpdaterClass::_reset() {
|
|||||||
bool UpdaterClass::begin(size_t size, int command) {
|
bool UpdaterClass::begin(size_t size, int command) {
|
||||||
if(_size > 0){
|
if(_size > 0){
|
||||||
#ifdef DEBUG_UPDATER
|
#ifdef DEBUG_UPDATER
|
||||||
DEBUG_UPDATER.println("already running");
|
DEBUG_UPDATER.println("[begin] already running");
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_UPDATER
|
#ifdef DEBUG_UPDATER
|
||||||
if (command == U_SPIFFS) {
|
if (command == U_SPIFFS) {
|
||||||
DEBUG_UPDATER.println("Update SPIFFS.");
|
DEBUG_UPDATER.println("[begin] Update SPIFFS.");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -73,6 +73,12 @@ bool UpdaterClass::begin(size_t size, int command) {
|
|||||||
//address where we will start writing the update
|
//address where we will start writing the update
|
||||||
updateStartAddress = updateEndAddress - roundedSize;
|
updateStartAddress = updateEndAddress - roundedSize;
|
||||||
|
|
||||||
|
#ifdef DEBUG_UPDATER
|
||||||
|
DEBUG_UPDATER.printf("[begin] roundedSize: 0x%08X (%d)\n", roundedSize, roundedSize);
|
||||||
|
DEBUG_UPDATER.printf("[begin] updateEndAddress: 0x%08X (%d)\n", updateEndAddress, updateEndAddress);
|
||||||
|
DEBUG_UPDATER.printf("[begin] currentSketchSize: 0x%08X (%d)\n", currentSketchSize, currentSketchSize);
|
||||||
|
#endif
|
||||||
|
|
||||||
//make sure that the size of both sketches is less than the total space (updateEndAddress)
|
//make sure that the size of both sketches is less than the total space (updateEndAddress)
|
||||||
if(updateStartAddress < currentSketchSize) {
|
if(updateStartAddress < currentSketchSize) {
|
||||||
_error = UPDATE_ERROR_SPACE;
|
_error = UPDATE_ERROR_SPACE;
|
||||||
@ -88,7 +94,7 @@ bool UpdaterClass::begin(size_t size, int command) {
|
|||||||
else {
|
else {
|
||||||
// unknown command
|
// unknown command
|
||||||
#ifdef DEBUG_UPDATER
|
#ifdef DEBUG_UPDATER
|
||||||
DEBUG_UPDATER.println("Unknown update command.");
|
DEBUG_UPDATER.println("[begin] Unknown update command.");
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -100,6 +106,12 @@ bool UpdaterClass::begin(size_t size, int command) {
|
|||||||
_buffer = new uint8_t[FLASH_SECTOR_SIZE];
|
_buffer = new uint8_t[FLASH_SECTOR_SIZE];
|
||||||
_command = command;
|
_command = command;
|
||||||
|
|
||||||
|
#ifdef DEBUG_UPDATER
|
||||||
|
DEBUG_UPDATER.printf("[begin] _startAddress: 0x%08X (%d)\n", _startAddress, _startAddress);
|
||||||
|
DEBUG_UPDATER.printf("[begin] _currentAddress: 0x%08X (%d)\n", _currentAddress, _currentAddress);
|
||||||
|
DEBUG_UPDATER.printf("[begin] _size: 0x%08X (%d)\n", _size, _size);
|
||||||
|
#endif
|
||||||
|
|
||||||
_md5.begin();
|
_md5.begin();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user