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

📄 interrupt_func.c

📁 电能表源码
💻 C
字号:
/*************************************************************************************

	文件类型:
	文件作用:
	修改权限:
	文件相关:
	
	创 建 人:GeminiKQ
	创建日期:2006.12.20
	当前版本:Ver0.1
	
	版本信息:Ver0.1					GeminiKQ

**************************************************************************************/
#include "Tiger.h"

unsigned char u3time;
unsigned int u3timeover;
unsigned char systemflg;

/*
//======================================================
//函数功能:中断管理
//入口参数:type:1-开中断  0-关中断
//返回参数:flag_buffint改变
//======================================================
void Ctor_intrupt(unsigned char type,unsigned char num)
{ unsigned long tempdata;
  tempdata=1; 
  if(type==1)                            //开启中断
     { SetInterrupt(num);
	   tempdata=tempdata<<num;
	   flag_buffint|=tempdata;
     }
  else
     { ClrInterrupt(num);                //屏蔽中断
       tempdata=(~tempdata);
	   tempdata=tempdata<<num;
       flag_buffint&=tempdata;
     }
}
*/

//=============================================
//	中断服务子程序
//=============================================
void Int0(void)	//端口中断0(P1.3),低电平/下降沿		            中断0 
{}              
void Int1(void)	//Timer 0 interrupt									中断1 
{   TL0  = 0xff;                            //10ms
    TH0  = 0xdf;
    if(time_plusswitch<=8)                    //80ms拉闸信号
       time_plusswitch++; 
    if(sta_485comm!=standby_comm)            //500ms通讯延时
       timedelay_comm++;
    if(timocount_cf<1000)                    //CF间隔大于10s
       timocount_cf++;
}	            
void Int2(void)	//端口中断1(P1.4),低电平/下降沿		            中断2 
{}              
void Int3(void)	//Timer 1 interrupt									中断3 
{
}              
void Int4(void)	//Timer 2 interrupt									中断4 
{} 
         
void Int5(void)	//Uart 1收中断										中断5 
{ 
}              
void Int6(void)	//Uart 1发送中断									中断6 
{ 
} 
          
void Int7(void)	//UART2发送中断	 红外发送							中断7 
{ 
 	intrupt_sendinfr();		// 红外发送中断相应函数 
}  
            
void Int8(void)	//UART2接收中断	 红外接受							中断8 
{ 
    buff_intrrec=(unsigned char)RecvUData(2);  // 接收到的字节进接受缓存 
    rec_infrcomm();				   // 接收中断处理函数
}  
            
void Int9(void)	//UART4发送中断										中断9 
{ 
}

void Int10(void)//UART4接收中断										中断10
{ 
}
void Int11(void)//Timer2定时器溢出中断								中断11
{}
void Int12(void)//Timer4定时器溢出中断								中断12
{}
void Int13(void)//FLASH擦写中断										中断13
{}
void Int14(void)//CF中断											中断14
{ delay_cftime=timocount_cf;
  timocount_cf=0; 
}              
void Int15(void)//UART3发送中断										中断15
{
}              
void Int16(void)//UART3接收中断										中断16
{
}              
void Int17(void)//UART5发送中断										中断17
{//intrupt_send485();
}              
void Int18(void)//UART5接收中断										中断18
{ //buff_485rec=RecvUData(5);
  //rec_485comm();
}              
void Int19(void)//Timer3定时器溢出中断								中断19
{	
}              
void Int20(void)//Timer5定时器溢出中断								中断20
{}              
void Int21(void)//RTC秒中断											中断21
{ Flg_rtvrefresh=1;                    //置位秒刷新标志位
}              
void Int22(void)//RTC非法写入中断									中断22
{}              
void Int23(void)//PLL频率锁定中断									中断23
{}              
void Int24(void)//端口中断2(P1.1),下降沿触发						中断24
{}              
void Int25(void)//端口中断3(P1.2),下降沿触发						中断25
{}              
void Int26(void)//PLL频率错误中断									中断26
{}              
void Int27(void)//掉电中断											中断27
{}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -