From f1e96d2ef5d181482167a584fc550de236ba1a06 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Tue, 14 Jul 2026 00:07:06 +0200 Subject: [PATCH] Fix for build --- Devices/cyd-e32r32p/Source/Configuration.cpp | 23 -------- .../cyd-e32r32p/Source/devices/Display.cpp | 52 ------------------- Devices/cyd-e32r32p/Source/devices/Display.h | 26 ---------- Devices/cyd-e32r32p/Source/devices/Power.cpp | 12 ----- Devices/cyd-e32r32p/Source/devices/Power.h | 6 --- .../cyd-e32r32p/{Source => source}/module.cpp | 0 Tactility/Source/app/setup/Setup.cpp | 4 +- 7 files changed, 3 insertions(+), 120 deletions(-) delete mode 100644 Devices/cyd-e32r32p/Source/Configuration.cpp delete mode 100644 Devices/cyd-e32r32p/Source/devices/Display.cpp delete mode 100644 Devices/cyd-e32r32p/Source/devices/Display.h delete mode 100644 Devices/cyd-e32r32p/Source/devices/Power.cpp delete mode 100644 Devices/cyd-e32r32p/Source/devices/Power.h rename Devices/cyd-e32r32p/{Source => source}/module.cpp (100%) diff --git a/Devices/cyd-e32r32p/Source/Configuration.cpp b/Devices/cyd-e32r32p/Source/Configuration.cpp deleted file mode 100644 index a7a18f6a3..000000000 --- a/Devices/cyd-e32r32p/Source/Configuration.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "devices/Display.h" -#include "devices/Power.h" - -#include -#include - -using namespace tt::hal; - -static bool initBoot() { - return driver::pwmbacklight::init(DISPLAY_BACKLIGHT_PIN); -} - -static tt::hal::DeviceVector createDevices() { - return { - createPower(), - createDisplay(), - }; -} - -extern const Configuration hardwareConfiguration = { - .initBoot = initBoot, - .createDevices = createDevices -}; \ No newline at end of file diff --git a/Devices/cyd-e32r32p/Source/devices/Display.cpp b/Devices/cyd-e32r32p/Source/devices/Display.cpp deleted file mode 100644 index 2371943ad..000000000 --- a/Devices/cyd-e32r32p/Source/devices/Display.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "Display.h" - -#include -#include -#include -#include - -// Create the XPT2046 touch device (hardware/esp_lcd driver) -static std::shared_ptr createTouch() { - auto config = std::make_unique( - DISPLAY_SPI_HOST, // spi device / bus (SPI2_HOST) - TOUCH_CS_PIN, // touch CS (IO33) - (uint16_t)DISPLAY_HORIZONTAL_RESOLUTION, // x max - (uint16_t)DISPLAY_VERTICAL_RESOLUTION, // y max - false, // swapXy - true, // mirrorX - true // mirrorY - ); - - return std::make_shared(std::move(config)); -} - -std::shared_ptr createDisplay() { - // Create the ST7789 panel configuration - St7789Display::Configuration panel_configuration = { - .horizontalResolution = DISPLAY_HORIZONTAL_RESOLUTION, - .verticalResolution = DISPLAY_VERTICAL_RESOLUTION, - .gapX = 0, - .gapY = 0, - .swapXY = false, - .mirrorX = false, - .mirrorY = false, - .invertColor = false, - .bufferSize = DISPLAY_DRAW_BUFFER_SIZE, // 0 -> default 1/10 screen - .touch = createTouch(), - .backlightDutyFunction = driver::pwmbacklight::setBacklightDuty, - .resetPin = GPIO_NUM_NC, - .lvglSwapBytes = false, - .rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR // BGR for this display - }; - - // Create the SPI configuration (from EspLcdSpiDisplay base class) - auto spi_configuration = std::make_shared(EspLcdSpiDisplay::SpiConfiguration { - .spiHostDevice = DISPLAY_SPI_HOST, - .csPin = DISPLAY_PIN_CS, - .dcPin = DISPLAY_PIN_DC, - .pixelClockFrequency = 40'000'000, - .transactionQueueDepth = 10 - }); - - return std::make_shared(panel_configuration, spi_configuration); -} \ No newline at end of file diff --git a/Devices/cyd-e32r32p/Source/devices/Display.h b/Devices/cyd-e32r32p/Source/devices/Display.h deleted file mode 100644 index 0106b0913..000000000 --- a/Devices/cyd-e32r32p/Source/devices/Display.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include -#include "driver/gpio.h" -#include "driver/spi_common.h" -#include - -// Display (ST7789P3 on this board) -constexpr auto DISPLAY_SPI_HOST = SPI2_HOST; -constexpr auto DISPLAY_PIN_CS = GPIO_NUM_15; -constexpr auto DISPLAY_PIN_DC = GPIO_NUM_2; -constexpr auto DISPLAY_HORIZONTAL_RESOLUTION = 240; -constexpr auto DISPLAY_VERTICAL_RESOLUTION = 320; -constexpr auto DISPLAY_DRAW_BUFFER_HEIGHT = (DISPLAY_VERTICAL_RESOLUTION / 10); -constexpr auto DISPLAY_DRAW_BUFFER_SIZE = (DISPLAY_HORIZONTAL_RESOLUTION * DISPLAY_DRAW_BUFFER_HEIGHT); -constexpr auto DISPLAY_BACKLIGHT_PIN = GPIO_NUM_27; - -// Touch (XPT2046, resistive, shared SPI with display) -constexpr auto TOUCH_MISO_PIN = GPIO_NUM_12; -constexpr auto TOUCH_MOSI_PIN = GPIO_NUM_13; -constexpr auto TOUCH_SCK_PIN = GPIO_NUM_14; -constexpr auto TOUCH_CS_PIN = GPIO_NUM_33; -constexpr auto TOUCH_IRQ_PIN = GPIO_NUM_36; - - -std::shared_ptr createDisplay(); \ No newline at end of file diff --git a/Devices/cyd-e32r32p/Source/devices/Power.cpp b/Devices/cyd-e32r32p/Source/devices/Power.cpp deleted file mode 100644 index febacad19..000000000 --- a/Devices/cyd-e32r32p/Source/devices/Power.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "Power.h" - -#include -#include - -std::shared_ptr createPower() { - ChargeFromAdcVoltage::Configuration configuration; - // 2.0 ratio, but +.11 added as display voltage sag compensation. - configuration.adcMultiplier = 2.11; - - return std::make_shared(configuration); -} \ No newline at end of file diff --git a/Devices/cyd-e32r32p/Source/devices/Power.h b/Devices/cyd-e32r32p/Source/devices/Power.h deleted file mode 100644 index 7598ded6f..000000000 --- a/Devices/cyd-e32r32p/Source/devices/Power.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include -#include - -std::shared_ptr createPower(); diff --git a/Devices/cyd-e32r32p/Source/module.cpp b/Devices/cyd-e32r32p/source/module.cpp similarity index 100% rename from Devices/cyd-e32r32p/Source/module.cpp rename to Devices/cyd-e32r32p/source/module.cpp diff --git a/Tactility/Source/app/setup/Setup.cpp b/Tactility/Source/app/setup/Setup.cpp index 4336023ae..40aac59ea 100644 --- a/Tactility/Source/app/setup/Setup.cpp +++ b/Tactility/Source/app/setup/Setup.cpp @@ -17,9 +17,11 @@ #include #include +#ifdef ESP_PLATFORM #include +#endif -#if defined(CONFIG_TT_TOUCH_CALIBRATION_REQUIRED) +#ifdef CONFIG_TT_TOUCH_CALIBRATION_REQUIRED #include #endif