esp32 рабочая версия с little fs файловой системой

This commit is contained in:
Dmitry Borisenko
2022-09-16 01:52:04 +02:00
parent aae21f4a78
commit d4539169ea
11 changed files with 138 additions and 104 deletions

View File

@@ -1,7 +1,7 @@
#pragma once
//Версия прошивки
#define FIRMWARE_VERSION 421
#define FIRMWARE_VERSION 422
#ifdef esp8266_4mb
#define FIRMWARE_NAME "esp8266_4mb"

View File

@@ -5,6 +5,7 @@
#include <LITTLEFS.h>
#define FileFS LittleFS
#define FS_NAME "LittleFS_32"
#define CONFIG_LITTLEFS_SPIFFS_COMPAT 1
#else
#include <SPIFFS.h>
extern FS* filesystem;
@@ -21,6 +22,9 @@ using littlefs_impl::LittleFSConfig;
extern FS* filesystem;
#define FileFS LittleFS
#define FS_NAME "LittleFS_8266"
#define FILE_READ "r"
#define FILE_WRITE "w"
#define FILE_APPEND "a"
#else
extern FS* filesystem;
#define FileFS SPIFFS

View File

@@ -13,5 +13,6 @@ extern const String getTimeLocal_hhmmss();
extern const String getDateTimeDotFormated();
extern const String getDateDotFormated();
extern unsigned long strDateToUnix(String date);
const String getDateTimeDotFormatedFromUnix(unsigned long unixTime);
extern const String getDateTimeDotFormatedFromUnix(unsigned long unixTime);
extern unsigned long gmtTimeToLocal(unsigned long gmtTimestamp);
extern const String getDateDotFormatedFromUnix(unsigned long unixTime);

View File

@@ -6,6 +6,7 @@ extern void writeFileUint8tByFrames(const String& filename, uint8_t*& big_buf, s
extern void writeFileUint8tByByte(const String& filename, uint8_t*& payload, size_t length, size_t headerLenth);
extern File seekFile(const String& filename, size_t position = 0);
extern const String writeFile(const String& filename, const String& str);
const String writeEmptyFile(const String& filename);
extern const String addFileLn(const String& filename, const String& str);
extern const String readFile(const String& filename, size_t max_size);
extern const String filepath(const String& filename);
@@ -15,7 +16,7 @@ void removeFile(const String& filename);
void removeDirectory(const String& dir);
void cleanDirectory(String path);
void cleanLogs();
void saveDataDB(String id, String data);
String saveDataDB(String id, String data);
String readDataDB(String id);
extern void onFlashWrite();