芯片睡眠的决定条件有两个:
// +--------+--------+--------+--------+--------+
// | USR | | | | |
// | BLE | ACTIVE | IDLE | SLEEP | DEEP |
// +--------+--------+--------+--------+--------+
// | ACTIVE | active | active | active | active |
// | IDLE | active | idle | idle | idle |
// | SLEEP | active | idle | sleep | deep |
// +--------+--------+--------+--------+--------+
一、在main() 里的主循环while(1)里,先拿到user sleep的值,再判断芯片要进入哪个睡眠模式:
usr_sleep_st = usr_sleep();
1、分析usr_sleep:
/**
****************************************************************************************
* @brief Check application whether to enter sleep mode
* @return sleep allowed status
****************************************************************************************
*/
int usr_