Hi. I'm using PCA10028, SDK10.0.0, S130.
I'm testing External interrupt.
Current concumption was just 50uA around(low speed advertising mode).
But It goes 1mA around after i put "gpio_init()" as below. I'm sure i don't use DEBUG mode when i check current consumption.
static void gpio_init(void)
{
ret_code_t err_code;
err_code = nrf_drv_gpiote_init();
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);
err_code = nrf_drv_gpiote_out_init(BSP_LED_3, &out_config);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);
in_config.pull = NRF_GPIO_PIN_PULLUP;
err_code = nrf_drv_gpiote_in_init(BUTTON_3, &in_config, in_pin_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(BUTTON_3, true);
}
static void ble_peripheral_operation(bool erase_bonds)
{
uint32_t err_code;
ble_gap_addr_t addr;
ble_gap_addr_t * p_addr = &addr;
gap_params_init();
services_init();
advertising_init();
conn_params_init();
err_code = sd_ble_gap_address_get(p_addr);
err_code = ble_advertising_start(BLE_ADV_MODE_SLOW);
APP_ERROR_CHECK(err_code);
}
int main(void)
{
bool erase_bonds;
// Initialize.
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, NULL);
gpio_init(); // External interrupt test
ble_stack_init();
ble_peripheral_operation(erase_bonds);
for (;; )
{
power_manage();
}
}
I want to get External interrupt while nRF51 is advertising. I need your help.