Board implementations and fixes (#247)

- Implemented Elecrow Crowpanel Basic 5.0"
- Implemented Elecrow Crowpanel Advance 5.0"
- Implemented CYD 2432S032C
- Fix for CYD 4848S040C rendering drift (lower transfer speed)
- Fix for SD card locking mechanism for various boards
This commit is contained in:
Ken Van Hoeylandt
2025-03-14 22:37:09 +01:00
committed by GitHub
parent 21936f7e9e
commit f85d0239ff
64 changed files with 1587 additions and 134 deletions
@@ -134,20 +134,15 @@ SdCardDevice::State SpiSdCardDevice::getState() const {
* 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 (config->lock) {
bool locked = config->lock->lock(50); // TODO: Refactor to a more reliable locking mechanism
if (!locked) {
TT_LOG_E(TAG, LOG_MESSAGE_MUTEX_LOCK_FAILED_FMT, "LVGL");
return State::Unknown;
}
auto lock = getLock().asScopedLock();
bool locked = lock.lock(50); // TODO: Refactor to a more reliable locking mechanism
if (!locked) {
TT_LOG_E(TAG, LOG_MESSAGE_MUTEX_LOCK_FAILED_FMT, "LVGL");
return State::Unknown;
}
bool result = sdmmc_get_status(card) == ESP_OK;
if (config->lock) {
config->lock->unlock();
}
if (result) {
return State::Mounted;
} else {
+6 -6
View File
@@ -42,7 +42,7 @@ bool init(const std::vector<spi::Configuration>& configurations) {
}
bool configure(spi_host_device_t device, const spi_bus_config_t& configuration) {
auto lock = getLock(device).asScopedLock();
auto lock = getLock(device)->asScopedLock();
lock.lock();
Data& data = dataArray[device];
@@ -59,7 +59,7 @@ bool configure(spi_host_device_t device, const spi_bus_config_t& configuration)
}
bool start(spi_host_device_t device) {
auto lock = getLock(device).asScopedLock();
auto lock = getLock(device)->asScopedLock();
lock.lock();
Data& data = dataArray[device];
@@ -96,7 +96,7 @@ bool start(spi_host_device_t device) {
}
bool stop(spi_host_device_t device) {
auto lock = getLock(device).asScopedLock();
auto lock = getLock(device)->asScopedLock();
lock.lock();
Data& data = dataArray[device];
@@ -133,14 +133,14 @@ bool stop(spi_host_device_t device) {
}
bool isStarted(spi_host_device_t device) {
auto lock = getLock(device).asScopedLock();
auto lock = getLock(device)->asScopedLock();
lock.lock();
return dataArray[device].isStarted;
}
Lock& getLock(spi_host_device_t device) {
return *dataArray[device].lock;
std::shared_ptr<Lock> getLock(spi_host_device_t device) {
return dataArray[device].lock;
}
}