#include "stm32f10x.h" #define CLOCK 72000000 unsigned int TimingDelay = 0; void SysTick_Init(void) { // 初始化SysTick SysTick_Config(CLOCK/1000); // 1ms定时器 } void delay_ms(unsigned int time) { TimingDelay = time; while(TimingDelay != 0x00); } //中断函数 void SysTick_Handler(void) { if (TimingDelay != 0x00) { TimingDelay--; } }