Setting call back for emwin function GUI_SetRefreshHook() function

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Setting call back for emwin function GUI_SetRefreshHook() function

    Hi am trying to set call back for the emwin GUI_SetRefreshHook function but call back is not happening ? why? My implementation has given follows

    void callbacknon_displayperiod (void);
    extern void GUI_SetRefreshHook(void (* callbacknon_displayperiod)(void));


    main
    {
    //GUI init and emwing initializations

    }



    void callbacknon_displayperiod ( )
    {

    int test;

    test =0;

    }

    I put break point on the call back function " void callbacknon_displayperiod ( )" but it not happening why ???????


    Thanks

    Nikhil
  • Hi,

    This function gets only called when using a cached version of an indirect display driver.
    It won't be called when using GUIDRV_Lin.

    The most common indirect display driver is most likely the GUIDRV_FlexColor driver.

    To get this function called you have to choose the cached version of the driver, for example:

    GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C1B8);

    The red one stands for cache enabled.

    If you are using GUIDRV_Lin you should use the multi buffering API.

    Which driver are you using?

    Attached is an example on how you can use the function GUI_SetRefreshHook().

    Regards
    Sven
    Files
    • RefreshHook.zip

      (672 Byte, downloaded 65 times, last: )
  • Hi,

    Thank you for the immediate response.

    The driver we are using is GUIDRV_Lin. In our project we are using EmWin with STM32F429 processor. Our application is using LTDC driver of STM processor with virtual screen support. We are not using multi buffering since we understand that it should not be used along with Virtual Screen.


    Our Issue is when our TFT display refresh is 32 MHz and our virtual screen is in external SDRAM. When trying to load screen to TFT display we finding the images are shivering vertically. But when the TFT display refresh rate is 24 MHz, the display is stable but we are facing flicker issue because of lower refresh rate.


    Could please provide a solution for this situation.


    Regards
    Nikhil Raj.