Trying to run lv_port_linux_frame_buffer project as it is from Eclipse CDT IDE in my Ubuntu 20.
I got two problems:
-
Need perditions to get frame buffer. Temporary I solved by running Eclipse as sudo user, but how to allow regular users to get frame buffer?
-
I found application screen in TTY console. I was expecting to find it directly on desktop. There is only counter in the right bottom corner of the screen and no buttons. How to make application to show it’s face in TTY or even on desktop?
main code:
int main(void)
{
/*LittlevGL init*/
lv_init();
/*Linux frame buffer device init*/
fbdev_init();
/*A small buffer for LittlevGL to draw the screen's content*/
static lv_color_t buf[DISP_BUF_SIZE];
/*Initialize a descriptor for the buffer*/
static lv_disp_buf_t disp_buf;
lv_disp_buf_init(&disp_buf, buf, NULL, DISP_BUF_SIZE);
/*Initialize and register a display driver*/
lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.buffer = &disp_buf;
disp_drv.flush_cb = fbdev_flush;
lv_disp_drv_register(&disp_drv);
/*Create a Demo*/
lv_demo_widgets();
/*Handle LitlevGL tasks (tickless mode)*/
while(1) {
lv_task_handler();
usleep(5000);
}
return 0;
}