Refactor face headers and add emotion assets
Moved face-related header files into the 'emotions' directory and added new assets: blink.h, face.h, and facetestLCD.h. Removed the old main/face.h and updated main.c to use the new structure.
This commit is contained in:
18
main/main.c
18
main/main.c
@@ -17,7 +17,7 @@
|
||||
#include "lvgl.h"
|
||||
|
||||
#include "src/extra/libs/gif/lv_gif.h"
|
||||
#include "face.h"
|
||||
#include "emotions/facetestLCD.h"
|
||||
|
||||
/* LCD size */
|
||||
#define LCD_H_RES (240)
|
||||
@@ -58,15 +58,15 @@ static const lv_img_dsc_t g_lvgl_gif_src = {
|
||||
.header.w = 240,
|
||||
.header.h = 135,
|
||||
.header.cf = LV_IMG_CF_RAW,
|
||||
.data_size = sizeof(videoplayback1_ezgif_com_optimize),
|
||||
.data = videoplayback1_ezgif_com_optimize,
|
||||
.data_size = sizeof(facetestLCD),
|
||||
.data = facetestLCD,
|
||||
};
|
||||
|
||||
static esp_err_t app_gif_init_lvgl(lv_obj_t *parent)
|
||||
{
|
||||
g_lvgl_gif = lv_gif_create(parent);
|
||||
lv_gif_set_src(g_lvgl_gif, &g_lvgl_gif_src);
|
||||
lv_obj_align(g_lvgl_gif, LV_ALIGN_TOP_MID, 0, 45);
|
||||
lv_obj_align(g_lvgl_gif, LV_ALIGN_CENTER, 0, 0);
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -205,19 +205,13 @@ void app_main(void)
|
||||
|
||||
lv_obj_t *scr = lv_scr_act();
|
||||
|
||||
/* Black background */
|
||||
lv_obj_set_style_bg_color(scr, lv_color_hex(0x000000), LV_PART_MAIN);
|
||||
/* Background */
|
||||
lv_obj_set_style_bg_color(scr, lv_color_hex(0xD6F6CD), LV_PART_MAIN);
|
||||
lv_obj_set_style_bg_opa(scr, LV_OPA_COVER, LV_PART_MAIN);
|
||||
|
||||
/* Black text samples */
|
||||
|
||||
ESP_ERROR_CHECK(app_gif_init_lvgl(scr));
|
||||
|
||||
lv_obj_t *sample = lv_label_create(scr);
|
||||
lv_label_set_text(sample, "Hey Neil!\nHow are you today?");
|
||||
lv_obj_set_style_text_color(sample, lv_color_hex(0xFFFFFF), LV_PART_MAIN);
|
||||
lv_obj_set_style_text_font(sample, &lv_font_montserrat_16, LV_PART_MAIN);
|
||||
lv_obj_align_to(sample, g_lvgl_gif, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
|
||||
|
||||
lvgl_port_unlock();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user