void Delay(u32 nTime) { /* Enable the SysTick Counter 使能计数器*/ SysTick_CounterCmd(SysTick_Counter_Enable); TimingDelay = nTime; while(TimingDelay != 0); /* Disable SysTick Counter 失能计数器*/ SysTick_CounterCmd(SysTick_Counter_Disable); /* Clear SysTick Counter 清除计数器值为0*/ SysTick_CounterCmd(SysTick_Counter_Clear); } void TimingDelay_Decrement(void) { if (TimingDelay != 0x00) { TimingDelay--; } } 当nTime=9000时延时1s,这是为什么呀? |
RE:延时函数