?? timer.c
字號:
#include <at89x52.H> // SFR definition header file
#include <stdio.h> // prototype declarations for I/O functions
#include <rtx51tny.h> /* RTX-51 tiny functions & defines */
#include "function.h"
#include "SystemEvent.h"
#include "UART.h"
#include "ExtVar.h"
/*
void InitTimer2( unsigned char _Timer2ModeX, unsigned int _T2LoopX){
_T2IncX=0; _T2IncY=0;
_T2Loop=_T2LoopX;
Timer2Mode=_Timer2ModeX;
TH2 =0x00;// (unsigned char) PERIOD; // set timer period
TL2 = 0x00;//(unsigned char) PERIOD;
RCAP2L =0x00;
RCAP2H =0x00;
CP_RL2=0;
C_T2=0;
TR2=1;
ET2 =1; // enable timer 0 interrupt
EA = 1; // global interrupt enable
// global interrupt enable
}
void timer2 (void) interrupt 5 using 3 {
TR2=0;_T2IncX++;
if(_T2IncX==_T2Loop){ _T2IncX=0;
_T2IncY++;
if(_T2IncY>0xc0){ _T2IncY=0;
// *_LEDH++;
switch(Timer2Mode){
case _Timer2ForRepeatKeyDetect:
Timer2Mode= _Timer2DetectRepeatKey;
_T2IncX=0; _T2IncY=0;
_T2Loop=0x02;
break;
case _Timer2DetectRepeatKey:
isr_send_signal(3);
break;
default:
break;
}
}}
TR2=1;
}
*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -