TB2026-YDS Firmware
Loading...
Searching...
No Matches
storage.c File Reference
#include "storage.h"
#include "sdcard.h"
#include "esp_log.h"
#include "esp_heap_caps.h"
#include "esp_vfs_fat.h"
#include <dirent.h>
#include <string.h>
#include <strings.h>
#include <stdio.h>
#include <stdlib.h>

Functions

esp_err_t storage_scan_dir (const char *root)
 Scan an arbitrary directory for playable tracks, rebuilding the index.
esp_err_t storage_init (void)
 Mount the SD card and scan its root for playable tracks.
esp_err_t storage_rescan (void)
 Re-scan the (already mounted) card root, rebuilding the track index.
esp_err_t storage_unmount (void)
 Unmount the card and invalidate the index, after a card removal.
bool storage_ready (void)
 Whether the card is mounted and a scan has completed.
size_t storage_count (void)
 Number of tracks in the index (0 before any successful scan).
esp_err_t storage_get_usage (uint64_t *total_bytes, uint64_t *used_bytes)
 Total and used size of the mounted FAT volume, in bytes.
const char * storage_track_path (size_t index)
 Full POSIX path of a track, ready for decoder_open().
const char * storage_track_name (size_t index)
 Display name of a track (file name, no directory prefix).
esp_err_t storage_deinit (void)
 Unmount the card and free the index.

Detailed Description

Note
Développé avec l'assistance de Claude Opus 4.8 (Anthropic), sous la direction de Y. Dos Santos : spécification, revue et validation sur cible par l'auteur.