Skip to content

Commit

Permalink
Fix lvgl without display
Browse files Browse the repository at this point in the history
  • Loading branch information
mutatrum committed Dec 12, 2024
1 parent 695d84a commit d44c3ee
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions main/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,19 @@ esp_err_t display_init(void * pvParameters)

lv_disp_t * disp = lvgl_port_add_disp(&disp_cfg);

if (lvgl_port_lock(0)) {
lv_style_init(&scr_style);
lv_style_set_text_font(&scr_style, &lv_font_portfolio_6x8);
lv_style_set_bg_opa(&scr_style, LV_OPA_COVER);
if (esp_lcd_panel_init_err == ESP_OK) {

lv_theme_set_apply_cb(&theme, theme_apply);
if (lvgl_port_lock(0)) {
lv_style_init(&scr_style);
lv_style_set_text_font(&scr_style, &lv_font_portfolio_6x8);
lv_style_set_bg_opa(&scr_style, LV_OPA_COVER);

lv_display_set_theme(disp, &theme);
lvgl_port_unlock();
}
lv_theme_set_apply_cb(&theme, theme_apply);

lv_display_set_theme(disp, &theme);
lvgl_port_unlock();
}

if (esp_lcd_panel_init_err == ESP_OK) {
// Only turn on the screen when it has been cleared
ESP_RETURN_ON_ERROR(esp_lcd_panel_disp_on_off(panel_handle, true), TAG, "Panel display on failed");

Expand Down

0 comments on commit d44c3ee

Please sign in to comment.