I2C--中断

前些天在中断响应(handle)函数中操作I2C的时候,发现内核会抱怨:

 

BUG: scheduling while atomic: samtest/0x00010000/57

Call Trace:[<c009a30>][<c009a30>][<c010f7f0>][<c010ed08>][<c010f7f0>][<c002e664>]

...

 

但是后面的操作依然正常,经过高手指点后发现原来通过I2C传输的时候,总线会休眠,英文说明:

 

* we can't acknowledge from interrupt context since the i2c  

* bus controller may sleep, so we just disable the interrupt  

* here and handle the acknowledge using delayed work.  

 

查看如下代码中的说明:

http://linux.sourcearchive.com/documentation/2.6.27-1.2/migor__ts_8c-source.html

 

  

 所以采用先注册

然后在中断中调用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值