|
//RCC_Configuration();
g_cout = 0;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIO_LED, ENABLE);
GPIO_Configuration();
/* Turn on Leds connected to GPIO_LED Pin 6 and Pin 8 */
GPIO_SetBits(GPIO_LED, GPIO_Pin_10);
/* NVIC configuration */
NVIC_Configuration();
//Delay_zy(0xFF0000);
/* SysTick end of count event each 1ms with input clock equal to 9MHz (HCLK/8, default) */
SysTick_SetReload(1000000);
GPIO_ResetBits(GPIOA, GPIO_Pin_3);
GPIO_ResetBits(GPIOA, GPIO_Pin_4);
SYSCLKConfig_STOP();
PWR_WakeUpPinCmd(ENABLE);
/* Enable SysTick interrupt */
SysTick_ITConfig(ENABLE);
SysTick_CounterCmd(SysTick_Counter_Enable);
while (1)
{
/* Toggle leds connected to GPIO_LED Pin 6, Pin 7, Pin 8 and Pin 9 */
GPIO_SetBits(GPIOB, GPIO_Pin_10);
/* Insert 500 ms delay */
Delay_zy(500000);
/* Toggle leds connected to GPIO_LED Pin 6, Pin 7, Pin 8 and Pin 9 */
GPIO_ResetBits(GPIOB, GPIO_Pin_10);
/* Insert 300 ms delay */
Delay_zy(500000);
}
void SysTickHandler(void)
{
//TimingDelay_Decrement();
if(g_cout==10)
{
g_cout = 0;
// GPIO_ResetBits(GPIOB, GPIO_Pin_10);
PWR_EnterSTANDBYMode();
}
g_cout++;
}
} |
|