tests/pkg_lvgl: adapt to new lvgl API

This commit is contained in:
Alexandre Abadie 2020-05-31 17:59:39 +02:00
parent 4842da272c
commit 1f6c51602a
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -25,12 +25,15 @@
#include "lvgl/lvgl.h"
#include "lvgl_riot.h"
#include "screen_dev.h"
#include "ili9341.h"
#include "ili9341_params.h"
#include "disp_dev.h"
#include "ili9341_disp_dev.h"
static ili9341_t dev;
static ili9341_t s_disp_dev;
static screen_dev_t s_screen;
#define CPU_LABEL_COLOR "FF0000"
#define MEM_LABEL_COLOR "0000FF"
@ -128,17 +131,17 @@ void sysmon_create(void)
int main(void)
{
/* Configure the generic display driver interface */
disp_dev_t *disp_dev = (disp_dev_t *)&dev;
disp_dev->driver = &ili9341_disp_dev_driver;
s_screen.display = (disp_dev_t *)&s_disp_dev;
s_screen.display->driver = &ili9341_disp_dev_driver;
/* Enable backlight */
disp_dev_backlight_on();
/* Initialize the concrete display driver */
ili9341_init(&dev, &ili9341_params[0]);
ili9341_init(&s_disp_dev, &ili9341_params[0]);
/* Initialize lvgl with the generic display driver interface */
lvgl_init(disp_dev);
/* Initialize lvgl with the generic display and touch drivers */
lvgl_init(&s_screen);
/* Create the system monitor widget */
sysmon_create();