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

nrf driver adc irq priority

When i use the nrf_drv_adc with NRF_ADC_DEFAULT_CONFIG i get the following compile errors:

rf_drv_adc.h:127:27: error: 'ADC_CONFIG_IRQ_PRIORITY' undeclared here (not in a function)
.interrupt_priority = ADC_CONFIG_IRQ_PRIORITY \

nrf_drv_adc.c:31:54: note: in expansion of macro 'NRF_DRV_ADC_DEFAULT_CONFIG'
static const nrf_drv_adc_config_t m_default_config = NRF_DRV_ADC_DEFAULT_CONFIG;

Am i doing something wrong? I included the driver header. Do i need other includes?

Parents
  • I think you need to have a nrf_drv_config.h file in order for your code to run. Within it contains those defines needed.

    Snippet from the file:

        /* SAADC */
    #define SAADC_ENABLED 1
    
    #if (SAADC_ENABLED == 1)
    #define SAADC_CONFIG_RESOLUTION      NRF_SAADC_RESOLUTION_12BIT
    #define SAADC_CONFIG_OVERSAMPLE      NRF_SAADC_OVERSAMPLE_DISABLED
    #define SAADC_CONFIG_IRQ_PRIORITY    APP_IRQ_PRIORITY_LOW
    #endif
    
Reply
  • I think you need to have a nrf_drv_config.h file in order for your code to run. Within it contains those defines needed.

    Snippet from the file:

        /* SAADC */
    #define SAADC_ENABLED 1
    
    #if (SAADC_ENABLED == 1)
    #define SAADC_CONFIG_RESOLUTION      NRF_SAADC_RESOLUTION_12BIT
    #define SAADC_CONFIG_OVERSAMPLE      NRF_SAADC_OVERSAMPLE_DISABLED
    #define SAADC_CONFIG_IRQ_PRIORITY    APP_IRQ_PRIORITY_LOW
    #endif
    
Children
Related