timer2.h
来自「由单片机搞的软时钟」· C头文件 代码 · 共 83 行
H
83 行
/**************************************************************************
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 + =
减小字号Ctrl + -
显示快捷键?