/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include "stm32f10x_conf.h"
#include "led.h"
#include "core_cm3.h"
void delay(uint32_t count)
{
for(;count !=0 ;count--) ;
}
void SysTick_Delay_ms(uint32_t ms)
{
uint32_t i;
SysTick_Config(72000);
for(i=0; i<ms; i++)
{
while( !((SysTick->CTRL) & (1<<16)) );
}
SysTick->CTRL &= ~ SysTick_CTRL_ENABLE_Msk;
}
int main(void)
{
//SysClock_Config( RCC_PLLMul_9 ) ;
LED_GPIO_Config() ;
while(1)
{
//delay(0XFFFFF);
SysTick_Delay_ms( 100 );
LED_TOGGLE;
}
}
灯就是不闪 换成delay(0XFFFFF) 就闪了。 |