diff --git a/esp_flasher_app.c b/esp_flasher_app.c index c197a01..cf299c4 100644 --- a/esp_flasher_app.c +++ b/esp_flasher_app.c @@ -27,6 +27,7 @@ EspFlasherApp* esp_flasher_app_alloc() { app->gui = furi_record_open(RECORD_GUI); app->dialogs = furi_record_open(RECORD_DIALOGS); app->storage = furi_record_open(RECORD_STORAGE); + app->notification = furi_record_open(RECORD_NOTIFICATION); app->view_dispatcher = view_dispatcher_alloc(); app->scene_manager = scene_manager_alloc(&esp_flasher_scene_handlers, app); @@ -106,6 +107,7 @@ void esp_flasher_app_free(EspFlasherApp* app) { furi_record_close(RECORD_GUI); furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_DIALOGS); + furi_record_close(RECORD_NOTIFICATION); free(app); } diff --git a/esp_flasher_app_i.h b/esp_flasher_app_i.h index 43161d8..5b31334 100644 --- a/esp_flasher_app_i.h +++ b/esp_flasher_app_i.h @@ -20,6 +20,7 @@ #include #include #include +#include #define ESP_FLASHER_TEXT_BOX_STORE_SIZE (4096) @@ -47,6 +48,7 @@ struct EspFlasherApp { TextBox* text_box; Storage* storage; DialogsApp* dialogs; + NotificationApp* notification; VariableItemList* var_item_list; Widget* widget; diff --git a/esp_flasher_worker.c b/esp_flasher_worker.c index a1d7aa0..86f9394 100644 --- a/esp_flasher_worker.c +++ b/esp_flasher_worker.c @@ -131,6 +131,9 @@ static int32_t esp_flasher_flash_bin(void* context) { flash_rx_stream = furi_stream_buffer_alloc(RX_BUF_SIZE, 1); timer = furi_timer_alloc(_timer_callback, FuriTimerTypePeriodic, app); + // turn on flipper blue LED for duration of flash + notification_message(app->notification, &sequence_set_only_blue_255); + loader_port_debug_print("Connecting\n"); esp_loader_connect_args_t connect_config = ESP_LOADER_CONNECT_DEFAULT(); err = esp_loader_connect(&connect_config); @@ -169,10 +172,20 @@ static int32_t esp_flasher_flash_bin(void* context) { loader_port_debug_print("Restoring transmission rate\n"); furi_hal_uart_set_br(FuriHalUartIdUSART1, 115200); #endif - loader_port_debug_print("Done flashing. Please reset the board manually.\n"); + loader_port_debug_print("Done flashing. Please reset the board manually if it doesn't auto-reset.\n"); + + // auto-reset for supported boards loader_port_reset_target(); + + // short buzz to alert user + notification_message(app->notification, &sequence_set_vibro_on); + loader_port_delay_ms(50); + notification_message(app->notification, &sequence_reset_vibro); } + // turn off flipper blue LED + notification_message(app->notification, &sequence_reset_blue); + // done app->flash_worker_busy = false;