Hi, I try to turn off the advertising after the first connection and then turn it on after pressing the button, this is what I wrote:
void radio_notification_evt_handler(bool radio_evt)
{
if (radio_evt)
{
//radio going active
LEDS_INVERT(BSP_LED_1_MASK);
if (connection_occurance) sd_ble_gap_adv_stop();
}
}
//
void GPIOTE_IRQHandler(void)
{
printf("Are you here?");
ble_advertising_start(BLE_ADV_MODE_FAST);
if(NRF_GPIOTE->EVENTS_PORT)
NRF_GPIOTE->EVENTS_PORT = 0;
}
Program comes to the handler of button interrupt but there the program is crashing. This problem is quite suprising for me, because I reset advertising in other application and there it's work well. Only difference is that in the other case I turn off and immediately turn on advertising, and in this application I wait for button.