收藏1 举报
void main() { Init(); while(1) { if(GPIO_ReadInputDataBit(GPIOC, GPIO_Pin_1) == 0) { LED = 0; __WFI(); //*进入睡眠模式 LED = 1; } }
void main() { while(1) { if(GPIO_ReadInputDataBit(GPIOC, GPIO_Pin_1) == 0) { LED1 = 0; RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI); LED1 = 1; } }
void main() { Init(); while(1) { if(GPIO_ReadInputDataBit(GPIOC, GPIO_Pin_1) == 0) { LED = 0; RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); PWR_WakeUpPinCmd(ENABLE); PWR_ClearFlag(PWR_FLAG_WU); PWR_EnterSTANDBYMode(); LED = 1; } }
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
扫码关注 21ic 官方微信
扫码关注嵌入式微处理器
扫码关注电源系统设计
扫码关注21ic项目外包
扫码浏览21ic手机版
本站介绍 | 申请友情链接 | 欢迎投稿 | 隐私声明 | 广告业务 | 网站地图 | 联系我们 | 诚聘英才
京公网安备 11010802024343号