delete unused functions

Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
This commit is contained in:
2025-11-19 12:53:53 +09:00
parent 8bc08569fe
commit 535bd9388e
3 changed files with 0 additions and 56 deletions

View File

@@ -31,8 +31,6 @@ void app_main(void)
} }
ESP_ERROR_CHECK(ret); ESP_ERROR_CHECK(ret);
storage_init();
ESP_ERROR_CHECK(esp_netif_init()); ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default()); ESP_ERROR_CHECK(esp_event_loop_create_default());

View File

@@ -1,6 +1,5 @@
dependencies: dependencies:
espressif/led_indicator: ^1.1.1 espressif/led_indicator: ^1.1.1
joltwallet/littlefs: ==1.20.1
esp-idf-lib/ina3221: ^1.1.7 esp-idf-lib/ina3221: ^1.1.7
esp-idf-lib/pca9557: ^1.0.7 esp-idf-lib/pca9557: ^1.0.7
nikas-belogolov/nanopb: ^1.0.0 nikas-belogolov/nanopb: ^1.0.0

View File

@@ -1,53 +0,0 @@
#include "storage.h"
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "esp_littlefs.h"
#include "esp_log.h"
static const char* TAG = "datalog";
#define MAX_LOG_SIZE (700 * 1024)
void storage_init(void)
{
ESP_LOGI(TAG, "Initializing DataLog with LittleFS");
esp_vfs_littlefs_conf_t conf = {
.base_path = "/littlefs",
.partition_label = "littlefs",
.format_if_mount_failed = true,
.dont_mount = false,
};
esp_err_t ret = esp_vfs_littlefs_register(&conf);
if (ret != ESP_OK)
{
if (ret == ESP_FAIL)
{
ESP_LOGE(TAG, "Failed to mount or format filesystem");
}
else if (ret == ESP_ERR_NOT_FOUND)
{
ESP_LOGE(TAG, "Failed to find LittleFS partition");
}
else
{
ESP_LOGE(TAG, "Failed to initialize LittleFS (%s)", esp_err_to_name(ret));
}
return;
}
size_t total = 0, used = 0;
ret = esp_littlefs_info(conf.partition_label, &total, &used);
if (ret != ESP_OK)
{
ESP_LOGE(TAG, "Failed to get LittleFS partition information (%s)", esp_err_to_name(ret));
}
else
{
ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used);
}
}