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

📄 tm0.c

📁 我用ARM写的一些东西
💻 C
字号:
#include "config.h"
extern void ReadIntAd (uint8 ch);
extern void da_5628(unsigned char channel,unsigned char num);
extern void GetLeak(void);
extern void MbusDel(void);
extern void DelayNS(uint32 i);
extern void  ad_reset(void); 
extern void ad_ch_scal(unsigned char  ch,uint8 scal);
extern void ad_init(void);
extern uint8 MSPI_SendData(uint8 dat);
uint8 Cnt;
uint8 KeyRdRt;
uint8 DispRate;

uint8  Ct;
float  LkValueDyn1[120];
uint8  AdTmOut;

void __irq IRQ_Timer0 (void)
{
	uint8 i;
	
	T0IR = 0x01;
	//IRQEnable();
	//IRQDisable();				/* 清除中断标志	*/
	DisUart1;
	DisTm0;
	DisI2C0;
	DisTm1;
	DisUart0;
	//Ct++ ;
	//if (Ct>2)
	//{
		//Ct=0;
		
		DispRate++; 
		KeyRdRt++;
	    IntAdRdRt++;
		//DisI2C0;
		//GetLeak();
		AdTmOut++;
		if (AdTmOut>20)
		{	 
			 AdTmOut=0;	
			 IO0CLR = BEEP;			// BEEP	蜂鸣
			
		 
		 	Cs7705(0);
	 		ad_reset();
	
	 		ad_init();
	 
			ad_ch_scal(0,0);

			Cs7705(1);
			 
			 IO0SET = BEEP;			// BEEP停止蜂鸣	
			 DelayNS(1);		
			
		}

		
		if(AmpDly1>0)
			AmpDly1--;

		if(AmpDly2>0)
			AmpDly2--;

		if(AmpDly3>0)
			AmpDly3--;
			
		if (WarnDel1>0)	
			WarnDel1--;
			
		if (WarnDel2>0)	
			WarnDel2--;	
		if (AutoZeroTm>0)
			AutoZeroTm--;			
			
		//if (DispRate>5) 
		//{
			//DispRate=0;
			//MbusDel();
		//}
	//}
	/*if (IntAdRdRt>5)
	{
			
		for(i=1;i<6;i++)   //读取内部AD的值
		{
				
			ReadIntAd(i);
	
		}
		IntAdRdRt=0;
	}
	//ReadIntAd(0);
	//LkPtVaccum=(GetVaccum(IntAdDat[0]));
	//EnShowVcm=0;*/
	if(SysStd== LeakDtc)
 	{
 		if (EnPe!=0)
 		{	 			
 			if (StartLkDec==3)
	 		{
		 		if(LkPtVaccumMain>1)	
		 		{
		 			V2Off;V3Off;V4Off;V5Off;V6Off;
		 			SysStd=Error;
		 		}
			}		 			
			
			else if (StartLkDec==2)
	 		{
		 		if(LkPtVaccumMain>5)	
		 		{
		 			V2Off;V3Off;V4Off;V5Off;V6Off;
		 			SysStd=Error;
		 		}
			}	
			
 			else if (StartLkDec==1)
	 		{
	 			if(LkPtVaccumMain>20)
		 		{
		 			V2Off;V3Off;V4Off;V5Off;V6Off;
		 			SysStd=Error;
		 		}
		 	}	

	
	 	}
	
 	}
 	//Warn();
	//DelayNs(1);
	EnUart1;
	EnTm1;
	EnTm0;
	EnI2C0;
	//EnI2C0;
	EnUart0;
	//IRQDisable();
	VICVectAddr = 0x00;			/* 通知VIC中断处理结束*/	
						
}

⌨️ 快捷键说明

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