diff --git a/Buildscripts/DevicetreeCompiler/source/generator.py b/Buildscripts/DevicetreeCompiler/source/generator.py index bdcf7ce2..cf7f80f6 100644 --- a/Buildscripts/DevicetreeCompiler/source/generator.py +++ b/Buildscripts/DevicetreeCompiler/source/generator.py @@ -63,7 +63,7 @@ def property_to_string(property: DeviceProperty, devices: list[Device]) -> str: type = property.type if type == "value": return property.value - if type == "boolean": + elif type == "boolean": return "true" elif type == "text": return f"\"{property.value}\"" diff --git a/Devices/guition-jc1060p470ciwy/Source/devices/Jd9165Display.h b/Devices/guition-jc1060p470ciwy/Source/devices/Jd9165Display.h index 0dd66e07..98d33c6a 100644 --- a/Devices/guition-jc1060p470ciwy/Source/devices/Jd9165Display.h +++ b/Devices/guition-jc1060p470ciwy/Source/devices/Jd9165Display.h @@ -8,11 +8,6 @@ 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_ldo_channel_handle_t ldoChannel = nullptr; @@ -34,7 +29,7 @@ public: Jd9165Display( const std::shared_ptr& configuration - ) : EspLcdDisplayV2(configuration, std::make_shared()) {} + ) : EspLcdDisplayV2(configuration) {} ~Jd9165Display() override; diff --git a/Devices/m5stack-tab5/Source/devices/Ili9881cDisplay.h b/Devices/m5stack-tab5/Source/devices/Ili9881cDisplay.h index 3ba945cc..3643df0d 100644 --- a/Devices/m5stack-tab5/Source/devices/Ili9881cDisplay.h +++ b/Devices/m5stack-tab5/Source/devices/Ili9881cDisplay.h @@ -1,18 +1,12 @@ #pragma once #include -#include #include #include 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_ldo_channel_handle_t ldoChannel = nullptr; diff --git a/Devices/waveshare-s3-lcd-13/Source/devices/SdCard.cpp b/Devices/waveshare-s3-lcd-13/Source/devices/SdCard.cpp index ae706305..b01a45b4 100644 --- a/Devices/waveshare-s3-lcd-13/Source/devices/SdCard.cpp +++ b/Devices/waveshare-s3-lcd-13/Source/devices/SdCard.cpp @@ -2,7 +2,6 @@ #include #include -#include #include using tt::hal::sdcard::SpiSdCardDevice; diff --git a/Devices/waveshare-s3-touch-lcd-128/Source/Configuration.cpp b/Devices/waveshare-s3-touch-lcd-128/Source/Configuration.cpp index fcfe9eac..ce63c418 100644 --- a/Devices/waveshare-s3-touch-lcd-128/Source/Configuration.cpp +++ b/Devices/waveshare-s3-touch-lcd-128/Source/Configuration.cpp @@ -1,4 +1,5 @@ #include "devices/Display.h" +#include "devices/SdCard.h" #include #include @@ -6,11 +7,10 @@ using namespace tt::hal; -constexpr auto* TAG = "Waveshare"; - static DeviceVector createDevices() { return { - createDisplay() + createDisplay(), + createSdCard() }; } diff --git a/Drivers/EspLcdCompat/Source/EspLcdDisplay.h b/Drivers/EspLcdCompat/Source/EspLcdDisplay.h index 223395ea..b8144bd0 100644 --- a/Drivers/EspLcdCompat/Source/EspLcdDisplay.h +++ b/Drivers/EspLcdCompat/Source/EspLcdDisplay.h @@ -13,7 +13,8 @@ class EspLcdDisplay : public tt::hal::display::DisplayDevice { esp_lcd_panel_handle_t panelHandle = nullptr; lv_display_t* lvglDisplay = nullptr; std::shared_ptr 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: diff --git a/Drivers/EspLcdCompat/Source/EspLcdDisplayV2.h b/Drivers/EspLcdCompat/Source/EspLcdDisplayV2.h index 124c2356..5d843c4b 100644 --- a/Drivers/EspLcdCompat/Source/EspLcdDisplayV2.h +++ b/Drivers/EspLcdCompat/Source/EspLcdDisplayV2.h @@ -67,9 +67,7 @@ public: explicit EspLcdDisplayV2(const std::shared_ptr& configuration) : configuration(configuration) - { - assert(configuration != nullptr); - } + {} ~EspLcdDisplayV2() override; diff --git a/Tactility/Include/Tactility/hal/Configuration.h b/Tactility/Include/Tactility/hal/Configuration.h index 6d4ece8f..5117c131 100644 --- a/Tactility/Include/Tactility/hal/Configuration.h +++ b/Tactility/Include/Tactility/hal/Configuration.h @@ -27,7 +27,7 @@ struct Configuration { /** Modify LVGL widget size */ const UiScale uiScale = UiScale::Default; - std::function createDevices = [] { return DeviceVector(); }; + const std::function createDevices = [] { return DeviceVector(); }; }; } // namespace diff --git a/Tactility/Source/service/wifi/WifiEsp.cpp b/Tactility/Source/service/wifi/WifiEsp.cpp index bb7b3926..2840f9e0 100644 --- a/Tactility/Source/service/wifi/WifiEsp.cpp +++ b/Tactility/Source/service/wifi/WifiEsp.cpp @@ -304,11 +304,6 @@ bool isConnectionSecure() { return false; } - auto lock = wifi->dataMutex.asScopedLock(); - if (!lock.lock(10 / portTICK_PERIOD_MS)) { - return false; - } - return wifi->isSecureConnection(); } @@ -892,9 +887,11 @@ void onAutoConnectTimer() { std::string getIp() { auto wifi = std::static_pointer_cast(wifi_singleton); + if (wifi == nullptr) return "127.0.0.1"; + auto lock = wifi->dataMutex.asScopedLock(); 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));