片子STM32F030C8,写了个测试版本还是进不去(时钟使用的是内部HSI倍频来的),香版帮忙看下。手册里面有写Note: To enter Stop mode, all EXTI Line pending bits (in Pending register
(EXTI_PR)), all peripherals interrupt pending bits and RTC Alarm flag must
be reset. Otherwise, the Stop mode entry procedure is ignored and
program execution continues. 下面代码就初始化了GPIO,还有个TIM14定时器,开了定时器中断而已,其它外设都没有开
int main(void)
{
static u8 bSciTxdCnt = 0x00;
static u8 bBtnChkCnt = 0x00;
GPIO_Config();
TIM14_Config();
//EXIT0_Init();
//EXIT1_Init();
//EXIT2_Init();
NVIC_Config();
HalAcLedOn();
TestSingnal();
for(;;)
{
if(flag_500ms & 0x04)
{
flag_500ms &= (~0x04);
bBtnChkCnt++;
if(bBtnChkCnt >= 10)
{
bBtnChkCnt = 0x00;
ADC_Cmd(ADC1, DISABLE);
TIM_Cmd(TIM14,DISABLE);
TIM_ClearITPendingBit(TIM14, TIM_IT_Update);
sTimer14IntDis();
HalAcLedOff();
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR,ENABLE);
PWR_EnterSTOPMode(PWR_Regulator_LowPower,PWR_STOPEntry_WFE);
ADC1_CH_DMA_Config();
SystemInit();
bSciTxdCnt = 0x00;
NVIC_Config();
TIM_ClearITPendingBit(TIM14, TIM_IT_Update);
TIM_Cmd(TIM14,ENABLE);
}
}
|