8#include "esp_littlefs.h"
32 LOGI(
"Initializing LittleFS");
34 esp_vfs_littlefs_conf_t
conf = {
36 .partition_label =
"storage",
43 esp_err_t ret = esp_vfs_littlefs_register(&
conf);
46 if (ret == ESP_FAIL) {
47 LOGE(
"Failed to mount or format filesystem");
48 }
else if (ret == ESP_ERR_NOT_FOUND) {
49 LOGE(
"Failed to find LittleFS partition");
51 LOGE(
"Failed to initialize LittleFS (%s)", esp_err_to_name(ret));
56 size_t total = 0, used = 0;
57 ret = esp_littlefs_info(
conf.partition_label, &total, &used);
59 LOGE(
"Failed to get LittleFS partition information (%s)",
60 esp_err_to_name(ret));
64 LOGI(
"Partition size: total: %d, used: %d", total, used);
73 esp_vfs_littlefs_unregister(
conf.partition_label);
74 LOGI(
"LittleFS unmounted");
78 esp_vfs_littlefs_conf_t
conf;
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define LOGE(...)
Definition AudioLoggerIDF.h:30