GUI_Exec() and Job Management

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

    • GUI_Exec() and Job Management

      Just asking a few hypothetical questions about using GUI_Exec() or GUI_Exec1() calls because I sometimes experience HardFaults when GUI_Exec() was called.

      The below snippet is from emWin Manual (section 6.1.8.7.1):

      Source Code

      1. static void _DemoTimer(void)
      2. {
      3. WM_HWIN hWin;
      4. WM_HTIMER hTimer;
      5. hWin = WM_CreateWindow(10, 10, 100, 100, WM_CF_SHOW, _cbWin, 0);
      6. hTimer = WM_CreateTimer(hWin, 0, 1000, 0);
      7. while (1)
      8. {
      9. GUI_Exec();
      10. }
      11. }
      Display All

      If WM_CreateWindow() and WM_CreateTimer() and others like GUI_FillRectEx() and GUI_DrawGradientV() were called 1000 times prior to next GUI_Exec() call will the job queues get compromised (overflow) or does that depend on my program settings like heap size or some other emWin setting?

      Will GUI_Exec1() call process entire WM_CreateWIndow() action or part of action?


      Source Code

      1. hWin = WM_CreateWindow(10, 10, 100, 100, WM_CF_SHOW, _cbWin, 0);
      2. GUI_Exec1();
      3. hTimer = WM_CreateTimer(hWin, 0, 1000, 0);
      4. GUI_Exec1();


      Is there a way to tell how many jobs need to be performed by GUI_Exec()?

      Lastly, what approaches do you recommend to avoid hardfaults when GUI_Exec() or GUI_Exec1() is called?