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

unable to disable a GPIOTE Event using nrf_drv_gpiote_in_event_disable

Hello:

I need to disable an interrupt event outside the handler. During debugging when the nrf_drv_gpiote_in_event_disable function gets executed, the program seems to reset. I have also tried nrf_gpio_cfg_sense_set with NRF_GPIO_PIN_NOSENSE with the same results. I need to be able to enable and disable interrupt functions based on received modes from a central device. Any help will be greatly appreciated.

Regards,

Parents
  • void CDC_interrupt_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { Read_CDC_Results();

    		CDC_Data_Filter();
    		
    		if (acquisition_mode != IMU_Data)		// IMU_Data mode is called in the IMU_interrupt handler
    			acquisition_mode_characteristic_update();
    }
    void IMU_interrupt_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
    		
                   IMU_timestamp_current_counter = NRF_RTC0->COUNTER;
    
    		IMU_timestamp_current_counter2 = out_gyroself(LSM6DS3_ACC_GYRO_TIMESTAMP0_REG,LSM6DS3_ACC_GYRO_TIMESTAMP1_REG);
    
    		IMU_timestamp_current_counter2 |= (spi_gpio_test_rx(LSM6DS3_ACC_GYRO_TIMESTAMP2_REG,SPI_READ,0x00) << 16);
    
    	
    		if (IMU_timestamp_current_counter2 >= 0xFF0000)
    				spi_gpio_test_rx(LSM6DS3_ACC_GYRO_TIMESTAMP2_REG, SPI_WRITE, 0xAA); 
    	
    					
    		if ((acquisition_mode == Standard_Aquisition) || (acquisition_mode == IMU_Data) || (acquisition_mode == All_Measurement))
    
    				Get_IMU_Data(1); // read Accel
    		
    		if ((acquisition_mode == IMU_Data) || (acquisition_mode == All_Measurement))
    
    				Get_IMU_Data(0); // read the Gyro Data
    		
    		imu_data_byte_convertion();
    		
    		if (acquisition_mode == IMU_Data)
    			acquisition_mode_characteristic_update();
    }
    

    both handlers read data from the SPI bus. any help is greatly appreciated.

Reply
  • void CDC_interrupt_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { Read_CDC_Results();

    		CDC_Data_Filter();
    		
    		if (acquisition_mode != IMU_Data)		// IMU_Data mode is called in the IMU_interrupt handler
    			acquisition_mode_characteristic_update();
    }
    void IMU_interrupt_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
    		
                   IMU_timestamp_current_counter = NRF_RTC0->COUNTER;
    
    		IMU_timestamp_current_counter2 = out_gyroself(LSM6DS3_ACC_GYRO_TIMESTAMP0_REG,LSM6DS3_ACC_GYRO_TIMESTAMP1_REG);
    
    		IMU_timestamp_current_counter2 |= (spi_gpio_test_rx(LSM6DS3_ACC_GYRO_TIMESTAMP2_REG,SPI_READ,0x00) << 16);
    
    	
    		if (IMU_timestamp_current_counter2 >= 0xFF0000)
    				spi_gpio_test_rx(LSM6DS3_ACC_GYRO_TIMESTAMP2_REG, SPI_WRITE, 0xAA); 
    	
    					
    		if ((acquisition_mode == Standard_Aquisition) || (acquisition_mode == IMU_Data) || (acquisition_mode == All_Measurement))
    
    				Get_IMU_Data(1); // read Accel
    		
    		if ((acquisition_mode == IMU_Data) || (acquisition_mode == All_Measurement))
    
    				Get_IMU_Data(0); // read the Gyro Data
    		
    		imu_data_byte_convertion();
    		
    		if (acquisition_mode == IMU_Data)
    			acquisition_mode_characteristic_update();
    }
    

    both handlers read data from the SPI bus. any help is greatly appreciated.

Children
No Data
Related