6#include "AudioTools/Disk/VFS.h"
8#include "esp_littlefs.h"
29 LOGI(
"Initializing LittleFS");
31 esp_vfs_littlefs_conf_t conf = {
32 .base_path = mount_point,
33 .partition_label =
"storage",
34 .format_if_mount_failed = format_if_mount_failed,
40 esp_err_t ret = esp_vfs_littlefs_register(&conf);
43 if (ret == ESP_FAIL) {
44 LOGE(
"Failed to mount or format filesystem");
45 }
else if (ret == ESP_ERR_NOT_FOUND) {
46 LOGE(
"Failed to find LittleFS partition");
48 LOGE(
"Failed to initialize LittleFS (%s)", esp_err_to_name(ret));
53 size_t total = 0, used = 0;
54 ret = esp_littlefs_info(conf.partition_label, &total, &used);
56 LOGE(
"Failed to get LittleFS partition information (%s)",
57 esp_err_to_name(ret));
61 LOGI(
"Partition size: total: %d, used: %d", total, used);
70 esp_vfs_littlefs_unregister(conf.partition_label);
71 LOGI(
"LittleFS unmounted");
75 esp_vfs_littlefs_conf_t conf;
77 bool format_if_mount_failed =
true;