Add option to skip image verification after OTA (#6779)

Fixes: https://github.com/espressif/arduino-esp32/issues/5871
This commit is contained in:
Me No Dev
2022-05-19 15:52:13 +03:00
committed by GitHub
parent 2b67a4e68a
commit 1a7962ece8

View File

@ -200,9 +200,14 @@ void initVariant() {}
void init() __attribute__((weak));
void init() {}
#ifdef CONFIG_APP_ROLLBACK_ENABLE
bool verifyOta() __attribute__((weak));
bool verifyOta() { return true; }
bool verifyRollbackLater() __attribute__((weak));
bool verifyRollbackLater() { return false; }
#endif
#ifdef CONFIG_BT_ENABLED
//overwritten in esp32-hal-bt.c
bool btInUse() __attribute__((weak));
@ -212,6 +217,7 @@ bool btInUse(){ return false; }
void initArduino()
{
#ifdef CONFIG_APP_ROLLBACK_ENABLE
if(!verifyRollbackLater()){
const esp_partition_t *running = esp_ota_get_running_partition();
esp_ota_img_states_t ota_state;
if (esp_ota_get_state_partition(running, &ota_state) == ESP_OK) {
@ -224,6 +230,7 @@ void initArduino()
}
}
}
}
#endif
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;