mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
Fixes
This commit is contained in:
parent
c73286d70b
commit
35ced445b3
@ -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}\""
|
||||
|
||||
@ -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<EspLcdConfiguration>& configuration
|
||||
) : EspLcdDisplayV2(configuration, std::make_shared<NoLock>()) {}
|
||||
) : EspLcdDisplayV2(configuration) {}
|
||||
|
||||
~Jd9165Display() override;
|
||||
|
||||
|
||||
@ -1,18 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <EspLcdDisplayV2.h>
|
||||
#include <Tactility/RecursiveMutex.h>
|
||||
|
||||
#include <esp_lcd_mipi_dsi.h>
|
||||
#include <esp_ldo_regulator.h>
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
||||
#include <Tactility/RecursiveMutex.h>
|
||||
#include <driver/gpio.h>
|
||||
|
||||
using tt::hal::sdcard::SpiSdCardDevice;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include "devices/Display.h"
|
||||
#include "devices/SdCard.h"
|
||||
#include <driver/gpio.h>
|
||||
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
@ -6,11 +7,10 @@
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
constexpr auto* TAG = "Waveshare";
|
||||
|
||||
static DeviceVector createDevices() {
|
||||
return {
|
||||
createDisplay()
|
||||
createDisplay(),
|
||||
createSdCard()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -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<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:
|
||||
|
||||
|
||||
@ -67,9 +67,7 @@ public:
|
||||
|
||||
explicit EspLcdDisplayV2(const std::shared_ptr<EspLcdConfiguration>& configuration) :
|
||||
configuration(configuration)
|
||||
{
|
||||
assert(configuration != nullptr);
|
||||
}
|
||||
{}
|
||||
|
||||
~EspLcdDisplayV2() override;
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ struct Configuration {
|
||||
/** Modify LVGL widget size */
|
||||
const UiScale uiScale = UiScale::Default;
|
||||
|
||||
std::function<DeviceVector()> createDevices = [] { return DeviceVector(); };
|
||||
const std::function<DeviceVector()> createDevices = [] { return DeviceVector(); };
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@ -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>(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));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user