Using a lower priority than of the main thread would make
the LVGL thread to preempt the main thread, for example,
if you do a `xtimer_msleep(200);` on the main thread
giving any chance for the LVGL thread to preempt it
while working with LVGL on the main thread would
make the CPU crash.
To reproduce the bug just create various widgets, and fill
them with data from a sensor that "waits" for data to be ready.
Signed-off-by: Jean Pierre Dudey <me@jeandudey.tech>
Replace direct accesses to sched_active_thread and sched_active_pid with
the helper functions thread_getpid() and thread_get_active(). This serves
two purposes:
1. It makes accidental writes to those variable from outside core less likely.
2. Casting off the volatile qualifier is now well contained to those two
functions