ESP Flasher dual boot

This commit is contained in:
Willy-JL
2023-08-31 22:47:40 +02:00
parent d76a324a59
commit 202d988dd5
29 changed files with 197 additions and 95 deletions

View File

@@ -117,6 +117,7 @@ int32_t esp_flasher_app(void* p) {
UNUSED(p);
uint8_t attempts = 0;
bool otg_was_enabled = furi_hal_power_is_otg_enabled();
while(!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
furi_hal_power_enable_otg();
furi_delay_ms(10);
@@ -133,7 +134,7 @@ int32_t esp_flasher_app(void* p) {
esp_flasher_app_free(esp_flasher_app);
if(furi_hal_power_is_otg_enabled()) {
if(furi_hal_power_is_otg_enabled() && !otg_was_enabled) {
furi_hal_power_disable_otg();
}