打印

关于中断的睡眠唤醒

[复制链接]
1460|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
zzqqlzlsq|  楼主 | 2011-5-4 20:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
请问各位,我讲外部按键用作//pc6//pc7//pc10//pc11
然后将PC6设置为外部中断,进入睡眠后pc6 pc7  pc10  pc11
都能唤醒?
   //Enable the EXTI9_5 Interrupt
   NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQChannel;
   NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;//抢占优先级
                                                            //比系统定时器高
                                                            //系统定时器设置为3
   NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;//响应
   NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
   NVIC_Init(&NVIC_InitStructure);
   /////////////////////////////////////////////////////////////////////////////
   /////////////////////////////////////////////////////////////////////////////
   //Enable the EXTI15_10 Interrupt
   NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQChannel;
   NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;//抢占优先级
                                                            //比系统定时器高
                                                            //系统定时器设置为3
   NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;//响应
   NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
   NVIC_Init(&NVIC_InitStructure);
   /////////////////////////////////////////////////////////////////////////////
   /////////////////////////////////////////////////////////////////////////////
   //时钟采样的中断
   //Enable the EXTI2 Interrupt
   NVIC_InitStructure.NVIC_IRQChannel = EXTI2_IRQChannel;
   NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;//抢占优先级
                                                            //比系统定时器高
                                                            //系统定时器设置为3
   NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;//响应
   NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
   NVIC_Init(&NVIC_InitStructure);
   /////////////////////////////////////////////////////////////////////////////
   /////////////////////////////////////////////////////////////////////////////
沙发
airwill| | 2011-5-6 21:52 | 只看该作者
看见过很多的帖子谈论这个问题了, 翻一下以前人家的帖子吧

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

128

主题

147

帖子

0

粉丝