diff --git a/ESP32-Console/main/main.c b/ESP32-Console/main/main.c index 11e66334b..f9544c96e 100755 --- a/ESP32-Console/main/main.c +++ b/ESP32-Console/main/main.c @@ -24,6 +24,23 @@ esp_console_config_t *console_config; esp_console_cmd_t *cmd1; esp_console_cmd_func_t *cmd1_func; +#define MOUNT_PATH "/data" +#define HISTORY_PATH MOUNT_PATH "/history.txt" + +static void initialize_filesystem(void) +{ + static wl_handle_t wl_handle; + const esp_vfs_fat_mount_config_t mount_config = { + .max_files = 4, + .format_if_mount_failed = true + }; + esp_err_t err = esp_vfs_fat_spiflash_mount_rw_wl(MOUNT_PATH, "storage", &mount_config, &wl_handle); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Failed to mount FATFS (%s)", esp_err_to_name(err)); + return; + } +} + static void initialize_nvs (void) { esp_err_t err = nvs_flash_init(); if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) { @@ -49,6 +66,7 @@ void app_main(void) repl_config.prompt = "foxie >"; repl_config.history_save_path = HISTORY_PATH; + //repl_config.max_cmdline_length = CONFIG_CONSOLE_MAX_COMMAND_LINE_LENGTH; ESP_ERROR_CHECK(esp_console_new_repl_uart(&uart_config, &repl_config, &repl)); /*