#include <reg52.h>
#include <function.h> //详见第六章第8讲
#include <timer.h>
u32 add=9999;
void
main()
{
LED_Init();
EA = 1;
TIM0_Init(1000,33);
TIM1_Init(50000,10);
while
(1)
{
ShowNumber(add);
}
}
void
TIM0_IRQHandler() interrupt 1
{
TH0 = T0RH;
TL0 = T0RL;
SEG_Scan();
}
void
TIM1_IRQHandler() interrupt 3
{
TH1 = T1RH;
TL1 = T1RL;
add++;
}