platformio esp8266, esp32

This commit is contained in:
Yuri Trikoz
2020-06-21 03:43:15 +03:00
parent ac6f51af7b
commit bba7487374
39 changed files with 8579 additions and 166 deletions

View File

@@ -1,6 +1,29 @@
#include "Utils/FileUtils.h"
#include <LittleFS.h>
bool fileSystemInit() {
if (!LittleFS.begin()) {
Serial.println("[E] LittleFS");
return false;
}
return true;
}
void removeFile(const String filename) {
if (!LittleFS.remove(filename)) {
Serial.printf("[E] on remove %s", filename.c_str());
}
}
File seekFile(const String filename, size_t position) {
auto file = LittleFS.open(filename, "r");
if (!file) {
Serial.printf("[E] on open %s", filename.c_str());
}
// поставим курсор в начало файла
file.seek(position, SeekSet);
return file;
}
String readFileString(const String filename, const String to_find) {
String res = "Failed";