chore(format): initial formatting

This commit is contained in:
HendrikRauh 2026-03-05 23:05:35 +01:00
parent fa08fcfe65
commit 008c79852b
21 changed files with 1021 additions and 1082 deletions

View file

@ -4,23 +4,22 @@
#include "esp_err.h"
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
/**
* @brief Initialize and mount LittleFS filesystem
*
* @return ESP_OK on success, error code otherwise
*/
esp_err_t storage_init(void);
/**
* @brief Initialize and mount LittleFS filesystem
*
* @return ESP_OK on success, error code otherwise
*/
esp_err_t storage_init(void);
/**
* @brief Get the mount point for the LittleFS filesystem
*
* @return Pointer to the mount point string (e.g., "/data")
*/
const char *storage_get_mount_point(void);
/**
* @brief Get the mount point for the LittleFS filesystem
*
* @return Pointer to the mount point string (e.g., "/data")
*/
const char *storage_get_mount_point(void);
#ifdef __cplusplus
}

View file

@ -7,8 +7,7 @@
static const char *TAG = "STORAGE";
static const char *LITTLEFS_MOUNT_POINT = "/data";
esp_err_t storage_init(void)
{
esp_err_t storage_init(void) {
esp_vfs_littlefs_conf_t conf = {
.base_path = LITTLEFS_MOUNT_POINT,
.partition_label = "storage",
@ -18,18 +17,12 @@ esp_err_t storage_init(void)
esp_err_t ret = esp_vfs_littlefs_register(&conf);
if (ret != ESP_OK)
{
if (ret == ESP_FAIL)
{
if (ret != ESP_OK) {
if (ret == ESP_FAIL) {
ESP_LOGE(TAG, "Failed to mount LittleFS or format filesystem");
}
else if (ret == ESP_ERR_INVALID_STATE)
{
} else if (ret == ESP_ERR_INVALID_STATE) {
ESP_LOGE(TAG, "ESP_ERR_INVALID_STATE");
}
else
{
} else {
ESP_LOGE(TAG, "Failed to initialize LittleFS: %s", esp_err_to_name(ret));
}
return ret;
@ -37,20 +30,14 @@ esp_err_t storage_init(void)
size_t total = 0, used = 0;
ret = esp_littlefs_info(conf.partition_label, &total, &used);
if (ret == ESP_OK)
{
if (ret == ESP_OK) {
ESP_LOGI(TAG, "LittleFS mounted at %s. Total: %d bytes, Used: %d bytes",
LITTLEFS_MOUNT_POINT, total, used);
}
else
{
} else {
ESP_LOGE(TAG, "Failed to get LittleFS information");
}
return ESP_OK;
}
const char *storage_get_mount_point(void)
{
return LITTLEFS_MOUNT_POINT;
}
const char *storage_get_mount_point(void) { return LITTLEFS_MOUNT_POINT; }