fix: Prevent functional degradation if SD has less than 50MB free space (#3802)
* fix: Prevent functional degradation if SD has less than 50MB free space (#3730) * justification: https://github.com/EdgeTX/edgetx/discussions/3666 - checks SD card free space at startup, start of logging and writing screenshots - issues warning to user if SD card has less than 50MB free space - will not write logs or screenshots if free space is less than 50MB at activation timerReset - fixes crash of warning popup in logs.cpp (#3728) * update: warning message if SD card fills up to threshold while logging * empty commit * call popup in non-blocking mode * make b&w compatible to non-blocking popup calls * 2nd attempt * Popup: - turns on backlight if dimmed due to inactivity setting - if backlight is dimmed due to inactivity setting backlight can turnd on again by any controls * #3599 * fixed b&w UI * updated languages CN, CZ, DA, DE, FR, HE, IT, PL, PT, SE, TW * chore: Update translations * chore: Remove magic number * chore: JP language update for SD card full (#3809) * fix: Don't spam simulator log with file close msgs --------- Co-authored-by: Michael <mha1@users.noreply.github.com>
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
#include "libopenui/src/libopenui_file.h"
|
||||
#endif
|
||||
|
||||
#define SDCARD_MIN_FREE_SPACE_MB 50 // Maintain a 50MB free space buffer to prevent crashes
|
||||
|
||||
const char * sdCheckAndCreateDirectory(const char * path)
|
||||
{
|
||||
DIR archiveFolder;
|
||||
@@ -463,7 +465,7 @@ uint32_t sdGetSize()
|
||||
|
||||
uint32_t sdGetFreeSectors()
|
||||
{
|
||||
return 10;
|
||||
return ((SDCARD_MIN_FREE_SPACE_MB*1024*1024)/BLOCK_SIZE)+1; // SIMU SD card is always above threshold
|
||||
}
|
||||
|
||||
#endif // #if !defined(SIMU) || defined(SIMU_DISKIO)
|
||||
|
||||
Reference in New Issue
Block a user