<?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>topic Re: When I try to pass arguments in a function it does not work properly? in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/When-I-try-to-pass-arguments-in-a-function-it-does-not-work/m-p/501843#M12762</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tx_Frame_Type is declared as "unsigned char" and is global variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using Codewarrior IDE v5.9.0.&lt;/P&gt;&lt;P&gt;The processor being used is "MC9S12C128".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try to define Tx_Frame_Type as volatile - just for confirmation - the syntax for this would be as follows:&lt;/P&gt;&lt;P&gt;volatile unsigned char Tx_Frame_Type = 0;&amp;nbsp;&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Dec 2015 18:14:49 GMT</pubDate>
    <dc:creator>jessemayfield</dc:creator>
    <dc:date>2015-12-23T18:14:49Z</dc:date>
    <item>
      <title>When I try to pass arguments in a function it does not work properly?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/When-I-try-to-pass-arguments-in-a-function-it-does-not-work/m-p/501841#M12760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a function declared as follows:&lt;/P&gt;&lt;P&gt;void Build_API_Tx_Frame ( unsigned char frame_type, unsigned char *payload, unsigned char, payload_size);&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;Tx_Frame_Type = frame_type;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;No need to type the rest&amp;nbsp; of the function here...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I call this function in my main routine, Tx_Frame_Type does not get passed correctly, it retains a value of zero when I step through in the debugger.&lt;/P&gt;&lt;P&gt;The other arguments being passed, *payload, and payload_size are passing and updating as expected.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2015 04:27:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/When-I-try-to-pass-arguments-in-a-function-it-does-not-work/m-p/501841#M12760</guid>
      <dc:creator>jessemayfield</dc:creator>
      <dc:date>2015-12-23T04:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: When I try to pass arguments in a function it does not work properly?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/When-I-try-to-pass-arguments-in-a-function-it-does-not-work/m-p/501842#M12761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jesse,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the toll version used and the architecture (device) ?&lt;/P&gt;&lt;P&gt;For my understanding it should be linked to an optimization.&lt;/P&gt;&lt;P&gt;Can you check how the Tx_Frame_Type variable is declared ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - is it global function or local one ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - can you try to defined it as volatile ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in some case the volatile keyword breaks the optimization&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Pascal&lt;BR /&gt;NXP Technical Support&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2015 12:44:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/When-I-try-to-pass-arguments-in-a-function-it-does-not-work/m-p/501842#M12761</guid>
      <dc:creator>trytohelp</dc:creator>
      <dc:date>2015-12-23T12:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: When I try to pass arguments in a function it does not work properly?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/When-I-try-to-pass-arguments-in-a-function-it-does-not-work/m-p/501843#M12762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tx_Frame_Type is declared as "unsigned char" and is global variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using Codewarrior IDE v5.9.0.&lt;/P&gt;&lt;P&gt;The processor being used is "MC9S12C128".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try to define Tx_Frame_Type as volatile - just for confirmation - the syntax for this would be as follows:&lt;/P&gt;&lt;P&gt;volatile unsigned char Tx_Frame_Type = 0;&amp;nbsp;&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2015 18:14:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/When-I-try-to-pass-arguments-in-a-function-it-does-not-work/m-p/501843#M12762</guid>
      <dc:creator>jessemayfield</dc:creator>
      <dc:date>2015-12-23T18:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: When I try to pass arguments in a function it does not work properly?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/When-I-try-to-pass-arguments-in-a-function-it-does-not-work/m-p/501844#M12763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if Tx_Frame_Type is global variable, I suggest you add it to ENTRIES section in prm file to avoid optimization. see how does it work?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/36648iBF30393DD185CFAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Dec 2015 07:13:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/When-I-try-to-pass-arguments-in-a-function-it-does-not-work/m-p/501844#M12763</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2015-12-24T07:13:48Z</dc:date>
    </item>
  </channel>
</rss>

