增加断网保存数据到FLASH,恢复联网重新补发,并加上标志位
This commit is contained in:
52
components/FLASH_SPIFS/include/FLASH_SPIFS.h
Normal file
52
components/FLASH_SPIFS/include/FLASH_SPIFS.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef FLASH_SPIFS_H
|
||||
#define FLASH_SPIFS_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "esp_err.h"
|
||||
|
||||
/**
|
||||
* @brief 初始化SPIFFS文件系统
|
||||
*
|
||||
* @return ESP_OK 成功
|
||||
* 其他 失败
|
||||
*/
|
||||
esp_err_t flash_spiffs_init(void);
|
||||
|
||||
/**
|
||||
* @brief 检查文件系统是否已挂载
|
||||
*
|
||||
* @return true 已挂载
|
||||
* false 未挂载
|
||||
*/
|
||||
bool flash_spiffs_is_mounted(void);
|
||||
|
||||
/**
|
||||
* @brief 获取文件系统总大小
|
||||
*
|
||||
* @return 总大小(字节)
|
||||
*/
|
||||
uint32_t flash_spiffs_get_total_size(void);
|
||||
|
||||
/**
|
||||
* @brief 获取文件系统已使用大小
|
||||
*
|
||||
* @return 已使用大小(字节)
|
||||
*/
|
||||
uint32_t flash_spiffs_get_used_size(void);
|
||||
|
||||
/**
|
||||
* @brief 格式化文件系统(清空所有数据)
|
||||
*
|
||||
* @return ESP_OK 成功
|
||||
* 其他 失败
|
||||
*/
|
||||
esp_err_t flash_spiffs_format(void);
|
||||
|
||||
/**
|
||||
* @brief 获取文件系统挂载路径
|
||||
*
|
||||
* @return 挂载路径字符串(如 "/flash")
|
||||
*/
|
||||
const char* flash_spiffs_get_mount_point(void);
|
||||
|
||||
#endif // FLASH_SPIFS_H
|
||||
Reference in New Issue
Block a user