请教: CC2541進不了低功耗,pwrmgr_task_state 一直为2

[复制链接]
2174|10
 楼主| tomgl 发表于 2016-10-17 18:40 | 显示全部楼层 |阅读模式
本帖最后由 tomgl 于 2016-10-18 10:12 编辑

可以進到下面的低功耗管理模块中

void osal_pwrmgr_powerconserve( void )
{
  uint32        next;
  halIntState_t intState;
  // Should we even look into power conservation
  if ( pwrmgr_attribute.pwrmgr_device != PWRMGR_ALWAYS_ON )
  {
    // Are all tasks in agreement to conserve
    if ( pwrmgr_attribute.pwrmgr_task_state == 0 )     //这里一直是pwrmgr_task_state=2
    {
      // Hold off interrupts.
      HAL_ENTER_CRITICAL_SECTION( intState );

      // Get next time-out
      next = osal_next_timeout();
   
      // Re-enable interrupts.
      HAL_EXIT_CRITICAL_SECTION( intState );
      // Put the processor into sleep mode
      OSAL_SET_CPU_INTO_SLEEP( next );
    }
  }
}

lihuami 发表于 2016-10-17 22:03 | 显示全部楼层
这是哪里的函数?
lihuami 发表于 2016-10-17 22:07 | 显示全部楼层
配置的问题吗?
 楼主| tomgl 发表于 2016-10-18 10:14 | 显示全部楼层
配置上已经配置POWER_SAVING=TRUE
dirtwillfly 发表于 2016-10-18 11:32 | 显示全部楼层
在这段程序发现问题,但问题不一定发生在这里。追踪一下是哪里阻止进入低功耗了。
 楼主| tomgl 发表于 2016-10-18 11:42 | 显示全部楼层
就是在这个地方
if ( pwrmgr_attribute.pwrmgr_task_state == 0 )   

这里的pwrmgr_task_state一直等于2
haokeer 发表于 2016-10-18 21:58 | 显示全部楼层
找找原因,你的低功耗使能没有起到应有的作用吧
 楼主| tomgl 发表于 2016-10-19 12:47 | 显示全部楼层
其实在另一个工程现在低功耗已经用起来了,每休眠2秒唤醒一次,唤醒后向从机发一次数据,然后再休眠2秒

但在这个工程中就卡在这里進不了休眠,有点奇怪,因时间紧没有太多去比较
xiaolong12 发表于 2016-10-19 20:05 | 显示全部楼层
用文件比较器,可以轻松的比较两个c文件之间的区别,很方便的。
 楼主| tomgl 发表于 2016-10-20 16:14 | 显示全部楼层
是啊,等有时间,用svn比较一下看

看能不能捉住这个“妖怪”
Rangar 发表于 2016-10-21 21:31 | 显示全部楼层
可能是低功耗使能没有进去
您需要登录后才可以回帖 登录 | 注册

本版积分规则

28

主题

52

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部