The environment is Arduino IDE 2.3.2 using a Cheap Yellow Display (CYD) ESP32.
Successfully implement a screen with multiple lv_buttonmatrix, then tried to utilize the code from the "Custom Buttons" example in the lvgl documentation. I replicated the code for the second button to change the color of four buttons in my button matrix.
The compilation errors our with:
C:\Users\George\Documents\Arduino\Cheap_Yellow_Display_LVGL_FromScratch\Cheap_Yellow_Display_LVGL_FromScratch.ino: In function 'void event_handler_statematrix2(lv_event_t)':
C:\Users\George\Documents\Arduino\Cheap_Yellow_Display_LVGL_FromScratch\Cheap_Yellow_Display_LVGL_FromScratch.ino:147:37: error: 'lv_draw_task_get_draw_dsc' was not declared in this scope; did you mean 'lv_draw_task_get_arc_dsc'?
147 | lv_draw_dsc_base_t base_dsc = lv_draw_task_get_draw_dsc(draw_task); //draw_task
| ^~~~~~~~~
| lv_draw_task_get_arc_dsc
exit status 1
Compilation error: 'lv_draw_task_get_draw_dsc' was not declared in this scope; did you mean 'lv_draw_task_get_arc_dsc'?
How to reproduce?
static void event_handler_statematrix2(lv_event_t e)
{
lv_obj_t obj = (lv_obj_t)lv_event_get_target(e); // would not compile without (lv_obj_t) <<<<<<<<<<
lv_draw_task_t draw_task = lv_event_get_draw_task(e);
lv_draw_dsc_base_t base_dsc = lv_draw_task_get_draw_dsc(draw_task); //draw_task
/When the button matrix draws the buttons.../
if(base_dsc->part == LV_PART_ITEMS) {
bool pressed = false;
if(lv_buttonmatrix_get_selected_button(obj) == base_dsc->id1 && lv_obj_has_state(obj, LV_STATE_PRESSED)) {
pressed = true;
}
LVGL version
9.1
What happened?
The environment is Arduino IDE 2.3.2 using a Cheap Yellow Display (CYD) ESP32. Successfully implement a screen with multiple lv_buttonmatrix, then tried to utilize the code from the "Custom Buttons" example in the lvgl documentation. I replicated the code for the second button to change the color of four buttons in my button matrix. The compilation errors our with: C:\Users\George\Documents\Arduino\Cheap_Yellow_Display_LVGL_FromScratch\Cheap_Yellow_Display_LVGL_FromScratch.ino: In function 'void event_handler_statematrix2(lv_event_t)': C:\Users\George\Documents\Arduino\Cheap_Yellow_Display_LVGL_FromScratch\Cheap_Yellow_Display_LVGL_FromScratch.ino:147:37: error: 'lv_draw_task_get_draw_dsc' was not declared in this scope; did you mean 'lv_draw_task_get_arc_dsc'? 147 | lv_draw_dsc_base_t base_dsc = lv_draw_task_get_draw_dsc(draw_task); //draw_task | ^
~~~~~~~~ | lv_draw_task_get_arc_dscexit status 1
Compilation error: 'lv_draw_task_get_draw_dsc' was not declared in this scope; did you mean 'lv_draw_task_get_arc_dsc'?
How to reproduce?
static void event_handler_statematrix2(lv_event_t e) { lv_obj_t obj = (lv_obj_t)lv_event_get_target(e); // would not compile without (lv_obj_t) <<<<<<<<<< lv_draw_task_t draw_task = lv_event_get_draw_task(e); lv_draw_dsc_base_t base_dsc = lv_draw_task_get_draw_dsc(draw_task); //draw_task /When the button matrix draws the buttons.../ if(base_dsc->part == LV_PART_ITEMS) { bool pressed = false; if(lv_buttonmatrix_get_selected_button(obj) == base_dsc->id1 && lv_obj_has_state(obj, LV_STATE_PRESSED)) { pressed = true; }
}