mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-03 04:40:39 +08:00
Fix bug with FATFS on esp32 for free space calculation
This commit is contained in:
parent
bd026eabe9
commit
5cede996cc
@ -80,10 +80,7 @@ public:
|
|||||||
static void end();
|
static void end();
|
||||||
static size_t totalBytes();
|
static size_t totalBytes();
|
||||||
static size_t usedBytes();
|
static size_t usedBytes();
|
||||||
static size_t freeBytes()
|
static size_t freeBytes();
|
||||||
{
|
|
||||||
return totalBytes()-usedBytes();
|
|
||||||
};
|
|
||||||
static size_t max_update_size();
|
static size_t max_update_size();
|
||||||
static const char * FilesystemName();
|
static const char * FilesystemName();
|
||||||
static bool format();
|
static bool format();
|
||||||
|
@ -38,6 +38,11 @@ void ESP_FileSystem::end()
|
|||||||
_started = false;
|
_started = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t ESP_FileSystem::freeBytes()
|
||||||
|
{
|
||||||
|
return FFat.freeBytes();
|
||||||
|
}
|
||||||
|
|
||||||
size_t ESP_FileSystem::totalBytes()
|
size_t ESP_FileSystem::totalBytes()
|
||||||
{
|
{
|
||||||
return FFat.totalBytes();
|
return FFat.totalBytes();
|
||||||
|
@ -38,6 +38,11 @@ void ESP_FileSystem::end()
|
|||||||
LittleFS.end();
|
LittleFS.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t ESP_FileSystem::freeBytes()
|
||||||
|
{
|
||||||
|
return totalBytes() - usedBytes();
|
||||||
|
}
|
||||||
|
|
||||||
size_t ESP_FileSystem::totalBytes()
|
size_t ESP_FileSystem::totalBytes()
|
||||||
{
|
{
|
||||||
fs::FSInfo info;
|
fs::FSInfo info;
|
||||||
|
@ -36,6 +36,11 @@ void ESP_FileSystem::end()
|
|||||||
SPIFFS.end();
|
SPIFFS.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t ESP_FileSystem::freeBytes()
|
||||||
|
{
|
||||||
|
return totalBytes() - usedBytes();
|
||||||
|
}
|
||||||
|
|
||||||
size_t ESP_FileSystem::totalBytes()
|
size_t ESP_FileSystem::totalBytes()
|
||||||
{
|
{
|
||||||
return SPIFFS.totalBytes();
|
return SPIFFS.totalBytes();
|
||||||
|
@ -36,6 +36,11 @@ void ESP_FileSystem::end()
|
|||||||
SPIFFS.end();
|
SPIFFS.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t ESP_FileSystem::freeBytes()
|
||||||
|
{
|
||||||
|
return totalBytes() - usedBytes();
|
||||||
|
}
|
||||||
|
|
||||||
size_t ESP_FileSystem::totalBytes()
|
size_t ESP_FileSystem::totalBytes()
|
||||||
{
|
{
|
||||||
fs::FSInfo info;
|
fs::FSInfo info;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user