BRT Community
General Category => Discussion - EVE => Topic started by: Cyrilou on February 24, 2021, 09:27:02 AM
-
Hi,
We're migrating our monothread project on simple LCD display to EVE display.
I use 2 threads: one for display with EVE ESD project UI and an other for our own library. This library must send events info, data structures, event for displaying and synchronysing with UI thread.
For example our library must send an event to change of EVE page or to display or not some widgets.
There is no examples of this implementation/architecture.
How can I handle this easilly?
Regards
-
Is it would be a message queue like in guix?
-
In App.main, create an event slot named either "Idle" or "Update", and connect it to a C function that processes your message queue.
"Idle" will be called repeatedly when the ESD thread is waiting for EVE (frame swap, loading, etc.)
"Update" will be called once inbetween frames.
Depends on your requirements. "Update" is safest.
-
Hi , Thanks for this answer.
I use Update callback which is called here:
ec->DeltaMs = ms - ec->Millis;
ec->Millis = ms;
Esd_GpuAlloc_Update(Esd_GAlloc); // Run GC
Esd_TouchTag_Update(NULL); // Update touch
if (ec->Update)
ec->Update(ec->UserContext);<--callback
An other question I have is how much time can I allocate to scheduler for other thread execute (by tx thread sleep(time) instruction) without lock screen render? If I consider thread UI is the highest priority.
-
The screen update loop needs to run at least once per 16ms (that is, once per frame) to have smooth 60Hz UI updates.
Animations that run on the coprocessor (fullscreen video and progress spinners) don't require updates from the update loop, and remain smooth even if the update loop is blocked. (So you can use AVI video playback or the builtin progress spinners to entertain the user while doing heavy tasks on the mcu.)
-
So if I make a tx_thread_sleep(1) (one tick =10ms) in idle callback (when library poll cmdb_space) it is already too much! I must reduce tick time base.