mirror of
https://github.com/esphome/esphome.git
synced 2025-07-24 12:16:35 +00:00
[lvgl] Small buffers in internal RAM (#8523)
This commit is contained in:
parent
f6ef50505b
commit
6259ca9ded
@ -433,7 +433,11 @@ void LvglComponent::setup() {
|
||||
auto height = display->get_height();
|
||||
size_t buffer_pixels = width * height / this->buffer_frac_;
|
||||
auto buf_bytes = buffer_pixels * LV_COLOR_DEPTH / 8;
|
||||
auto *buffer = lv_custom_mem_alloc(buf_bytes); // NOLINT
|
||||
void *buffer = nullptr;
|
||||
if (this->buffer_frac_ >= 4)
|
||||
buffer = malloc(buf_bytes); // NOLINT
|
||||
if (buffer == nullptr)
|
||||
buffer = lv_custom_mem_alloc(buf_bytes); // NOLINT
|
||||
if (buffer == nullptr) {
|
||||
this->mark_failed();
|
||||
this->status_set_error("Memory allocation failure");
|
||||
|
Loading…
x
Reference in New Issue
Block a user