NRFX_CHECK(NRFX_SAADC_ENABLED) doesn't find NRFX_SAADC_ENABLED although set to "1" in sdk_config.h (SDK_17.0.2)

I am trying to add A/D conversion to my project which is a modified version of the ble_peripheral/ble_app_uart/pca10040e example.

I have:

- Added "nrfx_saadc.c" to the "nRF_Drivers" group

- Added #include "nrf_drv_saadc.h" to my main.c

- Used "CMSIS_Configuration_Wizard" to enable the "nrfx_saadc" in sdk_config.h

But still the #if NRFX_CHECK(NRFX_SAADC_ENABLED)  in nrfx_saadc.c thinks that the A/D converter is not enabled.

I have checked how it's done in the  examples/peripheral/saadc/pca10040e project and there the NRFX_CHECK(NRFX_SAADC_ENABLED) thinks that the A/D converter is enabled.

The actual part in my sdk_config.h looks like this:

// <e> NRFX_SAADC_ENABLED - nrfx_saadc - SAADC peripheral driver
//==========================================================
#ifndef NRFX_SAADC_ENABLED
#define NRFX_SAADC_ENABLED 1
#endif

- What am I supposed to do to make the NRFX_CHECK(NRFX_SAADC_ENABLED)  in nrfx_saadc.c think that I have enabled the adc module?

Parents
  • Hello,

    Please check if you have the legacy definition "SAADC_ENABLED" set to '0' in your sdk_config.h. If you do, then that will cause apply_old_config.h to override your NRFX_SAADC_ENABLED value

    Excerpt from the Migration guide for nrfx drivers:

    Continue using nrf_drv drivers

    If you want to continue using the nrf_drv drivers, no changes are required. You can use the drivers as before, but without taking advantage of any new functionalities introduced to the nrfx drivers.

    The old configuration entries are translated to the new NRFX_* format in the apply_old_config.h file located in integration/nrfx/legacy. In case you continue using the nrf_drv drivers, if you use any of the new NRFX_* entries in your configuration file that also contains old entries, the old entry settings take precedence.

Reply
  • Hello,

    Please check if you have the legacy definition "SAADC_ENABLED" set to '0' in your sdk_config.h. If you do, then that will cause apply_old_config.h to override your NRFX_SAADC_ENABLED value

    Excerpt from the Migration guide for nrfx drivers:

    Continue using nrf_drv drivers

    If you want to continue using the nrf_drv drivers, no changes are required. You can use the drivers as before, but without taking advantage of any new functionalities introduced to the nrfx drivers.

    The old configuration entries are translated to the new NRFX_* format in the apply_old_config.h file located in integration/nrfx/legacy. In case you continue using the nrf_drv drivers, if you use any of the new NRFX_* entries in your configuration file that also contains old entries, the old entry settings take precedence.

Children
No Data
Related