mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
add my gui
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#include "PageManager.h"
|
#include "./PageManager.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
// 定义全局实例
|
// 定义全局实例
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// LVGL version: 9.2
|
// LVGL version: 9.2
|
||||||
// Project name: PowerPico
|
// Project name: PowerPico
|
||||||
|
|
||||||
#include "ui.h"
|
#include "./ui.h"
|
||||||
|
|
||||||
///////////////////// VARIABLES ////////////////////
|
///////////////////// VARIABLES ////////////////////
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
|
|
||||||
///////////////////// TEST LVGL SETTINGS ////////////////////
|
///////////////////// TEST LVGL SETTINGS ////////////////////
|
||||||
#if LV_COLOR_DEPTH != 16
|
#if LV_COLOR_DEPTH != 32
|
||||||
#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings"
|
#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -19,8 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
static void main_timer(lv_timer_t * timer)
|
static void main_timer(lv_timer_t * timer)
|
||||||
{
|
{
|
||||||
// printf("timer\r\n");
|
LV_LOG_INFO("Main timer");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////// ui_initialize //////////////////////
|
/////////////////////// ui_initialize //////////////////////
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// LVGL VERSION: 8.2.0
|
// LVGL VERSION: 9.2
|
||||||
|
|
||||||
|
|
||||||
#ifndef _UI_H
|
#ifndef _UI_H
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ static void lv_linux_disp_init(void)
|
|||||||
#elif LV_USE_SDL
|
#elif LV_USE_SDL
|
||||||
static void lv_linux_disp_init(void)
|
static void lv_linux_disp_init(void)
|
||||||
{
|
{
|
||||||
const int width = atoi(getenv("LV_SDL_VIDEO_WIDTH") ? : "800");
|
const int width = atoi(getenv("LV_SDL_VIDEO_WIDTH") ? : "240");
|
||||||
const int height = atoi(getenv("LV_SDL_VIDEO_HEIGHT") ? : "480");
|
const int height = atoi(getenv("LV_SDL_VIDEO_HEIGHT") ? : "240");
|
||||||
|
|
||||||
lv_sdl_window_create(width, height);
|
lv_sdl_window_create(width, height);
|
||||||
}
|
}
|
||||||
@@ -45,6 +45,8 @@ static void lv_linux_indev_init(void)
|
|||||||
#error Unsupported configuration
|
#error Unsupported configuration
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "./GUI/ui.h"
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
lv_init();
|
lv_init();
|
||||||
@@ -55,9 +57,11 @@ int main(void)
|
|||||||
lv_linux_indev_init();
|
lv_linux_indev_init();
|
||||||
|
|
||||||
/*Create a Demo*/
|
/*Create a Demo*/
|
||||||
lv_demo_widgets();
|
// lv_demo_widgets();
|
||||||
// lv_demo_widgets_start_slideshow();
|
// lv_demo_widgets_start_slideshow();
|
||||||
|
|
||||||
|
ui_init();
|
||||||
|
|
||||||
/*Handle LVGL tasks*/
|
/*Handle LVGL tasks*/
|
||||||
while(1) {
|
while(1) {
|
||||||
lv_timer_handler();
|
lv_timer_handler();
|
||||||
|
|||||||
Reference in New Issue
Block a user