BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

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

Author Topic: ESD with rtos threadx  (Read 9910 times)

Cyrilou

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
ESD with rtos threadx
« 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
Logged

Cyrilou

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: ESD with rtos threadx
« Reply #1 on: February 25, 2021, 02:19:11 PM »

Is it would be a message queue like in guix?
Logged

Kaetemi

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: ESD with rtos threadx
« Reply #2 on: March 10, 2021, 07:20:36 PM »

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

Cyrilou

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: ESD with rtos threadx
« Reply #3 on: March 15, 2021, 08:51:43 AM »

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.
« Last Edit: March 15, 2021, 09:26:39 AM by Cyrilou »
Logged

Kaetemi

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: ESD with rtos threadx
« Reply #4 on: March 24, 2021, 01:39:47 AM »

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

Cyrilou

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: ESD with rtos threadx
« Reply #5 on: April 07, 2021, 02:49:33 PM »

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