<?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: main not defined (?) in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/main-not-defined/m-p/148742#M3483</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok... I cleaned up some of the source code and header files, and the problem went away. Still unsure what was causing it though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jul 2011 23:10:23 GMT</pubDate>
    <dc:creator>AirDragon</dc:creator>
    <dc:date>2011-07-12T23:10:23Z</dc:date>
    <item>
      <title>main not defined (?)</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/main-not-defined/m-p/148741#M3482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;well, after I managed to get past the problem with the vector tables, I somehow borked the files somewhere so that now the compiler doesn't recognize main.c as being, well, main.c. It instead thinks its some sort of header file. (!?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reason I believe this to be so, is that when I try to compile the project, it gives me the error "; not found" and then immediately after a hole bunch of errors that don't make any right sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is a snippet of the main function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I apologize in advance for not being 100% ISO complient... I've never had a class over C&amp;nbsp;nor had a need to make a C program. I did have two&amp;nbsp;C++ classes which really where not that in depth at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#include &amp;lt;hidef.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // common defines and macros#include "derivative.h" // derivative-specific definitions#include "MCUinit.h"&amp;nbsp;&amp;nbsp;&amp;nbsp; // device initialization and ISRs#include &amp;lt;math.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // ANSI and IEEE math library//#include "main_asm.h" // interface to the assembly module#include "AD_ATD.h"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // ATD conversion &amp;amp; cleaning functions#include "AD_Math.h"#include "AD_Pilot.h"#include "AD_PWM.h"#include "AD_TIM.h"#include "RazorIMU.h"/* Global Variables */unsigned char OSflags;const unsigned short DTYOFF&amp;nbsp; =&amp;nbsp;&amp;nbsp; 900;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This is used to make the motor spin at or above 1.0ms.const unsigned short DTYIDLE =&amp;nbsp; 1000;&amp;nbsp;&amp;nbsp;&amp;nbsp; //0% throttle = 1.000ms const unsigned short DTYFULL =&amp;nbsp; 2000;&amp;nbsp;&amp;nbsp;&amp;nbsp; //100% throttle = 2.000ms (hopefully)const unsigned short PER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 20000;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Frame rate = 50Hz, 20ms period /* Global Functions */void MCU_init(void);&amp;nbsp;&amp;nbsp;&amp;nbsp; // Device initialization function declaration/* System Program and Flight Path administration */void main(void){&amp;nbsp; MCU_init();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // call Device Initialization//Wait a bit to allow the ADC to stabilize&amp;nbsp; OpenPilot();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wake up the AutoPilot&amp;nbsp;&amp;nbsp;&amp;nbsp; TakeOff();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Takeoff from current position&amp;nbsp; ThrottleToPWM(HeightToThrottle(136));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Set throttle to achieve 136cm (hopefully)&amp;nbsp;&amp;nbsp;&amp;nbsp; WaitSec(30);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Wait for 30 seconds&amp;nbsp;&amp;nbsp;&amp;nbsp; Land();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Shutdown motors//asm_main(); /* call the assembly function */&amp;nbsp; for(;;) {&amp;nbsp;&amp;nbsp;&amp;nbsp; // _FEED_COP();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // by default, COP is disabled with device init. When enabling, be sure to also reset the watchdog.&amp;nbsp; } // loop forever&amp;nbsp;&amp;nbsp; // please make sure that you never leave main, otherwise you might run into unmapped areas of memory... or worse!&amp;nbsp; return 0; //Just to make the compiler happy}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Any&lt;/SPAN&gt; suggestions of course would be helpful.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:50:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/main-not-defined/m-p/148741#M3482</guid>
      <dc:creator>AirDragon</dc:creator>
      <dc:date>2020-10-29T08:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: main not defined (?)</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/main-not-defined/m-p/148742#M3483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok... I cleaned up some of the source code and header files, and the problem went away. Still unsure what was causing it though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 23:10:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/main-not-defined/m-p/148742#M3483</guid>
      <dc:creator>AirDragon</dc:creator>
      <dc:date>2011-07-12T23:10:23Z</dc:date>
    </item>
  </channel>
</rss>

