void avsIntEventHandler0(void) { uint32 intEventReg; UNUSED_ARG(pVal); // Service INT0 interrupts avsRegRead(APBA_INT0_STATUS, &intEventReg); // Clear all pending 0 interrupts to be serviced avsRegWrite(APBA_INT0_STATUS, intEventReg); #ifdef _DTCP #ifdef _ECPMINT_POLLING #else //_ECPMINT_POLLING if (intEventReg != 0) { if (intEventReg & IRQ_ECPM) { // Increment event counter avsIntEventState[0].avsIntCounter[AVS_INT0_EVENT_ECPM_INDEX]++; // Clear AVS event intEventReg &= ~IRQ_ECPM; dtcpECPMIntPart1(); //clear start bit, get results // Clear ECPM pending 0 interrupts to be serviced avsRegWrite(APBA_INT0_STATUS, IRQ_ECPM); dtcpECPMIntPart2(); //signal thread semaphore } } #endif //_ECPMINT_POLLING #endif //_DTCP if (intEventReg != 0) { avsIntEventState[0].avsIntEventCopy |= intEventReg; avsIntSignalSemaphore(); } }
/********************************************************* Enable interrupts */ static HRESULT avsIntSetup(void) { HRESULT hResult = NO_ERROR; uint32 intEnable; uint32 i; uint32 j; for (i = 0; i < NUM_AVS_EVENTS; i++) { avsIntEventState[i].numEventItems = avsIntItems[i]; avsIntEventState[i].avsIntEvents = avsIntEvents[i]; avsIntEventState[i].avsIntCounter = avsIntCounter[i]; #ifdef _SYSDEBUG avsIntEventState[i].avsIntTexts = (char ***)&avsIntTexts[i]; #endif //_SYSDEBUG avsIntEventState[i].avsIntEventCopy = 0; } // Disable all interrupts for (i = 0; i < NUM_AVS_EVENTS; i++) { avsRegWrite(avsIntMask[i], 0); } avsIntClearCounters(); for (i = 0; i < NUM_AVS_EVENTS; i++) { intEnable = 0; for (j = 0; j < avsIntEventState[i].numEventItems; j++) { intEnable |= avsIntEventState[i].avsIntEvents[j]; } // Enable interrupts from AVS INT avsRegWrite(avsIntMask[i], intEnable); } return hResult; }
void avsIntEventHandler2(void) { uint32 intEventReg; // Service INT2 interrupts avsRegRead(APBA_INT2_STATUS, &intEventReg); // Clear all pending 2 interrupts to be serviced avsRegWrite(APBA_INT2_STATUS, intEventReg); if (intEventReg != 0) { avsIntEventState[2].avsIntEventCopy |= intEventReg; avsIntSignalSemaphore(); } }