mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-20 15:35:05 +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() {
|
bool St7789Display::startLvgl() {
|
||||||
|
assert(displayHandle == nullptr);
|
||||||
|
|
||||||
uint32_t buffer_size;
|
uint32_t buffer_size;
|
||||||
if (configuration->bufferSize == 0) {
|
if (configuration->bufferSize == 0) {
|
||||||
buffer_size = configuration->horizontalResolution * configuration->verticalResolution / 10;
|
buffer_size = configuration->horizontalResolution * configuration->verticalResolution / 10;
|
||||||
@ -151,6 +153,7 @@ bool St7789Display::stopLvgl() {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
lvgl_port_remove_disp(displayHandle);
|
lvgl_port_remove_disp(displayHandle);
|
||||||
|
displayHandle = nullptr;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,14 +112,11 @@ public:
|
|||||||
std::shared_ptr<tt::hal::display::NativeDisplay> getNativeDisplay() override {
|
std::shared_ptr<tt::hal::display::NativeDisplay> getNativeDisplay() override {
|
||||||
assert(displayHandle == nullptr); // Still attached to LVGL context. Call stopLvgl() first.
|
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>(
|
return std::make_shared<tt::hal::display::EspLcdNativeDisplay>(
|
||||||
panelHandle,
|
panelHandle,
|
||||||
tt::hal::display::ColorFormat::RGB565,
|
tt::hal::display::ColorFormat::RGB565,
|
||||||
width,
|
configuration->horizontalResolution,
|
||||||
height
|
configuration->verticalResolution
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user