Why does the pushing a button located at GPIO_9 not call the interrupt handler and therefore print the statement to RTT?
#include "GPIO.h"
#include "app_error.h"
#include <string.h>
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "SEGGER_RTT.h"
#include "boards.h"
#include "nrf_drv_gpiote.h"
#include "mpu9250.h"
extern uint8_t m_rx_buf[513]; /**< RX buffer. */
//extern uint8_t SPI_red, prod_id;
//MPU9250 Interrupt handler
void mpu9250Interrupt_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
mpu9250_read_mpu_reg(MPUREG_ACCEL_XOUT_H, m_rx_buf, 20);
pack_frame_sens_reg();
}
//MPU9250 Interrupt handler
void buttonInterrupt_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
SEGGER_RTT_printf(0, "button pressed.\n");
}
void gpio_init(void)
{
//SEGGER_RTT_printf(0, "Entering gpio init\n");
uint32_t err_code = 0;
if(!nrf_drv_gpiote_is_init())
{
err_code = nrf_drv_gpiote_init();
//SEGGER_RTT_printf(0, "%d is the error code\n",err_code);
APP_ERROR_CHECK(err_code);
}
//Test output stuff
nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);
err_code = nrf_drv_gpiote_out_init(GPIO_0, &out_config);
err_code = nrf_drv_gpiote_out_init(mpu_FSYNC, &out_config);
err_code = nrf_drv_gpiote_out_init(LED_BRIGHT, &out_config);
nrf_drv_gpiote_out_clear(LED_BRIGHT);
err_code = nrf_drv_gpiote_out_init(LED_1, &out_config);
err_code = nrf_drv_gpiote_out_init(LED_2, &out_config);
err_code = nrf_drv_gpiote_out_init(LED_3, &out_config);
//Input stuff
// nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);
// in_config.pull = NRF_GPIO_PIN_NOPULL;
// err_code = nrf_drv_gpiote_in_init(mpu_INT, &in_config, mpu9250Interrupt_handler);
nrf_drv_gpiote_in_config_t in_configII = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
//in_configII.hi_accuracy = hi_accu;
err_code = nrf_drv_gpiote_in_init(GPIO_9, &in_configII, buttonInterrupt_handler);
nrf_drv_gpiote_in_event_enable(GPIO_9, true);
//nrf_drv_gpiote_in_event_enable(mpu_INT, true);
//end test output stuff
}
