Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#16 migrating from IAR to mspgcc

closed
nobody
None
5
2008-06-20
2008-05-30
Bruno Garcia
No

hi, i was compiling my code with msp430-gcc and i had the following errors :

C:\mspgcc\bin>msp430-gcc -mmcu=msp430x1232 spin22.c
spin22.c: In function `coluna1':
spin22.c:210: `P1OUT_bit' undeclared (first use in this function)
spin22.c:210: (Each undeclared identifier is reported only once
spin22.c:210: for each function it appears in.)
spin22.c:217: `P2OUT_bit' undeclared (first use in this function)
spin22.c: In function `coluna2':
spin22.c:222: `P2OUT_bit' undeclared (first use in this function)
spin22.c:223: `P3OUT_bit' undeclared (first use in this function)
spin22.c: In function `init_iopins':
spin22.c:540: `P1OUT_bit' undeclared (first use in this function)
spin22.c:547: `P2OUT_bit' undeclared (first use in this function)
spin22.c:549: `P3OUT_bit' undeclared (first use in this function)

p1out_bit is the hardware pin as well p2 and p3, they are declared like

#define LED1 P1OUT_bit.P1OUT_7
#define LED2 P1OUT_bit.P1OUT_6
#define LED3 P1OUT_bit.P1OUT_5
#define LED4 P1OUT_bit.P1OUT_4
#define LED5 P1OUT_bit.P1OUT_3
#define LED6 P1OUT_bit.P1OUT_2
#define LED7 P1OUT_bit.P1OUT_0

#define LED8 P2OUT_bit.P2OUT_4
#define LED9 P2OUT_bit.P2OUT_3

#define LED10 P3OUT_bit.P3OUT_7
#define LED11 P3OUT_bit.P3OUT_6
#define LED12 P3OUT_bit.P3OUT_5
#define LED13 P3OUT_bit.P3OUT_4
#define LED14 P3OUT_bit.P3OUT_3
#define LED15 P3OUT_bit.P3OUT_2
#define LED16 P3OUT_bit.P3OUT_1
#define LED17 P3OUT_bit.P3OUT_0

#define LED18 P2OUT_bit.P2OUT_1

#define SENSOR P2IN_bit.P2IN_0

NOTE : I'm using only <io.h> and <stdlib.h> includes

Thank you

Discussion

  • Bruno Garcia
    Bruno Garcia
    2008-05-30

    Logged In: YES
    user_id=2101064
    Originator: YES

    consider the spaces at define structure #define LED1 P1OUT_bit.P1OUT_7

     
  • Chris Liechti
    Chris Liechti
    2008-06-20

    • status: open --> closed