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

apply_old_config.h not working as expected?

Hi guys,

I'm currently using SDK 15.0.0 in Keil MDK and making use of the new NRFX drivers.

Similar to the issue detailed here: https://devzone.nordicsemi.com/f/nordic-q-a/34052/nrf52-sdk-15-0-issue-legacy-driver-layer-upgrade-to-new-nrfx-driver-layer, when I attempt to enable NRFX drivers, apply_old_config.h is overriding the behaviour and disabling them.

My assumption would have been that if I have the legacy driver enabled, it'll override the settings, but if it's not enabled, it shouldn't do anything, but that's not what's happening. For example, in my project I have:

#define UART_ENABLED 0
#define TWI_ENABLED 0

However the following statements when compiled, are coming out as true and overriding my settings (this is contrary to what Keil's clang code-completion thinks):

#if defined(UART_ENABLED)
#if defined(TWI_ENABLED)

I've found a temporary workaround of simply removing the defined() so:

#if UART_ENABLED
#if TWI_ENABLED

I think maybe apple_old_config.h needs revisiting in the next SDK to fix this issue or am I missing something?

Many thanks

Related