fix complete_task exit

This commit is contained in:
King Kévin 2022-10-24 18:27:47 +02:00
parent 2a34c37181
commit 77f60304f5
1 changed files with 3 additions and 6 deletions

View File

@ -186,7 +186,7 @@ static void complete_task(void* arg)
if (ESP_OK != rc) {
ESP_LOGE(TAG, "close OTA failed");
tud_dfu_finish_flashing(DFU_STATUS_ERR_PROG);
return;
vTaskDelete(NULL); // close task
}
}
@ -197,16 +197,13 @@ static void complete_task(void* arg)
if (ESP_APP_DESC_MAGIC_WORD == ota_desc.magic_word) {
ESP_LOGI(TAG, "set boot to valid app");
esp_ota_set_boot_partition(ota);
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_IDLE), 0);
tud_dfu_finish_flashing(DFU_STATUS_OK);
} else {
ESP_LOGI(TAG, "no valid app");
tud_dfu_finish_flashing(DFU_STATUS_ERR_VERIFY);
return;
}
// flashing op for manifest is complete without error
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_IDLE), 0);
tud_dfu_finish_flashing(DFU_STATUS_OK);
vTaskDelete(NULL); // close task
}