Skip to content

Commit 0b1bd34

Browse files
committed
fixed framebuffer allocation for RGB bus driver
1 parent b2cbcce commit 0b1bd34

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ext_mod/lcd_bus/src/esp32/rgb_bus.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@
7474
mp_lcd_rgb_bus_obj_t *self = (mp_lcd_rgb_bus_obj_t *)self_in;
7575
mp_lcd_sw_rotation_init_t *init = &self->sw_rot.init;
7676

77+
free(self->sw_rot.data.buffers.active);
78+
self->sw_rot.data.buffers.active = NULL;
79+
self->sw_rot.data.buffers.idle = NULL;
80+
7781
esp_lcd_rgb_panel_event_callbacks_t callbacks = { .on_vsync = rgb_trans_done_cb };
7882

7983
init->err = esp_lcd_new_rgb_panel(self->panel_io_config, &self->panel_handle);
@@ -393,6 +397,11 @@
393397
self->panel_io_config->flags.fb_in_psram = 1;
394398
self->panel_io_config->flags.double_fb = 1;
395399

400+
401+
uint8_t *tmp_buf = (uint8_t *)malloc(1);
402+
self->sw_rot.data.buffers.active = tmp_buf;
403+
self->sw_rot.data.buffers.idle = tmp_buf;
404+
396405
LCD_DEBUG_PRINT("h_res=%lu\n", self->panel_io_config->timings.h_res)
397406
LCD_DEBUG_PRINT("v_res=%lu\n", self->panel_io_config->timings.v_res)
398407
LCD_DEBUG_PRINT("bits_per_pixel=%d\n", self->panel_io_config->bits_per_pixel)

0 commit comments

Comments
 (0)