mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
- Create real drivers instead of wrapping M5Unified/M5GFX - Display HAL improvements (better default base class behaviour) - Fixed bug with LVGL statusbar service locking (would hang indefinitely waiting for mutex, causing WDT issues) - Fixes for `Critical.h` - Fixes and improvements for `Dispatcher` and `DispatcherThread`
32 lines
745 B
C++
32 lines
745 B
C++
#include "Core2SdCard.h"
|
|
|
|
#include "lvgl/LvglSync.h"
|
|
#include "hal/SpiSdCard.h"
|
|
|
|
#include <esp_vfs_fat.h>
|
|
|
|
#define CORE2_SDCARD_SPI_FREQUENCY 800000U
|
|
#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_SPI_FREQUENCY,
|
|
CORE2_SDCARD_PIN_CS,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
GPIO_NUM_NC,
|
|
SdCard::MountBehaviourAtBoot,
|
|
tt::lvgl::getLvglSyncLockable(),
|
|
{
|
|
CORE2_LCD_PIN_CS
|
|
}
|
|
);
|
|
|
|
auto* sdcard = (SdCard*) new SpiSdCard(
|
|
std::unique_ptr<SpiSdCard::Config>(configuration)
|
|
);
|
|
|
|
return std::shared_ptr<SdCard>(sdcard);
|
|
}
|