uniq message for ESP OTA state
This commit is contained in:
@@ -151,23 +151,23 @@ void finsihedCycleSucessfully()
|
||||
esp_ota_img_states_t ota_state;
|
||||
if (esp_ota_get_state_partition(running, &ota_state) == ESP_OK)
|
||||
{
|
||||
log(LOG_LEVEL_INFO, "Get State Partition was Successfull", LOG_BOOT_ERROR_DETECTION);
|
||||
log(LOG_LEVEL_DEBUG, "Get State Partition was Successfull", LOG_BOOT_ERROR_DETECTION);
|
||||
|
||||
if(ota_state == ESP_OTA_IMG_UNDEFINED){
|
||||
log(LOG_LEVEL_INFO, "ESP_OTA_IMG_UNDEFINED should not happen with rollback", LOG_BOOT_ERROR_DETECTION);
|
||||
log(LOG_LEVEL_DEBUG, "ESP_OTA_IMG_UNDEFINED should not happen with rollback", LOG_BOOT_ERROR_IMG_UNDEFINED);
|
||||
}
|
||||
if(ota_state == ESP_OTA_IMG_NEW){
|
||||
log(LOG_LEVEL_INFO, "ESP_OTA_IMG_NEW", LOG_BOOT_ERROR_DETECTION);
|
||||
log(LOG_LEVEL_DEBUG, "ESP_OTA_IMG_NEW", LOG_BOOT_ERROR_IMG_NEW);
|
||||
}
|
||||
if(ota_state == ESP_OTA_IMG_INVALID){
|
||||
log(LOG_LEVEL_INFO, "ESP_OTA_IMG_INVALID", LOG_BOOT_ERROR_DETECTION);
|
||||
log(LOG_LEVEL_DEBUG, "ESP_OTA_IMG_INVALID", LOG_BOOT_ERROR_IMG_INVALID);
|
||||
}
|
||||
if(ota_state == ESP_OTA_IMG_VALID){
|
||||
log(LOG_LEVEL_INFO, "ESP_OTA_IMG_VALID", LOG_BOOT_ERROR_DETECTION);
|
||||
log(LOG_LEVEL_DEBUG, "ESP_OTA_IMG_VALID", LOG_BOOT_ERROR_IMG_VALID);
|
||||
}
|
||||
if (ota_state == ESP_OTA_IMG_PENDING_VERIFY)
|
||||
{
|
||||
log(LOG_LEVEL_INFO, "ESP_OTA_IMG_PENDING_VERIFY Diagnostics completed successfully! Marking as valid", LOG_BOOT_ERROR_DETECTION);
|
||||
log(LOG_LEVEL_DEBUG, "ESP_OTA_IMG_PENDING_VERIFY Diagnostics completed successfully! Marking as valid", LOG_BOOT_ERROR_IMG_PENDING_VERIFY);
|
||||
esp_ota_mark_app_valid_cancel_rollback();
|
||||
}
|
||||
}
|
||||
@@ -175,11 +175,11 @@ void finsihedCycleSucessfully()
|
||||
|
||||
void espDeepSleep(bool afterPump = false)
|
||||
{
|
||||
/* download mode or normal operation should restore device status*/
|
||||
finsihedCycleSucessfully();
|
||||
if (mDownloadMode)
|
||||
{
|
||||
log(LOG_LEVEL_DEBUG, "abort deepsleep, DownloadMode active", LOG_DEBUG_CODE);
|
||||
// if we manage to get to the download mode, the device can be restored
|
||||
finsihedCycleSucessfully();
|
||||
return;
|
||||
}
|
||||
if (aliveWasRead())
|
||||
@@ -239,7 +239,6 @@ void espDeepSleep(bool afterPump = false)
|
||||
}
|
||||
}
|
||||
|
||||
finsihedCycleSucessfully();
|
||||
/* sleep always at least one second */
|
||||
if (secondsToSleep < 0) {
|
||||
secondsToSleep = 1;
|
||||
|
||||
Reference in New Issue
Block a user