For reference I am using NCS v2.0 and VSCode with the NCS extension and coding in C++.
Hi, can you help clarify the expected behavior and usage of the MPSL_TIMESLOT_SIGNAL_RADIO signal?
I can see a few details from the MPSL API page (link)
void MPSL_IRQ_RADIO_Handler(void)
RADIO interrupt handler.Note: This handler should be placed in the interrupt vector table. The interrupt priority level should be priority 0.
...
MPSL_TIMESLOT_SIGNAL_RADIO
This signal indicates the RADIO interrupt. The signal will be executed in the same context as MPSL_IRQ_RADIO_Handler.
It isn't clear to me the meaning of how to use this information.
I have found the Nordic blog post Updating to the MPSL Timeslot interface regarding MPSL and ESB.
Looking at the source code, the MPSL_TIMESLOT_SIGNAL_RADIO event triggers calling RADIO_IRQHandler().
I can see in the nrf esb.c file there is such a function
ISR_DIRECT_DECLARE(RADIO_IRQHandler)
{
radio_irq_handler();
ISR_DIRECT_PM();
return 1;
}
Question 1
So it seems that the Nordic example is what, receiving radio interrupts and routing them to the MPSL_TIMESLOT_SIGNAL_RADIO event?
Should I understand that if I'm driving another radio protocol, like ESB, that I have to forward radio event notifications to that protocol's radio ISR?
I have confirmed by implementing this that calling RADIO_IRQHandler() is necessary for the ESB example to work.
Question 2
Regarding the API page, for the MPSL_IRQ_RADIO_Handler(), when it says "This handler should be placed in the interrupt vector table", what does that mean? Am I able to put the RADIO_IRQHandler() into an interrupt vector so I don't have to call it from the MPSL_TIMESLOT_SIGNAL_RADIO event myself?
Question 3
I can't seem to get access to the RADIO_IRQHandler() from my code without modifying the esb.h file to put an extern statement at the top.
extern void RADIO_IRQHandler();
I'm kind of baffled by that, I tried putting the exact same extern statement into the C++ file of my application and I get undefined reference to `RADIO_IRQHandler()' when compiling. Unclear why or how I can work around that. I don't want to edit the esb.h file. Can you suggest what I do differently?
Thanks.