News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Main Menu

ESD with rtos threadx

Started by Cyrilou, February 24, 2021, 09:27:02 AM

Previous topic - Next topic

Cyrilou

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

Cyrilou

Is it would be a message queue like in guix?

Kaetemi

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.

Cyrilou

#3
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.

Kaetemi

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.)

Cyrilou

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.