/* The wdev NMI calls this function from pp_post() with SVC_MACLayer to set a pending interrupt service callback which flushs the queue of messages that the NMI stashes away. This interrupt will be triggered after the return from the NMI and when interrupts are enabled. The NMI can not touch the FreeRTOS queues itself. The NMI must not touch the interrupt masks so that path must not call vPortEnterCritical and vPortExitCritical.  */
void IRAM PendSV(enum SVC_ReqType req)
/* The wdev NMI calls this function from pp_post() with SVC_MACLayer to set a pending interrupt service callback which flushs the queue of messages that the NMI stashes away. This interrupt will be triggered after the return from the NMI and when interrupts are enabled. The NMI can not touch the FreeRTOS queues itself. The NMI must not touch the interrupt masks so that path must not call vPortEnterCritical and vPortExitCritical.  */
void IRAM PendSV(enum SVC_ReqType req)
{
    if (req == SVC_Software) {
        vPortEnterCritical();
        pending_soft_sv = 1;
        WSR(BIT(INUM_SOFT), interrupt);
        vPortExitCritical();
    } else if (req == SVC_MACLayer) {
        pending_maclayer_sv= 1;
        WSR(BIT(INUM_SOFT), interrupt);
    }
}