Fixes for native driver

This commit is contained in:
Ken Van Hoeylandt 2025-08-15 01:44:11 +02:00
parent db4c0ac6fc
commit ed1e2d1321
2 changed files with 5 additions and 5 deletions

View File

@ -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;
}
}

View File

@ -112,14 +112,11 @@ public:
std::shared_ptr<tt::hal::display::NativeDisplay> 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<tt::hal::display::EspLcdNativeDisplay>(
panelHandle,
tt::hal::display::ColorFormat::RGB565,
width,
height
configuration->horizontalResolution,
configuration->verticalResolution
);
}