<?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: Problems using CodeWarrior in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293463#M10667</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Erich's solution will also work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bhavin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 07 Sep 2013 11:08:39 GMT</pubDate>
    <dc:creator>bhavinparmar</dc:creator>
    <dc:date>2013-09-07T11:08:39Z</dc:date>
    <item>
      <title>Problems using CodeWarrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293460#M10664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo everyone,&lt;/P&gt;&lt;P&gt;I have some problems using CodeWarrior.&lt;/P&gt;&lt;P&gt;For all my projects i have used Atmel Technology and the Atmel Studio. But for the next Project I have to use the MC9S12C32 EVB.&lt;/P&gt;&lt;P&gt;I use CodeWarrior IDE version 5.9.0 Build 5294.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After a few test i had several problems, with this IDE...&lt;/P&gt;&lt;P&gt;Could find the reason why my function was not working. The compiler ignored my prototypes... Don't know why but reentering them helped.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now there is the problem with the typedef enum.&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;//#include and #define //################################## prototype ######################### typedef enum {C=0, Cis=1, D=2, Es=3, E=4, F=5, Fis=6, G=7, Gis=8, A=9, Bs=10, B=11} TONE;&amp;nbsp; void myinit(void); void initTone(void); void playFrequency(unsigned int); void playTone(TONE);&amp;nbsp; // ################################## main ############################# void main(void) { &amp;nbsp;&amp;nbsp;&amp;nbsp; myinit(); &amp;nbsp;&amp;nbsp;&amp;nbsp; initTone(); &amp;nbsp;&amp;nbsp;&amp;nbsp; TONE mytone = A; //this does not work &amp;nbsp;&amp;nbsp;&amp;nbsp; while(1) &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; playTone(mytone); &amp;nbsp;&amp;nbsp;&amp;nbsp; } }&amp;nbsp;&amp;nbsp; //re//r&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;It is not working in main.c or if i try to import the typedef enum from a headerfile. Is there a special position where it has to be placed? Can someone help me with that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 22:15:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293460#M10664</guid>
      <dc:creator>bastianschoettn</dc:creator>
      <dc:date>2013-09-06T22:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problems using CodeWarrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293461#M10665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bastian,&lt;/P&gt;&lt;P&gt;in C you cannot place variable anywhere inside the code (you can do this in C++).&lt;/P&gt;&lt;P&gt;Move the mytone variable definition to the start of a block (beginning with '{'):&lt;/P&gt;&lt;OL class="dp-cpp" start="1"&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;void main(&lt;SPAN class="keyword"&gt;void&lt;/SPAN&gt;)&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;{&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;TONE mytone = A; &lt;SPAN class="comment"&gt;//this will work&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;...&lt;SPAN class="comment"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Then this should work.&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Sep 2013 10:36:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293461#M10665</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2013-09-07T10:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problems using CodeWarrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293462#M10666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Bastian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef enum {C=0, Cis=1, D=2, Es=3, E=4, F=5, Fis=6, G=7, Gis=8, A=9, Bs=10, B=11} TONE; &lt;/P&gt;&lt;P&gt;TONE mytone;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;void myinit(void);&amp;nbsp; &lt;/P&gt;&lt;P&gt;void initTone(void);&amp;nbsp; &lt;/P&gt;&lt;P&gt;void playFrequency(unsigned int);&amp;nbsp; &lt;/P&gt;&lt;P&gt;void playTone(TONE);&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void MCU_init(void); /* Device initialization function declaration */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void main(void) &lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCU_init(); /* call Device Initialization */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; myinit();&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; initTone();&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mytone = A; //this does not work&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(1)&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; playTone(mytone);&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you have to declare variable outside the function as you have taken it as globle variable&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Sep 2013 11:07:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293462#M10666</guid>
      <dc:creator>bhavinparmar</dc:creator>
      <dc:date>2013-09-07T11:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problems using CodeWarrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293463#M10667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Erich's solution will also work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bhavin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Sep 2013 11:08:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293463#M10667</guid>
      <dc:creator>bhavinparmar</dc:creator>
      <dc:date>2013-09-07T11:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problems using CodeWarrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293464#M10668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks my bad, placing the variable at the wrong place...&lt;/P&gt;&lt;P&gt;I created and tested my code in CodeBlocks, where it was absolutely fine. I am not used to C anymore so the gcc compiler did that job me.&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;Bastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Sep 2013 23:19:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Problems-using-CodeWarrior/m-p/293464#M10668</guid>
      <dc:creator>bastianschoettn</dc:creator>
      <dc:date>2013-09-07T23:19:06Z</dc:date>
    </item>
  </channel>
</rss>

