Hi my friends,
I have been trying to get a grasp of how I can work with the interrupt signals.
I have read a few posts on the Devzone such as [Ref 1] and [Ref 2] and tried to adopt the same approach to test my understanding.
Assuming that the NRF_RADIO peripheral monitors the interrupt signals, I wrote the following code to see if I get an interrupt when the radio is being used.
Creating the interrupt handler, which just logs the fact that it was fired:
void RADIO_IRQHandler(void) { LOG_INF("RADIO IRQHandler Fired!!!\n"); }
Configuring the interrupt using the NRF_RADIO peripheral
void intrupt_CFG(void) { NRF_RADIO->INTENSET = RADIO_INTENSET_READY_Enabled << RADIO_INTENSET_READY_Pos | RADIO_INTENSET_ADDRESS_Enabled << RADIO_INTENSET_ADDRESS_Pos | RADIO_INTENSET_END_Msk; NVIC_SetPriority(RADIO_IRQn, 1); NVIC_ClearPendingIRQ(RADIO_IRQn); NVIC_EnableIRQ(RADIO_IRQn); }
The main code which activates the bluetooth and scans for some time and then it disables the bluetooth:
int main(void) { intrupt_CFG(); int err; err = bt_enable(NULL); if (err) { printk("Bluetooth init failed (err %d)\n", err); return 0; } printk("Bluetooth initialized\n"); start_scan(); int Duty_Cycle = 250; k_sleep(K_MSEC(Duty_Cycle)); bt_le_scan_stop(); bt_disable(); printk("Bluetooth Disabled \n"); return 0; }
However, when I build and flash, the log information (serial port) does not show that "RADIO_IRQHandler" has been triggered.
Any help would be much appreciated, thanks.