mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 10:19:59 +00:00
a966d84e3d
* Send file system manifest up on want_config * Platform specific methods * Helps to actually make the change * Clear
56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "configuration.h"
|
|
#include <vector>
|
|
|
|
// Cross platform filesystem API
|
|
|
|
#if defined(ARCH_PORTDUINO)
|
|
// Portduino version
|
|
#include "PortduinoFS.h"
|
|
#define FSCom PortduinoFS
|
|
#define FSBegin() true
|
|
#define FILE_O_WRITE "w"
|
|
#define FILE_O_READ "r"
|
|
#endif
|
|
|
|
#if defined(ARCH_STM32WL)
|
|
#include "platform/stm32wl/InternalFileSystem.h" // STM32WL version
|
|
#define FSCom InternalFS
|
|
#define FSBegin() FSCom.begin()
|
|
using namespace LittleFS_Namespace;
|
|
#endif
|
|
|
|
#if defined(ARCH_RP2040)
|
|
// RP2040
|
|
#include "LittleFS.h"
|
|
#define FSCom LittleFS
|
|
#define FSBegin() FSCom.begin() // set autoformat
|
|
#define FILE_O_WRITE "w"
|
|
#define FILE_O_READ "r"
|
|
#endif
|
|
|
|
#if defined(ARCH_ESP32)
|
|
// ESP32 version
|
|
#include "LittleFS.h"
|
|
#define FSCom LittleFS
|
|
#define FSBegin() FSCom.begin(true) // format on failure
|
|
#define FILE_O_WRITE "w"
|
|
#define FILE_O_READ "r"
|
|
#endif
|
|
|
|
#if defined(ARCH_NRF52)
|
|
// NRF52 version
|
|
#include "InternalFileSystem.h"
|
|
#define FSCom InternalFS
|
|
#define FSBegin() FSCom.begin() // InternalFS formats on failure
|
|
using namespace Adafruit_LittleFS_Namespace;
|
|
#endif
|
|
|
|
void fsInit();
|
|
bool copyFile(const char *from, const char *to);
|
|
bool renameFile(const char *pathFrom, const char *pathTo);
|
|
std::vector<meshtastic_FileInfo> getFiles(const char *dirname, uint8_t levels);
|
|
void listDir(const char *dirname, uint8_t levels, bool del);
|
|
void rmDir(const char *dirname);
|
|
void setupSDCard(); |