Couple of things.

First when sending source do it as an attachment so it doesn't get mangled.

lose the #include <msp430g2231.h> and replace it with #include <msp430.h>

See if that helps.

The command line will cause the right thing to happen when you say
-mmcu=msp430g2231.



On Thu, Sep 27, 2012 at 6:09 PM, Brian Gorman <brianf...@gmail.com> wrote:

> I am trying to compile this:
>
> //MSP430 Annoyatron
> //Brian Gorman 2011
>
> #include <msp430g2231.h>
> int i=3D0;
> void main(void)
> {
>   WDTCTL =3D WDTPW + WDTHOLD;                 // Stop WDT
>   P1DIR |=3D 0x32;                            // P1.5 output
>   CCTL0 =3D CCIE;                             // CCR0 interrupt enabled
>   CCR0 =3D 32767;
>   TACTL =3D TASSEL_1 + MC_1;                  // ACLK, upmode
>   P1OUT =3D 0x00;
>   int flow=3D0;
>   int delays[]=3D {59,531,259,472,118,59,177,354,177};
>   while(1)
>   {
>     if (i>(delays[flow]))
>     {
>       P1OUT ^=3D 0x32;                            // Toggle P1.5
>       long z =3D 65000;                            // Delay
>       do (z--);
>       while (z !=3D 0);
>       P1OUT ^=3D 0x32;
>       i=3D0;
>       if (flow>9)
>       flow=3D0;
>       else
>       flow++;
>     }
>     _BIS_SR(LPM3_bits + GIE);                 // Enter LPM3 w/ interrupt
>   }
> }
>
> // Timer A0 interrupt service routine
> #pragma vector=3DTIMERA0_VECTOR
> __interrupt void Timer_A (void)
> {
>  i++;
>  _BIC_SR_IRQ(LPM3_bits);
> }
>
> I get the following error:
>
> brian@brian-Lenovo-U310:~/Downloads/launchpad$ msp430-gcc
> -mmcu=3Dmsp430g22=
> 31
> -Os -o main.elf main.c
> main.c:38:13: error: expected =91=3D=92, =91,=92, =91;=92, =91asm=92 or
> =91=
> __attribute__=92
> before =91void=92
>
> gcc version 4.5.3 (GNU GCC patched mspgcc-20110716)
>
> Can anyone help me out getting this to compile?
>
>
> ------------------------------------------------------------------------------
> Got visibility?
> Most devs has no idea what their production app looks like.
> Find out how fast your code is with AppDynamics Lite.
> http://ad.doubleclick.net/clk;262219671;13503038;y?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>


-- 
Eric B. Decker
Senior (over 50 :-) Researcher
------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to