⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timer.c

📁 Keil 8051 C example RS232 to I2c
💻 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 + -