This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

timer0打开之后,就关不掉了。dsp重复进入定时器中断,但我想关掉定时器啊。



 void delay(unsigned int x)
{
    count=x;
    CpuTimer0Regs.TCR.bit.TSS=0;                这是延时程序,用定时器中断做延时,调用delay的时候打开timer0,然后while一直在判断count是否为0,为0的时候说
    while(count);                                                   明定时时间到了,关闭定时器
    CpuTimer0Regs.TCR.bit.TSS=1;
 interrupt void timer0(void)
{

times++;
count--;
CpuTimer1Regs.TCR.bit.TIF = 1;                                              这是中断程序,count--,其中times是我用来统计进入中断次数用的
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;                      本例中count=100,count减到0的时候定时器并没有停止,times的值也一直再加,已经
EINT;                                                                                              超过100了。我这样想个应该没问题吧,请问定时器关不上的原因是什么呢?