<?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: Troubles with codewarrior 5.1 giving error 2801 when using a freescale define in a macro? in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245241#M9596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ensure that you haven't set the compiler to compile as strict C standard. The CW register headers use various non-standard and poorly-defined bit field features that a standard compiler will get problems compiling.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Aug 2013 08:43:15 GMT</pubDate>
    <dc:creator>Lundin</dc:creator>
    <dc:date>2013-08-08T08:43:15Z</dc:date>
    <item>
      <title>Troubles with codewarrior 5.1 giving error 2801 when using a freescale define in a macro?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245239#M9594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone had troubles with codewarrior 5.1 giving error 2801 when using a freescale define in a macro?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Including header file "mc9s12A64.h".&lt;/P&gt;&lt;P&gt;Using its #define for "PORTA_BIT3" which defines "_PORTAB.Overlap_STR.PORTASTR.Bits.BIT3"&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created macros to turn the bit ON or OFF as follows&lt;/P&gt;&lt;P&gt;#define LED_ON&amp;nbsp; (_PORTA_BIT3 = 1)&lt;/P&gt;&lt;P&gt;#define LED_OFF (_PORTA_BIT3 = 0)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using this creates the error C2801.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change the macros to&lt;/P&gt;&lt;P&gt;#define&amp;nbsp; LED_ON&amp;nbsp;&amp;nbsp; (PORTA = PORTA |&amp;nbsp; PORTA_BIT3_MASK)&lt;/P&gt;&lt;P&gt;#define&amp;nbsp; LED_OFF&amp;nbsp; (PORTA = PORTA &amp;amp; ~PORTA_BIT3_MASK)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where the header file defines PORTA to be "_PORTAB.Overlap_STR.PORTASTR.Byte", it compiles correctly.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same problem occurs if you want to test a port pin&lt;/P&gt;&lt;P&gt;#define READ_BIT1&amp;nbsp; (PORTA_BIT1 == 1)&amp;nbsp; // error&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;#define READ_BIT1 ((PORTA &amp;amp; PORTA_BIT1_MASK) == 1)&amp;nbsp; // ok&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only difference between the 2 methods is the last few chars in the defines. Either ".Bits.BIT3" or ".Byte".&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume that either method would produce the same code but the first method is nicer and easier to do.&lt;/P&gt;&lt;P&gt;Anyone got any ideas or solutions???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 00:01:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245239#M9594</guid>
      <dc:creator>electropw</dc:creator>
      <dc:date>2013-08-08T00:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with codewarrior 5.1 giving error 2801 when using a freescale define in a macro?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245240#M9595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just tested your code on my side with CW5.1 i didn't see any error come out. can you please upload your demo project here so that we can check it directly? thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 02:40:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245240#M9595</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2013-08-08T02:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with codewarrior 5.1 giving error 2801 when using a freescale define in a macro?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245241#M9596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ensure that you haven't set the compiler to compile as strict C standard. The CW register headers use various non-standard and poorly-defined bit field features that a standard compiler will get problems compiling.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2013 08:43:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245241#M9596</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2013-08-08T08:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with codewarrior 5.1 giving error 2801 when using a freescale define in a macro?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245242#M9597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Phillip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any breakthrough with your project? Please keep us posted :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Monica,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 01:00:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245242#M9597</guid>
      <dc:creator>Monica</dc:creator>
      <dc:date>2013-08-14T01:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with codewarrior 5.1 giving error 2801 when using a freescale define in a macro?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245243#M9598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone.&lt;/P&gt;&lt;P&gt;Sorry it's taken me a while to come back to you, but had to get some other work out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately I have gotten no further other than to say the problem must be in my project somewhere.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a new project to show the issue but as Zhang-Jennie found it didn't show.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried setting up all my compiler options to match and it made no difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'll have to let it rest for now until I find the problem. When I do I'll let you know what it was.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 02:33:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245243#M9598</guid>
      <dc:creator>electropw</dc:creator>
      <dc:date>2013-08-14T02:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with codewarrior 5.1 giving error 2801 when using a freescale define in a macro?</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245244#M9599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No not set to strict C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 02:35:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Troubles-with-codewarrior-5-1-giving-error-2801-when-using-a/m-p/245244#M9599</guid>
      <dc:creator>electropw</dc:creator>
      <dc:date>2013-08-14T02:35:55Z</dc:date>
    </item>
  </channel>
</rss>

