The role of the header file : the header file mainly includes the declaration of the function, the macro definition structure, etc., and the definition of the header file can be directly called, and it is not necessary to know how the functions are implemented. For example: #include <ioCC2530.h>, to call this header file can directly use the port number, CC2530 registers, basic keywords of C language, etc. (Generally, official header files use < > to call, custom header files use " " to call )
The function of define macro definition:
Give a variable or a port an alias, for example, give an alias to the port corresponding to the LED and button SW1;
Macro defines functions with and without parameters for easy calling; (#define PRINT(Val) printf(#Val " = %d\n", Val) )
Conditional compilation , how to define this header file to perform corresponding operations such as &#x