|
我用wince 5.0,但是优龙的bsp不支持KernelIoControl(),于是我采用了,网上所说的那样静态关联中断。
1〉首先,在oalintr.h里添加自定义的中断宏;
2>修改Armint.c的OEMInterruptHandler函数了,
else if (submask & (1 << 11))
{
RETAILMSG(1,(TEXT("::: INTSRC_EINT11 OEMInterruptHandle\r\n")));
s2410IOP->rEINTMASK |= (1 << 11);
s2410IOP->rEINTPEND = (1 << 11);
s2410INT->rSRCPND = BIT_EINT8_23;
if (s2410INT->rINTPND & BIT_EINT8_23) s2410INT->rINTPND = BIT_EINT8_23;
//RETAILMSG(1, (TEXT("ARMINT.C - SYSINTR_SDMMC_CARD_DETECT\r\n")));
return(SYSINTR_KEYTHREE);
}
3〉在cfw.c的OEMInterruptEnable,和OEMInterruptDisable中分别添加如下代码段:
case SYSINTR_KEYTHREE:
s2410IOP->rEINTPEND = (1 << 11);
s2410IOP->rEINTMASK &= ~(1 << 11);
s2410INT->rSRCPND = BIT_EINT8_23; // by shim
// S3C2410X Developer Notice (page 4) warns against writing a 1 to a 0 bit in the INTPND register.
if (s2410INT->rINTPND & BIT_EINT8_23) s2410INT->rINTPND = BIT_EINT8_23;
s2410INT->rINTMSK &= ~BIT_EINT8_23;
break;
*********IN OEMInterruptDisable*******/
case SYSINTR_KEYTHREE:
s2410INT->rINTMSK |= BIT_EINT8_23;
s2410IOP->rEINTMASK |= (1 << 11);
break;
我的程序运行到ret = WaitForSingleObject(gWaitEvent,INFINITE);
一直没有中断信号。不知道为什么,望高手指点。
|
|