Add partition label argument to SPIFFS (#4443)

* Add partition label argument to SPIFFSSPIFFS currently assumes there is only ever one partition.This change allows a user to pass the label argument (defaults to NULL)to SPIFFS::begin() so a specific SPIFFS partition can be referenced.This change does not break compatibility.
This commit is contained in:
thewavelength
2020-11-02 17:47:36 +01:00
committed by GitHub
parent 360e04fa36
commit 3cbfa2ffef
2 changed files with 31 additions and 10 deletions

View File

@ -23,11 +23,15 @@ class SPIFFSFS : public FS
{
public:
SPIFFSFS();
bool begin(bool formatOnFail=false, const char * basePath="/spiffs", uint8_t maxOpenFiles=10);
~SPIFFSFS();
bool begin(bool formatOnFail=false, const char * basePath="/spiffs", uint8_t maxOpenFiles=10, const char * partitionLabel=NULL);
bool format();
size_t totalBytes();
size_t usedBytes();
void end();
private:
char * partitionLabel_;
};
}