Error during multiline macro

Thread Starter

aamirali

Joined Feb 2, 2012
412
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
 

ErnieM

Joined Apr 24, 2011
8,376
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; \
}
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?

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

How to write in binary
Rich (BB code):
int a = 0b1010101010101010;
 
Top