原帖由萧星于2008-12-05 22:21发表:
请大家下载 学习讨论
請問上面的source code ,可以在iar ewm 5.20上執行嗎?
我的問題是執行Delay時會當機,看來systick 有問題,有人試過OK嗎?
void Delay(u32 nCount)
{
TimingDelay = nCount;
/* Enable the SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Enable);
while(TimingDelay != 0) //會當在這裏,無法繼續執行
{
}
/* Disable the SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Disable);
/* Clear the SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Clear);
}