📄 timer2.h
字号:
/**************************************************************************
THE TIMER2 LIB
COPYRIGHT (c) 2008 BY CHENSS.
-- ALL RIGHTS RESERVED --
File Name: TIMER2.H
Author: NET.XICP.CHENSS
Created: 2008/1/25
Modified: NO
Revision: 1.0
***************************************************************************/
#ifndef _TIMER2_H_
#define _TIMER2_H_
#include<reg52.h>
#include"buffer.h"
//#include""
#define TIMER_TH2 0xec
#define TIMER_TL2 0x78
void initTimer2(void)
{
EA=1;
ET2=1;
PT2=0;
TH2=TIMER_TH2;
TL2=TIMER_TL2;
TR2=1;
}
void timer2(void) interrupt 5 using 3
{
TH2=TIMER_TH2;
TL2=TIMER_TL2;
count2+=1;
if(count2==200)
{
count2=1;
}
/*if(keyIndex==30)
{
if(isMin)
{
if(count2==1)
{
timer[2]+=1;
timerIsCarry=1;
}
}else
{
timer[2]+=1;
timerIsCarry=1;
}
}
if(keyIndex==33)
{
//if(count2<50)
//{
//}
}*/
}
//*****************************************************************************
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -