отправка данных графиков в веб интерфейс

This commit is contained in:
Dmitry Borisenko
2022-08-31 00:13:45 +02:00
parent 1c5de5b92e
commit d947e9da71
10 changed files with 46 additions and 20 deletions

View File

@@ -197,7 +197,7 @@ void cleanDirectory(String path) {
while (dir.next()) {
String fname = dir.fileName();
removeFile(path + "/" + fname);
SerialPrint("I", "Files", path + "/" + fname + " => deleted");
SerialPrint("i", "Files", path + "/" + fname + " => deleted");
}
onFlashWrite();
#endif
@@ -205,12 +205,16 @@ void cleanDirectory(String path) {
path = "/" + path;
File root = FileFS.open(path);
path = String();
if (!root) {
SerialPrint("E", "Files", "nothing to delete");
return;
}
if (root.isDirectory()) {
File file = root.openNextFile();
while (file) {
String fname = file.name();
removeFile(fname);
SerialPrint("I", "Files", fname + " => deleted");
SerialPrint("i", "Files", fname + " => deleted");
file = root.openNextFile();
}
}
@@ -227,6 +231,11 @@ String readDataDB(String id) {
return readFile(path, 2000);
}
void cleanLogs() {
cleanDirectory("lg");
cleanDirectory("db");
}
//счетчик количества записей на флешь за сеанс
void onFlashWrite() {
flashWriteNumber++;