|
用KernelIoControl获取逻辑中断号失败
[复制链接]
我想使用EINTT4作按键中断输入.定义如下:
UINT32 g_EINTIrq = IRQ_EINT4;
UINT32 g_EINTSysIntr = SYSINTR_UNDEFINED;
PUBLIC DWORD CPK_Init(DWORD dwContext)
{
//在虚拟内存中申请一段虚拟内存,返回申请到的虚拟内存起始地址
v_pIOPRegs = (volatile IOPreg*)VirtualAlloc(0, sizeof(IOPreg), MEM_RESERVE, PAGE_NOACCESS);
b_IOREG=VirtualCopy((PVOID)v_pIOPRegs,(PVOID)IOP_BASE, sizeof(IOPreg),PAGE_PHYSICAL|PAGE_READWRITE|PAGE_NOCACHE);
// 使能 EINT4 引脚为中断引脚, 并为下降沿触发
EINT_ConfigInterruptPin(4);
///从OAL申请一个SYSINTR值
if (!KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR,
&g_EINTIrq, sizeof(DWORD),
&g_EINTSysIntr, sizeof(DWORD), NULL))
{
RETAILMSG(1, (TEXT("ERROR: CPKey: Failed to request sysintr value for EINT interrupt.\r\n")));
return(0);
}
// 返回不为0的数
return (1)
}
可是输出"ERROR: CPKey: Failed to request sysintr value for EINT interrupt.", 获取逻辑中断号失败.
我改变了几个IO口,如:EINT11,EINT17,EINT19.都是一样的错误!
请各位大侠不吝指点迷津!
|
|