111 lines
2.7 KiB
C
111 lines
2.7 KiB
C
|
/*********************
|
|||
|
* INCLUDES
|
|||
|
*********************/
|
|||
|
#include <stdlib.h>
|
|||
|
#include <unistd.h>
|
|||
|
|
|||
|
#include "lvgl/lvgl.h"
|
|||
|
#include "lv_examples/src/lv_demo_widgets/lv_demo_widgets.h"
|
|||
|
#include "lv_drivers/win32drv/win32drv.h"
|
|||
|
#include "lv_conf.h"
|
|||
|
|
|||
|
#include <windows.h>
|
|||
|
/*********************
|
|||
|
* DEFINES
|
|||
|
*********************/
|
|||
|
|
|||
|
/**********************
|
|||
|
* TYPEDEFS
|
|||
|
**********************/
|
|||
|
lv_obj_t *prj_parent_cont;
|
|||
|
lv_obj_t *prj_prev_cont;
|
|||
|
lv_obj_t *prj_float_cont = NULL;
|
|||
|
lv_obj_t *prj_call_cont = NULL;
|
|||
|
uint8_t dsp_ipc_cmd;
|
|||
|
bool coming_call_ok;
|
|||
|
bool call_flag;
|
|||
|
void UpdateSysTime(void);
|
|||
|
lv_timer_t *lvgl_main_task_timer;
|
|||
|
/**********************
|
|||
|
* STATIC PROTOTYPES
|
|||
|
**********************/
|
|||
|
static void mem_time_cb(lv_timer_t *t)
|
|||
|
{
|
|||
|
static uint16_t cnt=0;
|
|||
|
static uint8_t index =0 ;
|
|||
|
lv_mem_monitor_t mem;
|
|||
|
lv_mem_monitor(&mem);
|
|||
|
printf("--------%d------------mem heap size=%d, free_size=%d,used=%d\r\n",index,mem.total_size,mem.free_size,mem.total_size - mem.free_size);
|
|||
|
cnt++;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
void user_read_img_init(void);
|
|||
|
|
|||
|
/**********************
|
|||
|
* STATIC VARIABLES
|
|||
|
**********************/
|
|||
|
|
|||
|
/**********************
|
|||
|
* MACROS
|
|||
|
**********************/
|
|||
|
#define TEST 1
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>Ļص<C4BB><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
static void my_obj_click_event_handler(lv_event_t *event) {
|
|||
|
if (event->code == LV_EVENT_CLICKED) {
|
|||
|
printf("LV_EVENT_CLICKED\r\n");
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>
|
|||
|
// <20><><EFBFBD>磬<EFBFBD><E7A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>ҳ<EFBFBD>桢<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/**********************
|
|||
|
* GLOBAL FUNCTIONS
|
|||
|
**********************/
|
|||
|
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int nCmdShow)
|
|||
|
{
|
|||
|
/*Initialize LittlevGL*/
|
|||
|
lv_init();
|
|||
|
|
|||
|
|
|||
|
|
|||
|
/*Initialize the HAL for LittlevGL*/
|
|||
|
lv_win32_init(hInstance, SW_SHOWNORMAL, LV_HOR_RES_MAX, LV_VER_RES_MAX, NULL);
|
|||
|
//lv_win32_init(hInstance, SW_SHOWNORMAL, 800, 480, NULL);
|
|||
|
user_read_img_init();
|
|||
|
lv_mem_monitor_t mem;
|
|||
|
lv_mem_monitor(&mem);
|
|||
|
printf("--------------------mem heap size=%d, free_size=%d used=%d\r\n",mem.total_size,mem.free_size,mem.total_size - mem.free_size);
|
|||
|
//lv_timer_t *msg_hint_timer = lv_timer_create(mem_time_cb,500,NULL);
|
|||
|
#if 1
|
|||
|
lv_port_indev_init();
|
|||
|
|
|||
|
// moto_animo();
|
|||
|
Enter_screen_id(get_root_win());
|
|||
|
|
|||
|
|
|||
|
// #if !MMI_WIN32_SIM
|
|||
|
// InitSysDateTime();
|
|||
|
// GetCurTimeString();//Get system time
|
|||
|
// lvgl_main_task_timer = lv_timer_create(UpdateSysTime, 1000, NULL);
|
|||
|
// #endif
|
|||
|
|
|||
|
#endif
|
|||
|
|
|||
|
while(!lv_win32_quit_signal)
|
|||
|
{
|
|||
|
/* Periodically call the lv_task handler.
|
|||
|
* It could be done in a timer interrupt or an OS task too.*/
|
|||
|
lv_task_handler();
|
|||
|
usleep(10000); /*Just to let the system breath*/
|
|||
|
}
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|