<?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: macro declaration in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150287#M2041</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There was actually a further level of macro nesting used.&amp;nbsp; PTED_PTED0﻿ is also a macro&amp;nbsp;that defines an element of a bit field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jul 2011 15:09:56 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2011-07-22T15:09:56Z</dc:date>
    <item>
      <title>macro declaration</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150282#M2036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I compile my C coding, there was an error that C2801: ' ; ' &amp;nbsp;missing. The codes are as follows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define &amp;nbsp; &amp;nbsp; FAN_LOWSPEED_OFF() &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PTDDD_PTDDD5 = 1;\ &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IO_vResetPin(PTED_PTED0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know much about the macro declaration. Is there anything wrong with my codes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas about dealing with my errors?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks much for your replies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 09:17:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150282#M2036</guid>
      <dc:creator>ustcsnaker</dc:creator>
      <dc:date>2011-07-15T09:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: macro declaration</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150283#M2037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am missing some context information in order to answer properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But as far as I can tell IO_vResetPin is a function you are invoking,&lt;/P&gt;&lt;P&gt;I would first try to add a semicolon at the end of &amp;nbsp;IO_vResetPin(PTED_PTED0)﻿.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that does not help generate the preprocessor listing for the source file and inspect the code at the location where the macro is expanded.&lt;/P&gt;&lt;P&gt;This might give you a clue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 15:37:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150283#M2037</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2011-07-15T15:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: macro declaration</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150284#M2038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;CrasyCat wrote:&lt;BR /&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am missing some context information in order to answer properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But as far as I can tell IO_vResetPin is a function you are invoking,&lt;/P&gt;&lt;P&gt;I would first try to add a semicolon at the end of &amp;nbsp;IO_vResetPin(PTED_PTED0)﻿.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that does not help generate the preprocessor listing for the source file and inspect the code at the location where the macro is expanded.&lt;/P&gt;&lt;P&gt;This might give you a clue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;CrasyCat wrote:&lt;BR /&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am missing some context information in order to answer properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But as far as I can tell IO_vResetPin is a function you are invoking,&lt;/P&gt;&lt;P&gt;I would first try to add a semicolon at the end of &amp;nbsp;IO_vResetPin(PTED_PTED0)﻿.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that does not help generate the preprocessor listing for the source file and inspect the code at the location where the macro is expanded.&lt;/P&gt;&lt;P&gt;This might give you a clue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks very much,&amp;nbsp;CrasyCat﻿.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've worked it out. In fact,&amp;nbsp;IO_vResetPin(﻿) is also a macro decfinition.The codes are as follows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define &amp;nbsp; &amp;nbsp;IO_vResetPin(PinName) &amp;nbsp; &amp;nbsp; &amp;nbsp;PinName = 0﻿&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used&amp;nbsp;PTED_PTED0﻿ = 0 instead of &amp;nbsp;IO_vResetPin(PTED_PTED0)﻿﻿. And as you said, I added a semicolon at the end of﻿&amp;nbsp;&lt;/P&gt;&lt;P&gt;PTED_PTED0﻿ = 0﻿. It was ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if codewarrior doesn't support &amp;nbsp;macro definition nesting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks very much for your replies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jul 2011 11:33:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150284#M2038</guid>
      <dc:creator>ustcsnaker</dc:creator>
      <dc:date>2011-07-16T11:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: macro declaration</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150285#M2039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CodeWarrior supports nested macros.&lt;/P&gt;&lt;P&gt;But you need to make sure the macro IO_vResetPin is defined prior to FAN_LOWSPEED_OFF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally when you have parameter inside of macros it is&amp;nbsp; a good practice to enclose the parameter name in parenthesis&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #define &amp;nbsp; &amp;nbsp;IO_vResetPin(PinName) &amp;nbsp; &amp;nbsp; &amp;nbsp;(PinName) = 0﻿&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As general note when you are using macros in an ANSI C module, if you get into trouble, check the preprocessor listing.&lt;/P&gt;&lt;P&gt;This listing will show you how the preprocessor expands the various macros and will allow you to detect any&amp;nbsp;error using the macros.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2011 15:34:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150285#M2039</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2011-07-18T15:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: macro declaration</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150286#M2040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class="lia-spoiler-container"&gt;&lt;A class="lia-spoiler-link" href="http://forums.freescale.com/#" rel="nofollow"&gt;Spoiler&lt;/A&gt;&lt;NOSCRIPT&gt;(Highlight to read)&lt;/NOSCRIPT&gt;&lt;DIV class="lia-spoiler-border"&gt;&lt;DIV class="lia-spoiler-content"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;NOSCRIPT&gt;&lt;DIV class="lia-spoiler-noscript-container"&gt;&lt;DIV class="lia-spoiler-noscript-content"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/NOSCRIPT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Thank you very much, CrasyCat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope to get your help if I have problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ustcsnaker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 07:55:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150286#M2040</guid>
      <dc:creator>ustcsnaker</dc:creator>
      <dc:date>2011-07-20T07:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: macro declaration</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150287#M2041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There was actually a further level of macro nesting used.&amp;nbsp; PTED_PTED0﻿ is also a macro&amp;nbsp;that defines an element of a bit field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2011 15:09:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150287#M2041</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2011-07-22T15:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: macro declaration</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150288#M2042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You are right. So, CrasyCat is also right.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jul 2011 12:22:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/macro-declaration/m-p/150288#M2042</guid>
      <dc:creator>ustcsnaker</dc:creator>
      <dc:date>2011-07-23T12:22:59Z</dc:date>
    </item>
  </channel>
</rss>

