<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis Microcontrollers中的主题 emWIN: GUI_Exec() and Job Management</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/emWIN-GUI-Exec-and-Job-Management/m-p/1277164#M60540</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Just asking a few hypothetical questions about using GUI_Exec() or GUI_Exec1() calls because I sometimes experience HardFaults when GUI_Exec() was called.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The below snippet is from emWin Manual (section 6.1.8.7.1):&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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();
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If WM_CreateWindow() and WM_CreateTimer() and others like GUI_FillRectEx() and GUI_DrawGradientV() were called 1000 times&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;prior to next GUI_Exec() call&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;will the job queues get compromised (overflow) or does that depend on my program settings like heap size or some other emWin setting?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will GUI_Exec1() call process entire WM_CreateWIndow() action or part of action? [See below]&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  hWin = WM_CreateWindow(10, 10, 100, 100, WM_CF_SHOW, _cbWin, 0);
  GUI_Exec1();
  hTimer = WM_CreateTimer(hWin, 0, 1000, 0);
  GUI_Exec1();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there a way to tell how many jobs need to be performed by GUI_Exec()?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lastly, what approaches do you recommend to avoid hardfaults when GUI_Exec() or GUI_Exec1() is called?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 15 May 2021 01:02:13 GMT</pubDate>
    <dc:creator>lsrbigfoot</dc:creator>
    <dc:date>2021-05-15T01:02:13Z</dc:date>
    <item>
      <title>emWIN: GUI_Exec() and Job Management</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/emWIN-GUI-Exec-and-Job-Management/m-p/1277164#M60540</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Just asking a few hypothetical questions about using GUI_Exec() or GUI_Exec1() calls because I sometimes experience HardFaults when GUI_Exec() was called.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The below snippet is from emWin Manual (section 6.1.8.7.1):&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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();
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If WM_CreateWindow() and WM_CreateTimer() and others like GUI_FillRectEx() and GUI_DrawGradientV() were called 1000 times&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;prior to next GUI_Exec() call&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;will the job queues get compromised (overflow) or does that depend on my program settings like heap size or some other emWin setting?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will GUI_Exec1() call process entire WM_CreateWIndow() action or part of action? [See below]&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  hWin = WM_CreateWindow(10, 10, 100, 100, WM_CF_SHOW, _cbWin, 0);
  GUI_Exec1();
  hTimer = WM_CreateTimer(hWin, 0, 1000, 0);
  GUI_Exec1();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there a way to tell how many jobs need to be performed by GUI_Exec()?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lastly, what approaches do you recommend to avoid hardfaults when GUI_Exec() or GUI_Exec1() is called?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 May 2021 01:02:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/emWIN-GUI-Exec-and-Job-Management/m-p/1277164#M60540</guid>
      <dc:creator>lsrbigfoot</dc:creator>
      <dc:date>2021-05-15T01:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: emWIN: GUI_Exec() and Job Management</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/emWIN-GUI-Exec-and-Job-Management/m-p/1278116#M60560</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A id="link_9" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/13847" target="_self" aria-label="View Profile of lsrbigfoot"&gt;&lt;SPAN class=""&gt;lsrbigfoot&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;1. Yes, if you call&amp;nbsp;&lt;SPAN&gt;WM_CreateWindow 1000 times, it will cause hardfault. It is helpful to expand&amp;nbsp;s_gui_memory[] size. But 1000 times is too large anyway.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. Not clear what you mean. But you can do like this&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jingpan_0-1621328122808.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/144942i31730E66265705C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jingpan_0-1621328122808.png" alt="jingpan_0-1621328122808.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3. It seems there isn't any function can tell how many jobs left.&lt;/P&gt;
&lt;P&gt;4. I think enlarge the emWin buffer and call&amp;nbsp;&lt;SPAN&gt;GUI_Exec() more frequently is useful.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jing&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 09:07:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/emWIN-GUI-Exec-and-Job-Management/m-p/1278116#M60560</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2021-05-18T09:07:33Z</dc:date>
    </item>
  </channel>
</rss>

