mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
- Create `Include/` folder for all main projects - Fix some issues here and there (found while moving things) - All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
30 lines
688 B
C++
30 lines
688 B
C++
#include "Core2SdCard.h"
|
|
|
|
#include <Tactility/lvgl/LvglSync.h>
|
|
#include <Tactility/hal/SpiSdCard.h>
|
|
|
|
#include <esp_vfs_fat.h>
|
|
|
|
#define CORE2_SDCARD_PIN_CS GPIO_NUM_4
|
|
#define CORE2_LCD_PIN_CS GPIO_NUM_5
|
|
|
|
std::shared_ptr<SdCard> createSdCard() {
|
|
auto* configuration = new tt::hal::SpiSdCard::Config(
|
|
CORE2_SDCARD_PIN_CS,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
SdCard::MountBehaviour::AtBoot,
|
|
tt::lvgl::getLvglSyncLockable(),
|
|
{
|
|
CORE2_LCD_PIN_CS
|
|
}
|
|
);
|
|
|
|
auto* sdcard = (SdCard*) new SpiSdCard(
|
|
std::unique_ptr<SpiSdCard::Config>(configuration)
|
|
);
|
|
|
|
return std::shared_ptr<SdCard>(sdcard);
|
|
}
|