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
  • #define BEGIN {
    #define END }
    #define IF if (
    #define THEN ) {
    
    BEGIN
      IF a > 10 THEN
        ...
      END
    END
    

    A preprocessor is very powerful, which means that you must always think twice about how you use it. Too much clever use will often result in unhappy faces at a later stage of the sw lifespan.

Reply
  • #define BEGIN {
    #define END }
    #define IF if (
    #define THEN ) {
    
    BEGIN
      IF a > 10 THEN
        ...
      END
    END
    

    A preprocessor is very powerful, which means that you must always think twice about how you use it. Too much clever use will often result in unhappy faces at a later stage of the sw lifespan.

Children