New board: Elecrow CrowPanel Avance 2.8" (#224)

- Added new board
- Extracted ST7789 driver and backlight PWM driver into separate subprojects
- Refactored T-Deck to use the shared driver modules
- Fix bug in WiFi service: searching for APs was broken
This commit is contained in:
Ken Van Hoeylandt
2025-02-19 21:01:13 +01:00
committed by GitHub
parent 5055fa7822
commit 0563e42dc9
35 changed files with 865 additions and 252 deletions
@@ -26,7 +26,7 @@ public:
gpio_num_t spiPinWp,
gpio_num_t spiPinInt,
MountBehaviour mountBehaviourAtBoot,
std::shared_ptr<Lock> lockable = std::make_shared<Mutex>(),
std::shared_ptr<Lock> lock = std::make_shared<Mutex>(),
std::vector<gpio_num_t> csPinWorkAround = std::vector<gpio_num_t>(),
spi_host_device_t spiHost = SPI2_HOST,
int spiFrequencyKhz = SDMMC_FREQ_DEFAULT
@@ -36,11 +36,11 @@ public:
spiPinWp(spiPinWp),
spiPinInt(spiPinInt),
mountBehaviourAtBoot(mountBehaviourAtBoot),
lockable(std::move(lockable)),
lock(std::move(lock)),
csPinWorkAround(std::move(csPinWorkAround)),
spiHost(spiHost)
{
assert(this->lockable != nullptr);
assert(this->lock != nullptr);
}
int spiFrequencyKhz;
@@ -49,7 +49,7 @@ public:
gpio_num_t spiPinWp; // Write-protect
gpio_num_t spiPinInt; // Interrupt
SdCardDevice::MountBehaviour mountBehaviourAtBoot;
std::shared_ptr<Lock> _Nullable lockable;
std::shared_ptr<Lock> _Nullable lock;
std::vector<gpio_num_t> csPinWorkAround;
spi_host_device_t spiHost;
bool formatOnMountFailed = false;
@@ -80,7 +80,7 @@ public:
bool unmount() final;
std::string getMountPath() const final { return mountPath; }
Lock& getLock() const final { return *config->lockable; }
Lock& getLock() const final { return *config->lock; }
State getState() const override;
@@ -134,8 +134,8 @@ 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->lockable) {
bool locked = config->lockable->lock(50); // TODO: Refactor to a more reliable locking mechanism
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;
@@ -144,8 +144,8 @@ SdCardDevice::State SpiSdCardDevice::getState() const {
bool result = sdmmc_get_status(card) == ESP_OK;
if (config->lockable) {
config->lockable->unlock();
if (config->lock) {
config->lock->unlock();
}
if (result) {
@@ -381,7 +381,7 @@ static bool copy_scan_list(std::shared_ptr<Wifi> wifi) {
}
auto lock = wifi->dataMutex.asScopedLock();
if (lock.lock()) {
if (!lock.lock()) {
return false;
}