我在CC2540从机程序中,已经开启了POWER_SAVING,也能进osal_pwrmgr_powerconserve(),但是发现pwrmgr_attribute.pwrmgr_task_state==2,功耗测下来是8mA,连PM2都没进去,Debug发现osal_run_system()一直在跑,我关掉了所有的自己设置的定时事件,感觉还是有任务在跑,可又找不到,TI的技术人员能不能帮帮忙给个解决思路
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Y,你好
我用的是TI原厂的板子,没有修改和手动调用osal_pwrmgr_powerconserve() 这个函数。经过下午查资料和调试,我在宏定义加入了HAL_UART_DMA=0,pwrmgr_attribute.pwrmgr_task_state可以等于0了,问题是
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 )
{
// 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 );
}
}
}
我在debug里面看到,它会不断地进入if ( pwrmgr_attribute.pwrmgr_task_state == 0 )这个判断语句,按理说进入一次就可以了,就好像有一个东西在不断的唤醒,而我查不出来。