#pragma once #include namespace kvida::drivers { // Mounts the "storage" partition (see partitions.csv) as a LittleFS // filesystem at /storage. Safe to call multiple times (no-op if already // mounted). Formats the partition automatically if it's blank or corrupt. void storage_init(); // Reads a whole file into buf (cap includes room for the implicit '\0' // this appends). Returns false if the filesystem isn't mounted, the file // doesn't exist, or it doesn't fit in cap. bool storage_read_file(const char *path, char *buf, size_t cap, size_t *out_len); // Writes/overwrites a whole file. Returns false if the filesystem isn't // mounted or the write fails. bool storage_write_file(const char *path, const char *data, size_t len); } // namespace kvida::drivers