This commit is contained in:
Ken Van Hoeylandt 2026-02-08 21:22:46 +01:00
parent c73286d70b
commit 35ced445b3
9 changed files with 12 additions and 28 deletions

View File

@ -63,7 +63,7 @@ def property_to_string(property: DeviceProperty, devices: list[Device]) -> str:
type = property.type type = property.type
if type == "value": if type == "value":
return property.value return property.value
if type == "boolean": elif type == "boolean":
return "true" return "true"
elif type == "text": elif type == "text":
return f"\"{property.value}\"" return f"\"{property.value}\""

View File

@ -8,11 +8,6 @@
class Jd9165Display final : public EspLcdDisplayV2 { class Jd9165Display final : public EspLcdDisplayV2 {
class NoLock final : public tt::Lock {
bool lock(TickType_t timeout) const override { return true; }
void unlock() const override { /* NO-OP */ }
};
esp_lcd_dsi_bus_handle_t mipiDsiBus = nullptr; esp_lcd_dsi_bus_handle_t mipiDsiBus = nullptr;
esp_ldo_channel_handle_t ldoChannel = nullptr; esp_ldo_channel_handle_t ldoChannel = nullptr;
@ -34,7 +29,7 @@ public:
Jd9165Display( Jd9165Display(
const std::shared_ptr<EspLcdConfiguration>& configuration const std::shared_ptr<EspLcdConfiguration>& configuration
) : EspLcdDisplayV2(configuration, std::make_shared<NoLock>()) {} ) : EspLcdDisplayV2(configuration) {}
~Jd9165Display() override; ~Jd9165Display() override;

View File

@ -1,18 +1,12 @@
#pragma once #pragma once
#include <EspLcdDisplayV2.h> #include <EspLcdDisplayV2.h>
#include <Tactility/RecursiveMutex.h>
#include <esp_lcd_mipi_dsi.h> #include <esp_lcd_mipi_dsi.h>
#include <esp_ldo_regulator.h> #include <esp_ldo_regulator.h>
class Ili9881cDisplay final : public EspLcdDisplayV2 { class Ili9881cDisplay final : public EspLcdDisplayV2 {
class NoLock final : public tt::Lock {
bool lock(TickType_t timeout) const override { return true; }
void unlock() const override { /* NO-OP */ }
};
esp_lcd_dsi_bus_handle_t mipiDsiBus = nullptr; esp_lcd_dsi_bus_handle_t mipiDsiBus = nullptr;
esp_ldo_channel_handle_t ldoChannel = nullptr; esp_ldo_channel_handle_t ldoChannel = nullptr;

View File

@ -2,7 +2,6 @@
#include <Tactility/lvgl/LvglSync.h> #include <Tactility/lvgl/LvglSync.h>
#include <Tactility/hal/sdcard/SpiSdCardDevice.h> #include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/RecursiveMutex.h>
#include <driver/gpio.h> #include <driver/gpio.h>
using tt::hal::sdcard::SpiSdCardDevice; using tt::hal::sdcard::SpiSdCardDevice;

View File

@ -1,4 +1,5 @@
#include "devices/Display.h" #include "devices/Display.h"
#include "devices/SdCard.h"
#include <driver/gpio.h> #include <driver/gpio.h>
#include <Tactility/hal/Configuration.h> #include <Tactility/hal/Configuration.h>
@ -6,11 +7,10 @@
using namespace tt::hal; using namespace tt::hal;
constexpr auto* TAG = "Waveshare";
static DeviceVector createDevices() { static DeviceVector createDevices() {
return { return {
createDisplay() createDisplay(),
createSdCard()
}; };
} }

View File

@ -13,7 +13,8 @@ class EspLcdDisplay : public tt::hal::display::DisplayDevice {
esp_lcd_panel_handle_t panelHandle = nullptr; esp_lcd_panel_handle_t panelHandle = nullptr;
lv_display_t* lvglDisplay = nullptr; lv_display_t* lvglDisplay = nullptr;
std::shared_ptr<tt::hal::display::DisplayDriver> displayDriver; std::shared_ptr<tt::hal::display::DisplayDriver> displayDriver;
lcd_rgb_element_order_t rgbElementOrder; /** @warning This is never changed, so a driver that needs BGR is not supported */
lcd_rgb_element_order_t rgbElementOrder = LCD_RGB_ELEMENT_ORDER_RGB;
protected: protected:

View File

@ -67,9 +67,7 @@ public:
explicit EspLcdDisplayV2(const std::shared_ptr<EspLcdConfiguration>& configuration) : explicit EspLcdDisplayV2(const std::shared_ptr<EspLcdConfiguration>& configuration) :
configuration(configuration) configuration(configuration)
{ {}
assert(configuration != nullptr);
}
~EspLcdDisplayV2() override; ~EspLcdDisplayV2() override;

View File

@ -27,7 +27,7 @@ struct Configuration {
/** Modify LVGL widget size */ /** Modify LVGL widget size */
const UiScale uiScale = UiScale::Default; const UiScale uiScale = UiScale::Default;
std::function<DeviceVector()> createDevices = [] { return DeviceVector(); }; const std::function<DeviceVector()> createDevices = [] { return DeviceVector(); };
}; };
} // namespace } // namespace

View File

@ -304,11 +304,6 @@ bool isConnectionSecure() {
return false; return false;
} }
auto lock = wifi->dataMutex.asScopedLock();
if (!lock.lock(10 / portTICK_PERIOD_MS)) {
return false;
}
return wifi->isSecureConnection(); return wifi->isSecureConnection();
} }
@ -892,9 +887,11 @@ void onAutoConnectTimer() {
std::string getIp() { std::string getIp() {
auto wifi = std::static_pointer_cast<Wifi>(wifi_singleton); auto wifi = std::static_pointer_cast<Wifi>(wifi_singleton);
if (wifi == nullptr) return "127.0.0.1";
auto lock = wifi->dataMutex.asScopedLock(); auto lock = wifi->dataMutex.asScopedLock();
if (!lock.lock(100 / portTICK_PERIOD_MS)) { if (!lock.lock(100 / portTICK_PERIOD_MS)) {
return "0.0.0.0"; return "127.0.0.1";
} }
return std::format("{}.{}.{}.{}", IP2STR(&wifi->ip_info.ip)); return std::format("{}.{}.{}.{}", IP2STR(&wifi->ip_info.ip));