-
Notifications
You must be signed in to change notification settings - Fork 0
DS_CAP_SYS_FS
Denis Stepanov edited this page May 21, 2021
·
9 revisions
This capability adds support for a file system. For this to work, you need to enable file system in Arduino settings (Tools
-> Flash Size
). The following fields are implemented:
Field | Description | Default Value |
---|---|---|
fs::FS& System::fs |
File System | LittleFS |
The library provides just a wrapper around the ESP8266 Arduino Core file system object, fs::FS
. The file system used by default is LittleFS. It is possible to change to SPIFFS by defining DS_FS_TYPE
macro to SPIFFS
in MySystem.h
. LittleFS was observed to make controller more responsive in general, and is a recommended choice. The file system API is the native one of LittleFS or SPIFFS (they are compatible).
- ESP8266 Arduino Core — file system implementation
-
DS_CAP_WEBSERVER — if web server is enabled, a favicon file
/favicon.png
will be automatically probed and served if present. Also, the "System Information" page will report file system type, size and usage percentage.
None.
MySystem.h
:
#define DS_CAP_SYS_FS // Enable file system
#define DS_FS_TYPE LittleFS // Optional; set to "SPIFFS" if needed
#include "System.h" // System global definitions
sketch.ino
:
#include "MySystem.h"
using namespace ds;
void setup() {
System::begin();
File my_file = System::fs.open("/hello.txt", "w");
if(!my_file)
return;
my_file.println("Hello, world!");
my_file.close();
}
void loop() {
}
System::begin() |
Required |
System::update() |
Not required |
None.
Version 1.0 or later. File system selection via DS_FS_TYPE
macro is available from version 1.1.
None.
- DS_CAP_APP_ID
- DS_CAP_APP_LOG
- DS_CAP_BUTTON
- DS_CAP_MDNS
- DS_CAP_SYS_FS
- DS_CAP_SYS_LED
- DS_CAP_SYS_LOG
- DS_CAP_SYS_LOG_HW
- DS_CAP_SYS_NETWORK
- DS_CAP_SYS_RESET
- DS_CAP_SYS_RTCMEM
- DS_CAP_SYS_TIME
- DS_CAP_SYS_UPTIME
- DS_CAP_TIMERS
- DS_CAP_TIMERS_ABS
- DS_CAP_TIMERS_COUNT_ABS
- DS_CAP_TIMERS_COUNT_TICK
- DS_CAP_TIMERS_SOLAR
- DS_CAP_WEB_TIMERS
- DS_CAP_WEBSERVER
- DS_CAP_WIFIMANAGER