-
Notifications
You must be signed in to change notification settings - Fork 86
/
main.c
64 lines (51 loc) · 1.52 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
* @file main
*
*/
/*********************
* INCLUDES
*********************/
#include <stdlib.h>
#include <unistd.h>
#include "lvgl/lvgl.h"
#include "lvgl/demos/lv_demos.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
static const wchar_t * title = L"LVGL port Windows CodeBlocks. https://lvgl.io | https://docs.lvgl.io";
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int nCmdShow)
{
/*Initialize LVGL*/
lv_init();
/*Initialize the HAL for LVGL*/
lv_display_t * display = lv_windows_create_display(title, 800, 480, 100, FALSE, FALSE);
lv_windows_acquire_pointer_indev(display);
/*Output prompt information to the console, you can also use printf() to print directly*/
LV_LOG_USER("LVGL initialization completed!");
/*Run the demo*/
//lv_demo_widgets();
char * demo_str[] = {"widgets"};
lv_demos_create(demo_str, strlen((char * )demo_str));
while(1) {
/* Periodically call the lv_task handler.
* It could be done in a timer interrupt or an OS task too.*/
lv_task_handler();
usleep(5000); /*Just to let the system breath*/
}
return 0;
}