From ed1e2d1321b99e377a31850a71a858f35ac8f1e3 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Fri, 15 Aug 2025 01:44:11 +0200 Subject: [PATCH] Fixes for native driver --- Drivers/ST7789/Source/St7789Display.cpp | 3 +++ Drivers/ST7789/Source/St7789Display.h | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Drivers/ST7789/Source/St7789Display.cpp b/Drivers/ST7789/Source/St7789Display.cpp index edd65af6..46a807d8 100644 --- a/Drivers/ST7789/Source/St7789Display.cpp +++ b/Drivers/ST7789/Source/St7789Display.cpp @@ -109,6 +109,8 @@ bool St7789Display::stop() { } bool St7789Display::startLvgl() { + assert(displayHandle == nullptr); + uint32_t buffer_size; if (configuration->bufferSize == 0) { buffer_size = configuration->horizontalResolution * configuration->verticalResolution / 10; @@ -151,6 +153,7 @@ bool St7789Display::stopLvgl() { return false; } else { lvgl_port_remove_disp(displayHandle); + displayHandle = nullptr; return true; } } diff --git a/Drivers/ST7789/Source/St7789Display.h b/Drivers/ST7789/Source/St7789Display.h index bde9513e..0c1777be 100644 --- a/Drivers/ST7789/Source/St7789Display.h +++ b/Drivers/ST7789/Source/St7789Display.h @@ -112,14 +112,11 @@ public: std::shared_ptr getNativeDisplay() override { assert(displayHandle == nullptr); // Still attached to LVGL context. Call stopLvgl() first. - uint16_t width = configuration->swapXY ? configuration->verticalResolution : configuration->horizontalResolution; - uint16_t height = configuration->swapXY ? configuration->horizontalResolution : configuration->verticalResolution; - return std::make_shared( panelHandle, tt::hal::display::ColorFormat::RGB565, - width, - height + configuration->horizontalResolution, + configuration->verticalResolution ); }