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

GPIO interrupt with Proximitty example

Dear Nordic Team,

Thanks for supporting.

currently i am try to interface MMA8453 accelerator with ble proximitty example .Already i have interfaced peripheral example code its working good. But in ble proximitty example code not work because i want to enable GPIOTE interrupt in ble proximitty example. When i was initialized GPIO interrupt (err_code = nrf_drv_gpiote_init();) i am getting error for NRF_ERROR_INVALID_STATE. I dont know what i am doing wrong . please check this image error.png

I am using PCA10028 hardware and SDK is SDK11.0

Parents
  • Hi,

    You can see in the infocenter page here, that when the nrf_drv_gpiote_init() function returns NRF_ERROR_INVALID_STATE, that means that the GPIOTE module was already initialized. This previously initialization of the module was done by the function buttons_leds_init().

    I recommend using the function nrf_drv_gpiote_is_init() to make sure that you don't try to initialize the module if it’s already initialized:

    if (!nrf_drv_gpiote_is_init())
    {
        err_code = nrf_drv_gpiote_init();
        APP_ERROR_CHECK(err_code);
    }
    
Reply
  • Hi,

    You can see in the infocenter page here, that when the nrf_drv_gpiote_init() function returns NRF_ERROR_INVALID_STATE, that means that the GPIOTE module was already initialized. This previously initialization of the module was done by the function buttons_leds_init().

    I recommend using the function nrf_drv_gpiote_is_init() to make sure that you don't try to initialize the module if it’s already initialized:

    if (!nrf_drv_gpiote_is_init())
    {
        err_code = nrf_drv_gpiote_init();
        APP_ERROR_CHECK(err_code);
    }
    
Children
Related