Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions SerialFlash.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,25 @@ class SerialFlashChip
static void eraseBlock(uint32_t addr);

static SerialFlashFile open(const char *filename);
static SerialFlashFile open(const String& filename);
static bool create(const char *filename, uint32_t length, uint32_t align = 0);
static bool create(const String& filename, uint32_t length, uint32_t align = 0) {
return create(filename.c_str(), length, align);
}
static bool createErasable(const char *filename, uint32_t length) {
return create(filename, length, blockSize());
}
static bool createErasable(const String& filename, uint32_t length) {
return createErasable(filename.c_str(), length);
}
static bool exists(const char *filename);
static bool exists(const String& filename) {
return exists(filename.c_str());
}
static bool remove(const char *filename);
static bool remove(const String& filename) {
return remove(filename.c_str());
}
static bool remove(SerialFlashFile &file);
static void opendir() { dirindex = 0; }
static bool readdir(char *filename, uint32_t strsize, uint32_t &filesize);
Expand Down
4 changes: 4 additions & 0 deletions SerialFlashDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ SerialFlashFile SerialFlashChip::open(const char *filename)
return file;
}

SerialFlashFile SerialFlashChip::open(const String& filename) {
return open(filename.c_str());
}

bool SerialFlashChip::exists(const char *filename)
{
SerialFlashFile file = open(filename);
Expand Down