看这节代码吧:
i=Tim2_IRQ_CNT + (int)TIM2->CNT;
printf("%08d+%04d=%08d\r\n",Tim2_IRQ_CNT,TIM2->CNT,i);
输出结果如下,打星的两行:
00000501+8705=00009206
00000501+8784=00009285
00000501+8863=00364 *****************
00000501+8942=00009443
00000501+9021=00009522
00000501+9100=00009601
00000501+9179=00009680
00000501+9258=00759 ****************
00000501+9338=00009839
00000501+9417=00009918
00000501+9496=00009997
00000501+9575=00010076
|