#define __SYSTEM_CLOCK_IRC8M (uint32_t)(__IRC8M)
int main(void)
{
systick_config();
/* enable the LED2 GPIO clock */
rcu_periph_clock_enable(RCU_GPIOB);
gpio_init(LED_RED_PORT, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,LED_RED_GPIO);
gpio_init(LED_BLUE_PORT, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,LED_BLUE_GPIO);
LED_RED_ON;
LED_BLUE_ON;
rcu_periph_clock_enable(RCU_GPIOC);
gpio_init(FeedDog_PORT, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,FeedDog_GPIO);
while(1){
//FeedDog();
LED_RED_ON;
LED_BLUE_ON;
delay_1ms(1000);
LED_RED_OFF;
LED_BLUE_OFF;
delay_1ms(1000);
}
}
自己建的keil5工程,用的官方库,设置成了内部8M晶振,程序就是点个LED灯。结果发现编译成功,烧录成功就是等不亮。偶尔发现在烧录瞬间等会量一下,烧录完成后等会亮一下很快就没有任何反映了
|