最近两天想弄个低功耗的实验,但是一直都没有成功,void SystemSleepIn(void)
{
RCC->APB2ENR &= (~RCC_APB2ENR_IOPAEN);
RCC->APB2ENR &= (~RCC_APB2ENR_IOPDEN);
RCC->APB2ENR &= (~RCC_APB2ENR_IOPEEN);
RCC->APB2ENR &= (~RCC_APB2ENR_IOPFEN);
RCC->APB2ENR &= (~RCC_APB2ENR_IOPGEN);
RCC->APB2ENR &= (~RCC_APB2ENR_ADC1EN);
RCC->APB2ENR &= (~RCC_APB2ENR_ADC2EN);
RCC->APB2ENR &= (~RCC_APB2ENR_TIM1EN);
RCC->APB2ENR &= (~RCC_APB2ENR_SPI1EN);
RCC->APB2ENR &= (~RCC_APB2ENR_USART1EN);
RCC->APB1ENR &= (~RCC_APB1ENR_TIM2EN);
RCC->APB1ENR &= (~RCC_APB1ENR_USART2EN);
RCC->APB1ENR &= (~RCC_APB1ENR_TIM4EN);
RCC->AHBENR &= (~RCC_AHBENR_DMA1EN);
RCC->AHBENR &= (~RCC_AHBENR_FSMCEN);
__WFI;
}
是想把外设时钟关掉再进入睡眠
但是编译,警告Source\Sample.C(459): warning: #174-D: expression has no effect这里指向__WFI
睡眠模式:看资料不懂为什么不行,有没有谁实验过类似的,指教一下呀 |