把uart调试关掉,就可以进入sleep和deep sleep了,分两步:
1、关掉uart
#define CFG_DBG_PRINT
2、在main里看LED
把while(1)换成下面的:
while(1)
{
ke_schedule();
// Checks for sleep have to be done with interrupt disabled
GLOBAL_INT_DISABLE_WITHOUT_TUNER();
// Check whether the chip can enters sleep mode
//
// Chip enter sleep condition:
// +--------+--------+--------+--------+--------+
// | USR | | | | |
// | BLE | ACTIVE | IDLE | SLEEP | DEEP |
// +--------+--------+--------+--------+--------+
// | ACTIVE | active | active | active | active |
// | IDLE | active | idle | idle | idle |
// | SLEEP | active | idle | sleep | deep |
// +--------+--------