<?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>CodeWarrior for MCUのトピックFunction Pointer</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Function-Pointer/m-p/160963#M4429</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working on&amp;nbsp; a small cooperative scheduler for a 9s08 project. The scheduler dynamically fills an array of structures with information for each task to be run by the scheduler. One of the pieces of data is a function pointer to the target task.&amp;nbsp; The&amp;nbsp;function pointer&amp;nbsp;definition in the struct looks like this:&amp;nbsp; &amp;nbsp; unsigned int (*pTask)();&lt;/P&gt;&lt;P&gt;The complier (CW Dev Studio V6.2) does not emit a peep during compile/link.&amp;nbsp; But, when running debug on the hardware and stepping through the function that is&amp;nbsp;supposed to pickup the functional pointer and launch&amp;nbsp;the function we investigate the structure at the point where the&amp;nbsp;code picks up the pointer and see:&amp;nbsp; "undefined function () returning unisgned int.&amp;nbsp;&amp;nbsp;Should the functional pointer in the&amp;nbsp;struct be declared as a __far since the target function is not in the local data area?&amp;nbsp; Any help would&amp;nbsp;be appreciated. Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Dec 2009 06:45:18 GMT</pubDate>
    <dc:creator>Skippy</dc:creator>
    <dc:date>2009-12-12T06:45:18Z</dc:date>
    <item>
      <title>Function Pointer</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Function-Pointer/m-p/160963#M4429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working on&amp;nbsp; a small cooperative scheduler for a 9s08 project. The scheduler dynamically fills an array of structures with information for each task to be run by the scheduler. One of the pieces of data is a function pointer to the target task.&amp;nbsp; The&amp;nbsp;function pointer&amp;nbsp;definition in the struct looks like this:&amp;nbsp; &amp;nbsp; unsigned int (*pTask)();&lt;/P&gt;&lt;P&gt;The complier (CW Dev Studio V6.2) does not emit a peep during compile/link.&amp;nbsp; But, when running debug on the hardware and stepping through the function that is&amp;nbsp;supposed to pickup the functional pointer and launch&amp;nbsp;the function we investigate the structure at the point where the&amp;nbsp;code picks up the pointer and see:&amp;nbsp; "undefined function () returning unisgned int.&amp;nbsp;&amp;nbsp;Should the functional pointer in the&amp;nbsp;struct be declared as a __far since the target function is not in the local data area?&amp;nbsp; Any help would&amp;nbsp;be appreciated. Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Dec 2009 06:45:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Function-Pointer/m-p/160963#M4429</guid>
      <dc:creator>Skippy</dc:creator>
      <dc:date>2009-12-12T06:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Function Pointer</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Function-Pointer/m-p/160964#M4430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thought I'd share this...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Definition of the function pointer as a struct&amp;nbsp;member:&lt;/P&gt;&lt;P&gt;typdef&amp;nbsp; ABC_T&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; void (*pTaskName)(void);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;}astruct_t;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, calling the function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(*astruct_t[Index].pTask)();&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Dec 2009 08:22:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Function-Pointer/m-p/160964#M4430</guid>
      <dc:creator>Skippy</dc:creator>
      <dc:date>2009-12-13T08:22:33Z</dc:date>
    </item>
  </channel>
</rss>

