mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
Fixes for native driver
This commit is contained in:
parent
db4c0ac6fc
commit
ed1e2d1321
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user