Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Misleading configuration/symbol/macro names in "sdk_config.h"

I am running into compile errors in different places in the SDK where there are lines as shown below:

#if (NRF_BLE_GATT_ENABLED)
/* do something */
#endif

It is a widely and commonly accepted concept that names that end with _ENABLED signify a true or false value.

It is also common practice to use such names in preprocessing statements that primarily test for a definition of the symbol, and if and only if it is defined they use its numeric value such as indicated below:

#if defined(NRF_BLE_GATT_ENABLED) && (NRF_BLE_GATT_ENABLED == 1)
/* do something */
#if defined

The Nordic SDK convention is very confusing since it specifies names that end with the suffix _ENABLED yet do not work if I simply define them as a macro (no numeric values).

Can the SDK be improved to conform to common norms please?

Related