Ken Van Hoeylandt a7a3b17ff6
SD card improvements (#214)
- Implement SD card locking logic and helper functions
- Fix issue with running ELF apps from SD card: this would crash when launched from the AppList
- Reduce Boot app wait time to 1 second
- Speed up boot by about 0.1 second by moving app&service registration to the Boot app
- Files app now uses proper SD card mount point name (and multiple SD cards)
- Removed `TT_SCREENSHOT_MODE`
2025-02-09 12:01:01 +01:00

30 lines
697 B
C++

#include "YellowSdCard.h"
#define TAG "twodotfour_sdcard"
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/hal/SpiSdCard.h>
#define SDCARD_SPI_HOST SPI3_HOST
#define SDCARD_PIN_CS GPIO_NUM_5
std::shared_ptr<SdCard> createYellowSdCard() {
auto* configuration = new tt::hal::SpiSdCard::Config(
SDCARD_PIN_CS,
GPIO_NUM_NC,
GPIO_NUM_NC,
GPIO_NUM_NC,
SdCard::MountBehaviour::AtBoot,
std::make_shared<tt::Mutex>(),
std::vector<gpio_num_t>(),
SDCARD_SPI_HOST
);
auto* sdcard = (SdCard*) new SpiSdCard(
std::unique_ptr<SpiSdCard::Config>(configuration)
);
return std::shared_ptr<SdCard>(sdcard);
}