VOID CSDHCBase::HandleInterrupt( ) { Lock(); RETAILMSG(0,(TEXT("+CSDHCBase::HandleInterrupt\r\n"))); // Use slot zero to get the shared global interrupt register PCSDHCSlotBase pSlotZero = GetSlot(0); DWORD dwIntStatus = pSlotZero->ReadControllerInterrupts(); do { DEBUGMSG(SDHC_INTERRUPT_ZONE, (TEXT("CSDHCBase::HandleInterrupt: Slot Interrupt_Status=0x%X\n"), dwIntStatus)); for (DWORD dwSlot = 0; dwSlot < m_cSlots; ++dwSlot) { PCSDHCSlotBase pSlot = GetSlot(dwSlot); //if ( ((1 << dwSlot) & dwIntStatus) || pSlot->NeedsServicing() ) { pSlot->HandleInterrupt(); //} } dwIntStatus = pSlotZero->ReadControllerInterrupts(); /* if(dwIntStatus == 0x2 ) RETAILMSG(1,(TEXT("dwIntStatus=0x%08X\n"),dwIntStatus)); */ if(dwIntStatus && pSlotZero->IsOnlySDIOInterrupt()) break; } while (dwIntStatus); InterruptDone(m_dwSysIntr); RETAILMSG(0,(TEXT("-CSDHCBase::HandleInterrupt\r\n"))); Unlock(); }
// New function to Card detect thread of HSMMC ch1 on SMDK6410. DWORD CSDHControllerCh1::CardDetectThread() { BOOL bSlotStateChanged = FALSE; DWORD dwWaitResult = WAIT_TIMEOUT; PCSDHCSlotBase pSlotZero = GetSlot(0); CeSetThreadPriority(GetCurrentThread(), 100); while(1) { // Wait for the next insertion/removal interrupt dwWaitResult = WaitForSingleObject(m_hevCardDetectEvent, INFINITE); Lock(); pSlotZero->HandleInterrupt(SDSLOT_INT_CARD_DETECTED); Unlock(); InterruptDone(m_dwSDDetectSysIntr); EnableCardDetectInterrupt(); } return TRUE; }