mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-15 10:58:54 +00:00
v1.0.3
This commit is contained in:
19
packages/artinchip/lvgl-ui/aic_demo/gif_demo/SConscript
Normal file
19
packages/artinchip/lvgl-ui/aic_demo/gif_demo/SConscript
Normal file
@@ -0,0 +1,19 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
group = []
|
||||
src = []
|
||||
CPPPATH = [cwd]
|
||||
|
||||
src += Glob('./gif_ui.c')
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
group = group + DefineGroup('LVGL-port', src, depend = ['AIC_LVGL_GIF_DEMO'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
37
packages/artinchip/lvgl-ui/aic_demo/gif_demo/gif_ui.c
Normal file
37
packages/artinchip/lvgl-ui/aic_demo/gif_demo/gif_ui.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "lvgl.h"
|
||||
#include "gif_ui.h"
|
||||
|
||||
static void gif_event(lv_event_t * e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
|
||||
if (code == LV_EVENT_READY) {
|
||||
int *end_flag = (int *)lv_event_get_user_data(e);
|
||||
*end_flag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void gif_ui_init(int *end_flag)
|
||||
{
|
||||
lv_obj_t * img;
|
||||
img = lv_gif_create(lv_scr_act());
|
||||
|
||||
lv_gif_set_src(img, LVGL_PATH(gif/cherub.gif));
|
||||
|
||||
printf("path:%s\n", LVGL_PATH(gif/cherub.gif));
|
||||
// must call after lv_gif_set_src
|
||||
lv_gif_set_loop_count(img, 1);
|
||||
lv_obj_align(img, LV_ALIGN_CENTER, 0, 0);
|
||||
|
||||
lv_obj_add_event_cb(img, gif_event, LV_EVENT_ALL, end_flag);
|
||||
printf("gif_ini_ok\n");
|
||||
}
|
||||
22
packages/artinchip/lvgl-ui/aic_demo/gif_demo/gif_ui.h
Normal file
22
packages/artinchip/lvgl-ui/aic_demo/gif_demo/gif_ui.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 ArtinChip Technology Co., Ltd.
|
||||
* Authors: Ning Fang <ning.fang@artinchip.com>
|
||||
*/
|
||||
|
||||
#ifndef GIF_UI_H
|
||||
#define GIF_UI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "lvgl.h"
|
||||
#include "aic_ui.h"
|
||||
|
||||
void gif_ui_init();
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif // GIF_UI_H
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
Reference in New Issue
Block a user