3718|14

64

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

请教WINCE50下的中断处理!! [复制链接]

请问WINCE50下中断是怎么处理的
就是调用以下四个函数的顺序是什么:BSPIntrEnableIrq、BSPIntrDisableIrq、BSPIntrDoneIrq、BSPIntrActiveIrq

我的理解
驱动中有个中断号,如SYSINTR_TOUCH,在intr.c中通过函数OALIntrStaticTranslate将中断号和IRQ捆绑在一起
并在BSPIntrEnableIrq、BSPIntrDisableIrq、BSPIntrDoneIrq、BSPIntrActiveIrq这几个函数中做处理
不知道系统调用这四个函数的顺序是什么?

之所以问这个是因为我的TOUCH不知道为什么总是不能用
看打印信息貌似中断已经触发
但是读到的坐标点总是非法的
SampleTouchScreen
{
          for(i=0;i         {
                rgPointSamples.XSample = getTouchCoordinate(WM97_ADC_X);
                rgPointSamples.YSample = getTouchCoordinate(WM97_ADC_Y);
        }
         读到的三次中有两次是错误的,只有一次正确!
}

最新回复

1. for loop 内读 3 次错 2 次, 那与 touch 的中断是无关的, AC97 access 不知有没有开中断, 若是没有的话, 那你 touch driver 的 bug 应该就与中断无关了. 2. AC97 是 audio/touch/battery 等这些 driver 共用的, 建议 LZ 先将另外两只 driver 移除不载, 试试看会不会改善. 3. 用示波器量量 X+, Y+ 的信号, 看看是否读了 3 次, 还是只有读 1 次, 所以另外 2 次读值是 garbage. 4. 若是还有问题, 那 LZ 就去追一下 getTouchCoordinate, 看看里面怎麽写. Paul, Chao @ Techware   详情 回复 发表于 2009-7-24 10:10
点赞 关注

回复
举报

76

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
我加分了怎么不显示!
 
 

回复

77

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
OALIntrStaticTranslate这是静态中断。
我的5.0 BSP没有使用这个。
关于这个,我博客有几篇文章,虽然有些不完整,但是还是正确的,楼主可以看看。

帮我顶顶帖子吧,我帖子不知道什么原因,分数这么多,就是没有人回!
 
 
 

回复

73

帖子

0

TA的资源

一粒金砂(初级)

4
 
1. XXX_Init -> InterruptInitialize -> OEMInterruptEnable -> BSPIntrEnableIrq.
2. Interrupt occured -> OEMInterruptHandler -> BSPIntrActiveIrq.
3. IST process done -> InterruptDone -> OEMInterruptDone -> BSPIntrDoneIrq.
4. XXX_Deinit -> InterruptDisable -> OEMInterruptDisable -> BSPIntrDisableIrq.

有人会在 call InterruptInitialize 之前先呼叫 InterruptDisable, 但这不是必需.

若是读 3 次有 2 次错, 那就试试读 5 次, 再加一些限制条件把读错的 2 次找出来丢掉, 取 3 次来平均.

Paul, Chao @ Techware
 
 
 

回复

84

帖子

0

TA的资源

一粒金砂(初级)

5
 
BSPIntrEnableIrq、BSPIntrDisableIrq、BSPIntrDoneIrq、BSPIntrActiveIrq这些函数在你调用系统api时会调用,比如调用InterruptDone,系统会映射到BSPIntrDoneIrq.没固定顺序.
touch的中断一般系统中会固定有处理的,不会调用到BSPintrXXXX吧?BSPintrXXXX一般是你自己加的处理部分.
 
 
 

回复

85

帖子

0

TA的资源

一粒金砂(初级)

6
 
顶帖子吗, 这种简单的事我来就可以了

呵呵

 
 
 

回复

73

帖子

0

TA的资源

一粒金砂(初级)

7
 
An interrupt service routine (ISR) is a software routine that hardware invokes in response to an interrupt. ISRs examine an interrupt and determine how to handle it. ISRs handle the interrupt, and then return a logical interrupt value. If no further handling is required because the device is disabled or data is buffered, the ISR notifies the kernel with a SYSINTR_NOP return value. An ISR must perform very fast to avoid slowing down the operation of the device and the operation of all lower priority ISRs.

Although an ISR might move data from a CPU register or a hardware port into a memory buffer, in general it relies on a dedicated interrupt thread, called the interrupt service thread (IST), to do most of the required processing. If additional processing is required, the ISR returns a logical interrupt value, other than SYSINTR_NOP, to the kernel. It then maps a physical interrupt number to a logical interrupt value. For example, the keyboard might be associated with hardware interrupt 4 on one device and hardware interrupt 15 on another device. The ISR, which is in the OAL, translates the hardware-specific value to the Windows CE standard value of SYSINTR_KEYBOARD. In this example, SYSINTR_KEYBOARD is the return value from the ISR.

When an ISR notifies the kernel of a specific logical interrupt value, the kernel examines an internal table to map the logical interrupt value to an event handle. The kernel wakes the IST by signaling the event. An event is a standard Microsoft? Win32? synchronization object that serves as an alarm clock to wake up a thread when something interesting happens.

The following table compares hardware platforms that support a single ISR with hardware platforms that support multiple ISRs.

ISR model Description
Single ISR hardware platform  The name of the ISR is OEMInterruptHandler.  
Multiple ISR hardware platform The OAL does not provide an OEMInterruptHandler function. Instead, you must register ISRs for each interrupt by calling HookInterrupt function in the OAL.

---------------------------

OEMInterruptHandler:
This function is called by the kernel when an interrupt occurs. This function is only used by the ARM kernel, and provides all ISR functionality for ARM-based platforms. You do not need to call HookInterrupt in OEMInit for ARM-based platforms.



Note   Other than having to map from an IRQ to an interrupt service routine, handling interrupts with multiple ISRs is identical to handling interrupts when a single ISR is present. One reason not to process data in the ISR is that there is no way to access the user buffer. The user mode IST routine can access this buffer.

 
 
 

回复

68

帖子

0

TA的资源

一粒金砂(初级)

8
 
若是读 3 次有 2 次错, 那就试试读 5 次, 再加一些限制条件把读错的 2 次找出来丢掉, 取 3 次来平均.

我先试一下,不过貌似不是这个问题

因为我现在的驱动完全是把WINCE42下TOUCH的驱动拿过来编译的,

不可能在WINCE42下三次都读对,在WINCE50下就只能读对一次啊

现在打印信息中我看不到调用InterruptDisable,我不知道缺少了InterruptDisable会是什么样的现象?

给我的感觉就象是中断处理出了问题一样,因为WINCE42下和WINCE50下驱动貌似只有中断这不一样

 
 
 

回复

71

帖子

0

TA的资源

一粒金砂(初级)

9
 
希望多点人来 ! 中断却是比较重要!
 
 
 

回复

83

帖子

0

TA的资源

一粒金砂(初级)

10
 
取5个值有4个是错的
只有第一个是正确的!
 
 
 

回复

86

帖子

0

TA的资源

一粒金砂(初级)

11
 
wince5的中断和wince4.2的中断不同,5。0是动态分配的
 
 
 

回复

71

帖子

0

TA的资源

一粒金砂(初级)

12
 
lz又发新帖了,pendown状态不是哪定义的,是你点击触摸屏后,9712自己把寄存器置上的,前提就是你把触摸的相关寄存器配置正确,如果说后几次取值不对,你是不是取值时你已经把笔提起了,        if(adcDataReg & WM97_DATA_PENDOWN)
        {
                noError = sampleADC(&sample,axis);
        }
是否走了以上流程,实在不行把代码发初始化代码发给我帮你分析分析
 
 
 

回复

79

帖子

0

TA的资源

一粒金砂(初级)

13
 
引用 9 楼 wangxin_801115 的回复:
取5个值有4个是错的
只有第一个是正确的!

是不是读完一次数据后要做一下清理工作呢??
 
 
 

回复

77

帖子

0

TA的资源

一粒金砂(初级)

14
 
好啊,请留个QQ或者MSN号,我发给您
谢谢啦
 
 
 

回复

65

帖子

0

TA的资源

一粒金砂(初级)

15
 
1. for loop 内读 3 次错 2 次, 那与 touch 的中断是无关的, AC97 access 不知有没有开中断, 若是没有的话, 那你 touch driver 的 bug 应该就与中断无关了.

2. AC97 是 audio/touch/battery 等这些 driver 共用的, 建议 LZ 先将另外两只 driver 移除不载, 试试看会不会改善.

3. 用示波器量量 X+, Y+ 的信号, 看看是否读了 3 次, 还是只有读 1 次, 所以另外 2 次读值是 garbage.

4. 若是还有问题, 那 LZ 就去追一下 getTouchCoordinate, 看看里面怎麽写.

Paul, Chao @ Techware
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/8 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表