This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Variable mapping to address

Hello,
I use uVision IDE and arm-gcc toolchain for my lpc2129 board.I mapped the CAN standard filters to an area in memory:

#define StandardFilter[2] (*((volatile unsigned long *) 0xE0038000));

However in my main program the follwing syntax seems to be incorrect:

StandardFilter[0]  =       0x20012002;//this is line no.57
StandardFilter[1]       =       0x20032004;


because the compiler throws the following error:
CAN_RX.c(57): error: parse error before '[' token

Could someone tell me what the correct syntax is?
Thank you.

Parents
  • No.

    "as per C conventions?"

    Look again at Per's previous post: the Preprocessor is entirely independent of the 'C' language - a #define is not a 'C' statement.

    That was, in fact, exactly the point that I was making in the link that I gave; have a look again:
    www.8052.com/.../29152
    - it's standard 'C' stuff, nothing specifically to do with 8051, ARM, or Keil.

    You could, if you wanted, have:

    #define SEMICOLON ;
    

    think about it...

Reply
  • No.

    "as per C conventions?"

    Look again at Per's previous post: the Preprocessor is entirely independent of the 'C' language - a #define is not a 'C' statement.

    That was, in fact, exactly the point that I was making in the link that I gave; have a look again:
    www.8052.com/.../29152
    - it's standard 'C' stuff, nothing specifically to do with 8051, ARM, or Keil.

    You could, if you wanted, have:

    #define SEMICOLON ;
    

    think about it...

Children