emWIN: GUI_Exec() and Job Management

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

emWIN: GUI_Exec() and Job Management

跳至解决方案
800 次查看
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?

 

 

标签 (1)
标记 (2)
0 项奖励
1 解答
754 次查看
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 项奖励
1 回复
755 次查看
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 项奖励