emWIN: GUI_Exec() and Job Management

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

emWIN: GUI_Exec() and Job Management

Jump to solution
778 Views
lsrbigfoot
Contributor III

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

static void _DemoTimer(void)
{
  WM_HWIN hWin;
  WM_HTIMER hTimer;
  hWin = WM_CreateWindow(10, 10, 100, 100, WM_CF_SHOW, _cbWin, 0);
  hTimer = WM_CreateTimer(hWin, 0, 1000, 0);
  while (1)
  {
    GUI_Exec();
  }
}

 

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? [See below]

  hWin = WM_CreateWindow(10, 10, 100, 100, WM_CF_SHOW, _cbWin, 0);
  GUI_Exec1();
  hTimer = WM_CreateTimer(hWin, 0, 1000, 0);
  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?

 

 

Labels (1)
Tags (2)
0 Kudos
1 Solution
732 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi lsrbigfoot,

1. Yes, if you call WM_CreateWindow 1000 times, it will cause hardfault. It is helpful to expand s_gui_memory[] size. But 1000 times is too large anyway.

2. Not clear what you mean. But you can do like this

jingpan_0-1621328122808.png

3. It seems there isn't any function can tell how many jobs left.

4. I think enlarge the emWin buffer and call GUI_Exec() more frequently is useful.

 

Regards,

Jing

 

View solution in original post

0 Kudos
1 Reply
733 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi lsrbigfoot,

1. Yes, if you call WM_CreateWindow 1000 times, it will cause hardfault. It is helpful to expand s_gui_memory[] size. But 1000 times is too large anyway.

2. Not clear what you mean. But you can do like this

jingpan_0-1621328122808.png

3. It seems there isn't any function can tell how many jobs left.

4. I think enlarge the emWin buffer and call GUI_Exec() more frequently is useful.

 

Regards,

Jing

 

0 Kudos