This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How do you "turn on" a file with a "_H" compiler directive?

There aer a couple of ifles in the SDK that use this weird _H compiler directive that prevents them from compiling - how do you control those? For example, NRF_SORTLIST_H, or CRC32_H? seems to be related to the NRF_MODULE_ENABLED() macro.

Parents
  • These are header guards, they prevent the compiler from compiling a header file more than once. F.ex. if two source files both includes the same header file the header guard prevents multiple declarations and definitions of functions, variables, constants, structs, etc. 

    There's nothing you need to do except enable the libraries and drivers you need in sdk_config.h. 

Reply
  • These are header guards, they prevent the compiler from compiling a header file more than once. F.ex. if two source files both includes the same header file the header guard prevents multiple declarations and definitions of functions, variables, constants, structs, etc. 

    There's nothing you need to do except enable the libraries and drivers you need in sdk_config.h. 

Children
No Data
Related