1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Parsed with restyle.sh. Compile with all errors.

This commit is contained in:
sticilface 2020-11-07 19:24:31 +00:00
parent d382a33c7d
commit ee1481aa7c
4 changed files with 67 additions and 78 deletions

View File

@ -138,7 +138,7 @@ bool FSTools::moveFS(fs::FS & destinationFS)
if (f) { if (f) {
sourceFileCount++; sourceFileCount++;
sourceByteTotal += f.size(); sourceByteTotal += f.size();
_dumpFileInfo(f); //_dumpFileInfo(f);
} }
}); });
@ -207,12 +207,12 @@ uint32_t FSTools::_getSize(const FST::layout & layout)
} }
void FSTools::_dumpFileInfo(File & f) // void FSTools::_dumpFileInfo(File & f)
{ // {
if (f) { // if (f) {
// Serial.printf_P(PSTR(" File: %-30s [%8uB]\n"), f.fullName(), f.size() ); // Serial.printf_P(PSTR(" File: %-30s [%8uB]\n"), f.fullName(), f.size() );
} // }
} // }
bool FSTools::_copyFS(FS & sourceFS, FS & destFS) bool FSTools::_copyFS(FS & sourceFS, FS & destFS)
{ {

View File

@ -55,7 +55,6 @@ extern const layout layout_8m7m;
extern const layout layout_16m14m; extern const layout layout_16m14m;
extern const layout layout_16m15m; extern const layout layout_16m15m;
typedef std::function<void(File & f)> FileCb; typedef std::function<void(File & f)> FileCb;
@ -63,15 +62,9 @@ typedef std::function<void(File & f)> FileCb;
//376884
//376452
class FSTools { class FSTools {
public: public:
FSTools(); FSTools();
~FSTools(); ~FSTools();
bool attemptToMountFS(fs::FS & fs); bool attemptToMountFS(fs::FS & fs);
@ -84,7 +77,7 @@ public:
private: private:
uint32_t _getStartAddr(const FST::layout & layout); uint32_t _getStartAddr(const FST::layout & layout);
uint32_t _getSize(const FST::layout & layout); uint32_t _getSize(const FST::layout & layout);
void _dumpFileInfo(File & f); // void _dumpFileInfo(File & f);
bool _copyFS(FS & sourceFS, FS & destFS); bool _copyFS(FS & sourceFS, FS & destFS);
std::unique_ptr<fs::FS> _pFS; std::unique_ptr<fs::FS> _pFS;

View File

@ -39,8 +39,7 @@ const char* ssid = STASSID;
const char* password = STAPSK; const char* password = STAPSK;
bool migrateFS() bool migrateFS() {
{
if (!fstools.attemptToMountFS(LittleFS)) { // Attempts to mount LittleFS without autoformat... if (!fstools.attemptToMountFS(LittleFS)) { // Attempts to mount LittleFS without autoformat...
Serial.println(F("Default FS not found")); Serial.println(F("Default FS not found"));
if (fstools.mountAlternativeFS(FST::SPIFFS /* FST::LITTLEFS */, TARGET_FS_LAYOUT, true)) { if (fstools.mountAlternativeFS(FST::SPIFFS /* FST::LITTLEFS */, TARGET_FS_LAYOUT, true)) {
@ -58,8 +57,7 @@ bool migrateFS()
} }
void initWiFiOTA() void initWiFiOTA() {
{
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password); WiFi.begin(ssid, password);
while (WiFi.waitForConnectResult() != WL_CONNECTED) { while (WiFi.waitForConnectResult() != WL_CONNECTED) {

View File

@ -46,8 +46,7 @@ const char* ssid = STASSID;
const char* password = STAPSK; const char* password = STAPSK;
bool migrateFS() bool migrateFS() {
{
if (!fstools.attemptToMountFS(LittleFS_Different)) { // Attempts to mount LittleFS without autoformat... if (!fstools.attemptToMountFS(LittleFS_Different)) { // Attempts to mount LittleFS without autoformat...
Serial.println(F("Default FS not found")); Serial.println(F("Default FS not found"));
if (fstools.mountAlternativeFS(FST::SPIFFS /* FST::LITTLEFS */, TARGET_FS_LAYOUT, true)) { if (fstools.mountAlternativeFS(FST::SPIFFS /* FST::LITTLEFS */, TARGET_FS_LAYOUT, true)) {
@ -65,8 +64,7 @@ bool migrateFS()
} }
void initWiFiOTA() void initWiFiOTA() {
{
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password); WiFi.begin(ssid, password);
while (WiFi.waitForConnectResult() != WL_CONNECTED) { while (WiFi.waitForConnectResult() != WL_CONNECTED) {