Errors about the macro defination and header files -


i'm working on project based on msp430 microchip, using iar compiler. here simplified problem:

in project have 3 files:

in clock.h:

#define mclk_8mhz void clk_init(void); 

in clock.c:

#include "clock.h" void clk_init(void) {     #ifdef mclk_8mhz         #define delay_ms(x) __delay_cycles((long)(1000000*(double)x/1000.0))       #endif     #ifdef mclk_12mhz         ...     #endif } 

in main.c:

#include "clock.h" clk_init(); delay_ms(5); 

and compiler function "delay_ms" declared implicitly

i think mistook delay_ms() function instead of macro. sure define real function. thought damage accuracy of time controlling.

how solve problem?

do need quotes around include in main.c like:

#include "clock.h" 

?

if warning, it's else.


Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

How to mention the localhost in android -

php - Calling a template part from a post -