在线时间0 小时
UID263772
ST金币0
蝴蝶豆0
注册时间2007-12-21
新手上路
- 最后登录
- 1970-1-1
|
a0a.1 0b0c
SysTick设置
void SysTick_Config(void)
{
/* Disable SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Disable);
/* Disable the SysTick Interrupt */
SysTick_ITConfig(DISABLE);
/* Configure HCLK clock as SysTick clock source */
SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);
/* SysTick interrupt each 1000 Hz with HCLK equal to 72MHz */
//SysTick_SetReload(9000);
SysTick_SetReload(72000);
/* Enable the SysTick Interrupt */
SysTick_ITConfig(ENABLE);
}
void SysTickHandler(void)
{
TimingDelay_Decrement();
}
void TimingDelay_Decrement(void)
{
if (TimingDelay != 0x00)
{
TimingDelay--;
}
}
void HALMG_IntPro( unsigned char nTime ) //假设传进来的nTime =100;
{
SysTick_CounterCmd(SysTick_Counter_Enable);
TimingDelay = nTime;
while( TimingDelay )
{
HALMAG_SPITrackIntProc(); //这个自己定义的函数,可以不管
}
/* Disable SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Disable); //在程序这设置断点后跟踪发现TimingDelay =100,在while里死循环,没有启用定时器中断,请问哪里出现问题了?
/* Clear SysTick Counter */
SysTick_CounterCmd(SysTick_Counter_Clear);
}
|
|