-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
84 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "FS.hpp" | ||
#include "Datatypes/Interface.hpp" | ||
|
||
HomieInternals::FS::FS() | ||
: _fsBegan(false) { | ||
} | ||
|
||
bool HomieInternals::FS::_fsBegin() { | ||
if (!_fsBegan) { | ||
#ifdef ESP32 | ||
#ifdef HOMIE_SPIFFS | ||
_fsBegan = SPIFFS.begin(true); | ||
#elif defined(HOMIE_LITTLEFS) | ||
_fsBegan = LittleFS.begin(); | ||
#endif | ||
#elif defined(ESP8266) | ||
#ifdef HOMIE_SPIFFS | ||
_fsBegan = SPIFFS.begin(); | ||
#elif defined(HOMIE_LITTLEFS) | ||
_fsBegan = LittleFS.begin(); | ||
#endif | ||
#endif | ||
if (!_fsBegan) Interface::get().getLogger() << F("✖ Cannot mount filesystem") << endl; | ||
} | ||
|
||
return _fsBegan; | ||
} | ||
|
||
void HomieInternals::FS::doSomething() { | ||
bool lala = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include "Constants.hpp" | ||
|
||
#ifdef ESP32 | ||
#ifdef HOMIE_SPIFFS | ||
#include <SPIFFS.h> | ||
#endif | ||
#ifdef HOMIE_LITTLEFS | ||
#include <LITTLEFS.h> | ||
#endif | ||
#elif defined(ESP8266) | ||
#ifdef HOMIE_SPIFFS | ||
#include "FS.h" | ||
#elif defined(HOMIE_LITTLEFS) | ||
#include "LittleFS.h" | ||
#endif | ||
#endif // ESP32 | ||
|
||
namespace HomieInternals { | ||
class FS { | ||
public: | ||
FS(); | ||
bool _fsBegin(); | ||
static void doSomething(); | ||
|
||
private: | ||
bool _fsBegan; | ||
}; | ||
} // namespace HomieInternals |