/* Wait till PLL is ready */ while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) { }
/* Select PLL as system clock source */ RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */ while(RCC_GetSYSCLKSource() != 0x08) { } } } -----------------------------------------------------------------
----------------------------------------------------------------- //例程中的while(1)程序 while (1) { /* Insert 1.5 second delay */ Delay(1500);//唤醒之后的延时!!
/* Wait till RTC Second event occurs */ RTC_ClearFlag(RTC_FLAG_SEC); while(RTC_GetFlagStatus(RTC_FLAG_SEC) == RESET);
/* Alarm in 3 second */ RTC_SetAlarm(RTC_GetCounter()+ 3); /* Wait until last write operation on RTC registers has finished */ RTC_WaitForLastTask();
/* Turn off led connected to GPIO_LED Pin6 */ GPIO_ResetBits(GPIO_LED, GPIO_Pin_6);
/* Request to enter STOP mode with regulator in low power mode*/ PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
/* At this stage the system has resumed from STOP mode /* Turn on led connected to GPIO_LED Pin6 */ GPIO_SetBits(GPIO_LED, GPIO_Pin_6);
/* Configures system clock after wake-up from STOP: enable HSE, PLL and select PLL as system clock source (HSE and PLL are disabled in STOP mode) */ SYSCLKConfig_STOP(); } }