From 33dce6e522f75924f0f2cc51bc2dcba812580d98 Mon Sep 17 00:00:00 2001 From: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com> Date: Sun, 23 Mar 2025 15:09:29 +1100 Subject: [PATCH] [lvgl] Ensure non-zero screen dimensions during init (#8444) --- esphome/components/lvgl/lvgl_esphome.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/esphome/components/lvgl/lvgl_esphome.cpp b/esphome/components/lvgl/lvgl_esphome.cpp index a1820dd1c7..2560cd2168 100644 --- a/esphome/components/lvgl/lvgl_esphome.cpp +++ b/esphome/components/lvgl/lvgl_esphome.cpp @@ -423,8 +423,6 @@ LvglComponent::LvglComponent(std::vector displays, float buf this->disp_drv_.full_refresh = this->full_refresh_; this->disp_drv_.flush_cb = static_flush_cb; this->disp_drv_.rounder_cb = rounder_cb; - this->disp_drv_.hor_res = 0; - this->disp_drv_.ver_res = 0; this->disp_ = lv_disp_drv_register(&this->disp_drv_); } @@ -448,7 +446,7 @@ void LvglComponent::setup() { lv_disp_drv_update(this->disp_, &this->disp_drv_); this->rotation = display->get_rotation(); if (this->rotation != display::DISPLAY_ROTATION_0_DEGREES) { - this->rotate_buf_ = static_cast(lv_custom_mem_alloc(this->draw_buf_.size)); // NOLINT + this->rotate_buf_ = static_cast(lv_custom_mem_alloc(buf_bytes)); // NOLINT if (this->rotate_buf_ == nullptr) { this->mark_failed(); this->status_set_error("Memory allocation failure");