Error during multiline macro

Discussion in 'General Electronics Chat' started by aamirali, Sep 22, 2012.

  1. aamirali

    Thread Starter Member

    Feb 2, 2012
    415
    1
    1. I am using keilbut it shows error
    :
    #define inital { LPC_IOCON->PIO1_13 = 0x00000080; \
    LPC_IOCON->PIO1_14 = 0x00000080; \
    LPC_IOCON->PIO1_15 = 0x00000080; \
    LPC_IOCON->PIO1_16 = 0x00000080; \

    LPC_IOCON->PIO1_19 = 0x00000080; \
    LPC_IOCON->PIO1_20 = 0x00000080; \
    LPC_IOCON->PIO1_21 = 0x00000080; \
    LPC_IOCON->PIO1_22 = 0x00000080; \
    LPC_IOCON->PIO1_23 = 0x00000080; \
    LPC_IOCON->PIO1_24 = 0x00000080; \
    LPC_IOCON->PIO1_25 = 0x00000080; \
    LPC_IOCON->PIO1_26 = 0x00000080; \

    LPC_GPIO->DIR[tft_data_port] |= 0x07F9E000; \
    }

    2. Also how to write no in binary in keil,
    like
    int a=0x16; hexa
    int a = 043; octa

    How to write in binary
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    Good lord, what are you trying to do? Is this intended to be an array, a structure, an enumeration, or some other beast?

    "LPC_IOCON->PIO1_13" means LPC_IOCON is a pointer to a structure where PIO1_24 is an element.

    And do you really intend just about everything to equal 0x80?

    Code ( (Unknown Language)):
    1.  
    2. int a = 0b1010101010101010;
     
Loading...