Jumping from v6 to v8, no more tasks?

Description

I’ve used lvgl 6.x used before with Mbed-OS and I had used a task for cyclic screen updates.
Now I have ported to v8.0 and it is basically running. I had to remove the task, it looks these are no longer supported. Or is there a replacement?

What MCU/Processor/Board and compiler are you using?

STM32F407 and others, Mbed-OS 6.11

What LVGL version are you using?

v6.x → v8.0

What do you want to achieve?

port some simple tests

What have you tried so far?

Code to reproduce

	// register update handler. Task will call screen dependent cyclic updates
	lv_task_create(lv_screen_update_task, 200, LV_TASK_PRIO_MID, 0);

and this was my update task, performing an update on screen activation and then performs cyclic checks:

typedef void (*lv_update_cb_t)(bool);

static void lv_screen_update_task(lv_task_t* task)
{
	static lv_obj_t* lastScreen = 0;
	bool firstStart;

	lv_obj_t* actScreen = lv_disp_get_scr_act(NULL);
	firstStart = (actScreen != lastScreen);
	lastScreen = actScreen;

	if (actScreen && actScreen->user_data) {
		((lv_update_cb_t)actScreen->user_data)(firstStart);
	}
}

Tasks were renamed to timers in v8, and the priority system was removed.

1 Like

why removed prio???

tasks were much more intuitive than timers…

thanks, that worked.
I’m not missing the priorities, lvgl should not try to be a complete operating system.

So far, lvgl 8.0 looks really great :+1:

why not? i think its really useful.for some tasks i would use lvgl without graphical environment just for its simple task system.

As @JojoS noted, LVGL is a GUI library, not a cooperative task scheduler. There are lots of more complete, more refined options out there for task management on embedded platforms.

However, the v7 task module is fairly standalone and stable, so nothing prevents you from taking the lv_task.c and lv_task.h files from v7 and using them in other projects (with some adjustments for missing types, etc.).

thanks for reply