void Osal_pwrmgr_powerconserve (void) { uint32 next; halintstate_t intstate; if (pwrmgr_attribute.pwrmgr_device! = pwrmgr_always_on)//Determine if low-power mode { if (pwrmgr_attribute.pwrmgr_task_) is turned on state = = 0) //Judgment task of <span style= "font-family:arial, Helvetica, Sans-serif;" Whether the >pwrmgr_task_state is 0</span> { hal_enter_critical_section (intstate); Next = Osal_next_timeout (); Hal_exit_critical_section (intstate); Osal_set_cpu_into_sleep (next); Enter low-Power Program}}}
The above is CC2541 into the low-power program:
1. Line set power_saving, so that the value of Pwrmgr_attribute.pwrmgr_device is not equal to pwrmgr_always_on
2. Call Osal_pwrmgr_task_state (uint8 task_id, uint8 State), the state is set to Pwrmgr_conserve, the corresponding task_id corresponding to the PWR The one in Mgr_task_state is set to 0.
This basically goes into low power.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
CC2541 Low power consumption