Skip to content

Commit

Permalink
refactor: check sd card format
Browse files Browse the repository at this point in the history
  • Loading branch information
Otrebor671 committed Aug 27, 2024
1 parent 4d2ee2f commit dd7ec95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion firmware/main/modules/menus_module/menus.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "file_manager_module.h"
#include "open_thread_module.h"
#include "ota_module.h"
#include "sd_card_settings_module.h"
#include "settings_module.h"
#include "stealth_mode.h"
#include "web_file_browser_module.h"
Expand Down Expand Up @@ -465,7 +466,7 @@ menu_t menus[] = { //////////////////////////////////
.menu_idx = MENU_SETTINGS_SD_CARD_FORMAT_2,
.parent_idx = MENU_SETTINGS_SD_CARD_2,
.last_selected_submenu = 0,
.on_enter_cb = NULL,
.on_enter_cb = sd_card_settings_verify_sd_card,
.on_exit_cb = NULL,
.is_visible = true},
#ifdef CONFIG_FILE_MANAGER_ENABLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const char* sd_card_state_to_name[] = {
sd_card_settings_state_t state = SD_CARD_SETTINGS_VERIFYING;

void sd_card_settings_verify_sd_card() {
menus_module_set_app_state(true, sd_card_settings_keyboard_cb);
ESP_LOGI(TAG, "Verifying SD card...");
state = SD_CARD_SETTINGS_VERIFYING;

Expand Down Expand Up @@ -70,12 +71,10 @@ void sd_card_settings_keyboard_cb(uint8_t button_name, uint8_t button_event) {
}
break;
case SD_CARD_SETTINGS_OK:
menus_module_set_app_state(false, NULL);
menu_screens_enter_submenu();
menus_module_exit_app();
break;
default:
menus_module_set_app_state(false, NULL);
menu_screens_exit_submenu();
menus_module_exit_app();
break;
}
break;
Expand Down

0 comments on commit dd7ec95

Please sign in to comment.