mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 18:08:35 -07:00
ESP Flasher dual boot
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user