mirror of
https://github.com/meshtastic/firmware.git
synced 2026-08-01 10:58:30 -04:00
* chore: remove empty handleWebResponse() stub in PiWebServer * chore: remove unused PowerStatus::knowsUSB() * chore: remove orphaned fsListFiles() declaration * chore: remove stale #if 0 SPI-comms test in SX126xInterface * chore: remove stale #if 0 cert-delete debug block in WebServer
72 lines
1.8 KiB
C++
72 lines
1.8 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_STM32)
|
|
// STM32
|
|
#include "LittleFS.h"
|
|
#define FSCom InternalFS
|
|
#define FSBegin() FSCom.begin()
|
|
using namespace STM32_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
|
|
|
|
#if defined(ARCH_NRF54L15)
|
|
// nRF54L15 - Zephyr LittleFS on 36 KB storage_partition (internal RRAM)
|
|
#include "InternalFileSystem.h"
|
|
#define FSCom InternalFS
|
|
#define FSBegin() FSCom.begin()
|
|
using namespace Adafruit_LittleFS_Namespace;
|
|
#endif
|
|
|
|
void fsInit();
|
|
bool copyFile(const char *from, const char *to);
|
|
bool renameFile(const char *pathFrom, const char *pathTo);
|
|
bool fsFormat();
|
|
std::vector<meshtastic_FileInfo> getFiles(const char *dirname, uint8_t levels, size_t maxCount = 64, bool *wasLimited = nullptr);
|
|
void listDir(const char *dirname, uint8_t levels, bool del = false);
|
|
void rmDir(const char *dirname);
|
|
void setupSDCard();
|
|
|
|
#if defined(HAS_SDCARD) && !defined(SDCARD_USE_SOFT_SPI) && defined(SDCARD_USE_SPI1)
|
|
#include <SPI.h>
|
|
// HSPI bus set up by setupSDCard(). Reuse this for other devices on the same bus.
|
|
extern SPIClass SPI_HSPI;
|
|
#endif |