|
|
@@ -116,6 +116,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);
|
|
|
@@ -132,7 +133,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();
|
|
|
}
|
|
|
|