hi 各位:
我使用CC2540 SimpleBLEPeripheral例子。 程序在正常模式工作,现在我想要让它进入低消费。
设置:osal_pwrmgr_task_state(simpleBLEPeripheral_TaskID,PWRMGR_CONSERVE),且pwrmgr_attribute.pwrmgr_device != PWRMGR_ALWAYS_ON。
当我在如下代码红色位置设断点,发现pwrmgr_attribute.pwrmgr_task_state一直等于1,经调查是LL层脱出低消费时候设置的LL_PowerOnReq( wakeForRF );。
问题:如果我想要进入低消费,强制清除pwrmgr_attribute.pwrmgr_task_state,会不会造成数据链路层不良影响?
还有,LL_PowerOnReq( wakeForRF )函数作用是?参数作用?
void osal_pwrmgr_powerconserve( void )
{ uint32 next; halIntState_t intState;
if ( pwrmgr_attribute.pwrmgr_device != PWRMGR_ALWAYS_ON )
{
if ( pwrmgr_attribute.pwrmgr_task_state == 0 )
{
HAL_ENTER_CRITICAL_SECTION( intState );
next = osal_next_timeout();
HAL_EXIT_CRITICAL_SECTION( intState );
OSAL_SET_CPU_INTO_SLEEP( next );
}
}
}