关于InterruptInitialize函数

 

该函数会自动调用OEMInterrupEnable() 函数,如果关联失败,从以下几个方面招原因:

1,SYSINTR_XXX 的值是否映射到具体的物理IRQ。

2,查看OALINTR.H文件的函数,看你自定义的中断是否在该范围内(4.2smdk2410为例)

MapIrq2SysIntr(DWORD _Irq)
{
    if( _Irq<=20 )
        return ( SYSINTR_FIRMWARE + _Irq );
    else
        return (0xffffffff);
}

3,查看创建的事件是否成功,最好将IST挂起。

 

This function initializes a hardware interrupt with the kernel. This initialization allows the device driver to register an event and enable the interrupt. This function is callable from kernel-mode drivers and user-mode drivers.

Syntax

BOOL InterruptInitialize(
            DWORD idInt,
            HANDLE hEvent,
            LPVOID pvData,
            DWORD cbData 
            );

Parameters

idInt

[in] Interrupt identifier to be associated with this interrupt service thread (IST).

hEvent

[in] Event to be signaled when the interrupt is triggered.

pvData

[in] This parameter can be used as a pointer to a block of data that is passed to . The block of data can be initialization data, scratch space, and so on.

cbData

[in] Size of data pointed to by pvData.

Return Value

TRUE indicates success; FALSE indicates failure.

Remarks

This function must be called before using the hEvent parameter, which provides a link between the idInt parameter and the SYSINTR value returned by an ISR.

The hEvent parameter can only be used in a WaitForSingleObject call to wait for the event to be triggered by the kernel.

A WaitForMultipleObjects call with hEvent will fail.

If you use hEvent in a call to WaitForSingleObject before you call InterruptInitialize, InterruptInitialize will fail.

Requirements

OS Versions: Windows CE 2.10 and later.

Header: Pkfuncs.h.

Link Library: Coredll.lib.

转载于:https://www.cnblogs.com/xtrgm623/archive/2008/12/13/1354271.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值