in System Integration by

Good morning, 

I am developing the interface with ESP32-WROVER MCU (equipped with 16MB flash and 8MB PSRAM) and I have a question related to the PresentDialog command.

In my solution as I described in this post: https://ask.embedded-wizard.de/4633/esp32-display-800x480-artefacts-effects-limitation-display I am using a 5" display at 800x480 resolution with the SPI interface. The display controller is a Raio RA8875 and I use a scratchpad width of 800 and a scratchpad height of 30 (It is less than 1/10 of the screen size but it seems to work with no problem), however to avoid tearing effects during Dialog update (cause of the big size of the resolution compared the scratchpad size) I want to manage the backlight of the display (hardware managing) to fade-out and fade-in the backlight during a change of the Dialog screen (DismissDialog followed by a PresentDialog).

To do so I thought this solution

  1. Send a command to my DeviceDriver interface to "switch off" the backlight before of sending a a DismissDialog (I have implemented this command routine and seems to work well with no problem)
  2. Then, send a DismissDialog of the current frame followed by a PresentDialog of the new Screen that I want to show on the LCD.
  3. When the new Screen update is terminated, I want to switch-on the backlight. So during the screen update the tearing effects is "masked" by the switch-off of the backlight
For implementing the point 3. I thought for 2 solutions but no one is working at the moment and I have no idea how to have a "signal" from the device when the Dialog "update" is completed.
  1. Solution 1) I have used the PresentDialog arg slot aComplete to "launch" a slot that send a command to my Device to switch on the backlight when the PresentDialog is completed: Problem: the slot is executed immediately when the PresentDialog is sent, so I'm wrong about thinking that the aComplete slot is scheduled and the executed at the completetation of the real device screen update.(It is not "linked" with real hw device update)
  2. Solution 2) I have thinked to implement the function directly in the update process of the .c function that manage the display update... to do so, I have thinked to manage a sort of "signal" variable that is sent from the GUI whan I launch the PresentDialog, so in Device driver I know when the PresentDialog routine has been launched and directly implement the "switch-on" routine of the backlight when the  update process of the screen is terminated....I have tried to change EwBspDisplayGetUpdateArea or EwBspDisplayCommitBuffer and other function in ew_bsp_display.c to know when the update is completed, but without success...
So the problem is: is there a method to know when the Update of the PresentDialog is actually completed on the Device? Can you please tell me wich fucntion I need to check to know this or there is a method to know this directly in the GUI developping with PresentDialog or other method?
I hope that I have correctly described my problem.
Thank you in advance for the answer, best regards.

1 Answer

0 votes

Hi Emanuele,

thanks for your excellent description of the issue - it is very clear what you have done so far and what you try to achieve...

Maybe the solution is very simple (I did not verify this on a hardware but it should work):

You can use PresentDialog and the aComplete slot to get informed about the completion (your solution 1). Within this slot method you send a signal to your DeviceDriver to swich on the backlight. The trick is now, to use idlesignal which will be delivered after the screen update is completed.

Does this work?

Best regards,



Thank you for the answer

Sorry, but I have try your solution and: or it doesn't work or I don't understand how to implement it.

Maybe I'm wrong, but your solution It seems related to the completion of the Transiction effects of the PresentDialog,  (if I use "PresentDialog( alert, null, null, null, null, null, null, onComplete, null, false );, also with idlesignal, the slot "onComplete" is executed immediately,and not related to the real device completion of the SPI write in the GRAM of the display, so the onComplete slot is execute while the DispDrvWriteDataWindow of the entire frame (launched by the PresenDialog) it's in progess and not yet completed.

I have implement the idlsignal in the wrong place?


The idea was the following:

You use the mechanism of PresentDialog and the onComplete slot as it is (no changes).

Within the onComplete method that is called when PresentDialog is completed, you send an idlesignal to the device driver that will switch on the backlight.

This idlesignal ensures that it will be delivered after the screen update is completed.

Does it work?


Hi Manfred,

sorry for my late reply, but I was in vacation after your last reply till one week ago.

I want to confirm that now I understand your solution: I put the idlesignal in the slot onComplete invoked by the PresentDialog, I tested it and I can confirmed to you that it works very well as expected.


Thank you very much for you assistance.

Emanuele Orsi


Embedded Wizard Website | Privacy Policy | Imprint