This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

button_leds_init() function is clashing with mpu9250

Hi,

I'm working on nrf51822 and mpu9250 imu sensor.i'm facing a problem,my buttons function i.e buttons leds int and mpu9250 are not working together either one is working at a time,i'm unable to find the problem.please help me..

thanks in advance.

Parents
  • In your code nrf_drv_gpiote_is_init() will return an error if the GPIOTE is already initialized and your application will hang or reset in APP_ERROR_CHECK(). If you do it like this:

    uint32_t err_code;
    if(!nrf_drv_gpiote_is_init())
    {
        err_code = nrf_drv_gpiote_init();
    }
    

    as is suggested here you will simply skip the initialization if it is already done before.

Reply
  • In your code nrf_drv_gpiote_is_init() will return an error if the GPIOTE is already initialized and your application will hang or reset in APP_ERROR_CHECK(). If you do it like this:

    uint32_t err_code;
    if(!nrf_drv_gpiote_is_init())
    {
        err_code = nrf_drv_gpiote_init();
    }
    

    as is suggested here you will simply skip the initialization if it is already done before.

Children
No Data
Related