Beispiel #1
0
int NwpRegisterInterruptHandler(P_EVENT_HANDLER InterruptHdl , void* pValue)    //do not know what to do with pValue
{

    if(InterruptHdl == NULL)
    {
        //De-register Interprocessor communication interrupt between App and NWP
#ifdef SL_PLATFORM_MULTI_THREADED
        osi_InterruptDeRegister(INT_NWPIC);
#else
        MAP_IntDisable(INT_NWPIC);
        MAP_IntUnregister(INT_NWPIC);
        MAP_IntPendClear(INT_NWPIC);
#endif
    }
    else
    {
#ifdef SL_PLATFORM_MULTI_THREADED
        MAP_IntPendClear(INT_NWPIC);
        osi_InterruptRegister(INT_NWPIC, (P_OSI_INTR_ENTRY)InterruptHdl,
                              INT_PRIORITY_LVL_1);
#else
        MAP_IntRegister(INT_NWPIC, InterruptHdl);
        MAP_IntPrioritySet(INT_NWPIC, INT_PRIORITY_LVL_1);
        MAP_IntPendClear(INT_NWPIC);
        MAP_IntEnable(INT_NWPIC);
#endif
    }

    return 0;
}
void osi_InterruptDeRegister(int iIntrNum)
{
	MAP_IntDisable(iIntrNum);
	MAP_IntUnregister(iIntrNum);
}