Various improvements (#46)

- Specify IDF SDK version in a safer way
- Fix for crash when polling SD card presence (Need to implement a universal locking mechanism later on)
- Updated `ideas.md`
- SD card task prio set to low
This commit is contained in:
Ken Van Hoeylandt
2024-02-17 17:41:56 +01:00
committed by GitHub
parent de34cbfd7a
commit 5fef25fb13
4 changed files with 19 additions and 3 deletions
+13 -1
View File
@@ -5,6 +5,7 @@
#include "esp_vfs_fat.h"
#include "sdmmc_cmd.h"
#include "ui/lvgl_sync.h"
#define TAG "tdeck_sdcard"
@@ -126,7 +127,18 @@ static void sdcard_unmount(void* context) {
static bool sdcard_is_mounted(void* context) {
MountData* data = (MountData*)context;
return (data != NULL) && (sdmmc_get_status(data->card) == ESP_OK);
/**
* The SD card and the screen are on the same SPI bus.
* Writing and reading to the bus from 2 devices at the same time causes crashes.
* This work-around ensures that this check is only happening when LVGL isn't rendering.
*/
if (tt_lvgl_lock(100)) {
bool result = (data != NULL) && (sdmmc_get_status(data->card) == ESP_OK);
tt_lvgl_unlock();
return result;
} else {
return false;
}
}
const SdCard tdeck_sdcard = {