Using Defines in PropGCC
Monotoba
Posts: 9
My understanding of the define directives in C is that it is used to create a name for a numerical, character, or string constant. That constant can then be used in the program code. Yet I seem to be getting odd errors when using defines. Here's an example:
#define SIGNAL_WIDTH 500
/**
* wrStrobe()
* Strobes the write control line on the
* TFTLCD device.
*/
void wrStrobe(void){
DIRA |= (1 << WR_PIN);
OUTA &= ~(1 << WR_PIN);
waitcnt(CLKFREQ/SIGNAL_WIDTH + CNT);
OUTA |= 1 << WR_PIN;
}
This code will give the following error: ... error: expected ')' before ';' token
This error occurs on the waitcnt line. Changing SIGNAL_WIDTH to 500 removes the error and the application compiles.
Can someone explain to me why this occurs?
Thanks for your help.
#define SIGNAL_WIDTH 500
/**
* wrStrobe()
* Strobes the write control line on the
* TFTLCD device.
*/
void wrStrobe(void){
DIRA |= (1 << WR_PIN);
OUTA &= ~(1 << WR_PIN);
waitcnt(CLKFREQ/SIGNAL_WIDTH + CNT);
OUTA |= 1 << WR_PIN;
}
This code will give the following error: ... error: expected ')' before ';' token
This error occurs on the waitcnt line. Changing SIGNAL_WIDTH to 500 removes the error and the application compiles.
Can someone explain to me why this occurs?
Thanks for your help.
Comments
Must be a Safari bug
The one that doesn't take forever to load pages I can live without _ given that trade-off.