当我使用CPU的定时器来计数CLA的程序所用的时间,为什么得到的m1为负值
CpuTimer0Regs.TCR.bit.TSS = 0;
CpuTimer0Regs.TCR.bit.TSS = 1;
m1=CpuTimer0Regs.TIM.all;
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.
当我使用CPU的定时器来计数CLA的程序所用的时间,为什么得到的m1为负值
CpuTimer0Regs.TCR.bit.TSS = 0;
CpuTimer0Regs.TCR.bit.TSS = 1;
m1=CpuTimer0Regs.TIM.all;
错了,应该修改为m1=(unsigned int)CpuTimer0Regs.TIM.all;而不是m1=(unsigned int)&CpuTimer0Regs.TIM.all;
但是为什么会出现for循环的语句增多而计数器数值减小呢