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.
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.
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.
Are you referring to the include guards? We use include guards like these in pretty much every header file in the SDK. E.g. like this in nrf_sortlist.h:
#ifndef NRF_SORTLIST_H #define NRF_SORTLIST_H .... #endif //NRF_SORTLIST_H
OK, I'm clearly barking up the wrong tree. How do you get crc32_compute(...) to compile? In other words, how do you get NRF_MODULE_ENABLED(CRC32) to resolve true? Or NRF_MODULE_ENABLED(NRF_SORTLIST)?
Have you enabled them in sdk_config.h?
By that you mean set CRC32_ENABLED and NRF_SORTLIST_ENABLED to 1 - yes, of course.