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

📄 modctrl.c.bak

📁 该程序是NECupd78F9479的开发的代LCD的空调方案
💻 BAK
📖 第 1 页 / 共 2 页
字号:
	else					
		{
			if(f_FRZoff==1)			//if freeze have not finish,return;
				return;
			else
				{	if(C_COM3mP==0)
						{
							
							f_COMon=1;
							f_EXTon=1;							
						}
					else
						{
							return;
						}
					
				}
				
		}
}
//===========================================================================================
//                                                                                           
//===========================================================================================

//void Ch2mCHK()
//{	register unsigned char a=D_TMPrm;
//	a-=2;
//	if(a<(D_TMPset+40))
//		{M_FANsp=n_FANmid;
//		}
//}
//
//void coolLOWchk()
//{register unsigned char a=D_TMPrm;
//	//a--;
////a--;
//	if(a<=(D_TMPset+40))
//		{M_FANsp=n_FANlow;
//		}
//}
//
//
//void coolHIGHchk()
//{	register unsigned char a=D_TMPrm;
//	a-=2;
//	if(a>=(D_TMPset+40))
//	{M_FANsp=n_FANhigh;
//	}
//}
//
//void Clow2MEDchk()
//{	register unsigned char a=D_TMPrm;
//	//a--;
//	//a--;
//	if(a>(D_TMPset+40))
//		{M_FANsp=n_FANmid;
//		}
//}
//



//===========================================================================================
//                                                                                           
//===========================================================================================

void MODEauto()
{if(M_MODset==n_Mauto)
	
		
	{if(compctrl)
		{//	f_MODchk=1;
					MautoCHK();
					
					return;
				
		}
	else
		{	//	f_MODchk=1;
			MautoCHK();
						return;
				
		
					
		}
			
	}
	else
		{M_MODrun=M_MODset;
			
		//f_MODchk=1;
	
		}
}

//===========================================================================================
//                                                                                           
//===========================================================================================

void MautoCHK()
{		
		if(f_MODchk)
	{	//f_MODchk=0;
	
		//	
		//if(D_TMPrm>62)			//22
		//	{	M_MODrun=n_Mdry;
		//		D_Dsptmp=24;
		//		D_TMPset=24;
		//	//	return;
		//	}
		//	
		//if(D_TMPrm>66)
		//	{	M_MODrun=n_Mcool;
		//		D_Dsptmp=25;
		//		D_TMPset=25;
		//	//	return;
		//	}
	  //
		//if(D_TMPrm<=60)
		//{	if(f_COOLonly)
		//		{	M_MODrun=n_Mheat;
		//			D_Dsptmp=20;
		//			D_TMPset=20;
		//		//	return;
		//		}
		//	else
		//		{	M_MODrun=n_Mfan;
		//		
		//			//return;
		//		}
		//	}
		if(D_TMPrm>66)
					M_MODrun=n_Mcool;
		
		if(f_COOLonly)			
			{	if(D_TMPrm<63)
					{if(!f_1ston)				//First entry fan mode
						{		f_1ston=1;
								M_MODrun=n_Mfan;
						}					
							
					}
				if(D_TMPrm<=63&&D_TMPrm>=60)
					if(M_auto==n_Mfan)			
						M_MODrun=n_Mfan;
					else
						M_MODrun=n_Mdry;
				if(D_TMPrm<=66&&D_TMPrm>63)
						M_MODrun=n_Mdry;
			}
		else
			{if(D_TMPrm<60)
				M_MODrun=n_Mheat;
			if(D_TMPrm<=63&&D_TMPrm>=60)
					if(M_auto==n_Mheat)
						M_MODrun=n_Mheat;
					else
						M_MODrun=n_Mdry;
				if(D_TMPrm<=66&&D_TMPrm>63)
						M_MODrun=n_Mdry;				
			}
			
		if(M_auto!=M_MODrun)
			{				
			if(M_auto==n_Mheat||M_MODrun==n_Mheat)	
				{
				if(compctrl)
					{						
							f_S4on=0;
							OFF_COM();					
							C_COM6mP=0;
							//if(M_auto==n_Mheat)
							//	f_4sdelay=1;
								f_EXTon=0;
							
					}
				}
			M_auto=M_MODrun;
			}
		Action();
		
	}
}
//===========================================================================================
//                                                                                           
//===========================================================================================

void COOLctrl()
{
	if(f_PWRon)
		{
			if(M_MODrun==n_Mcool)
				{	M_FANsp=M_FANrun;			
					Sleepini();
					f_S4on=0;
					COOLcomp();
					PROTfrz();
					PROwot();
				}	
				
			
		}
}
//===========================================================================================
//                                                                                           
//===========================================================================================
void Sleepini()
{if(!f_SLPIN)
					{if(f_SLEEP)
						C_SLP1h=60;	
						C_SLPstp=2;
						f_SLPIN=1;		
					}
}


//=========================================================================================
//
//=========================================================================================
void PROwot()
{if(!f_wotin)		//entry protection
		{
			if(L_wotchk)
				{if(!f_wotcnt)
					{f_wotcnt=1;
						C_wotp=50;
					}
				else{
						if(C_wotp==0)
							{	f_wotin=1;
								O_pump_i=1;
								C_wotrun=120;
								f_wotcnt=0;
							}
						}
				}
			else
				{
					f_wotcnt=0;
					f_wotin=0;
				}
		}
	else								//exit protection
		{if(!L_wotchk)
			{if(!f_wotcnt)
					{f_wotcnt=1;
						C_wotp=50;
					}
				else{
						if(C_wotp==0)
							if(C_wotrun==0)
								{
									f_wotin=0;
									O_pump_i=0;
									f_wotcnt=0;
								}
					}
			}
			else
				f_wotcnt=0;		
			
		}
		
		
//==================================for out wot machine		
			if(!f_1stwoton)
				{
					if(O_pump_i)
						if(C_wotrun<=60)
						{	O_pump_o=1;
							f_1stwoton=1;
						}
				}
			else
				{	if(compctrl)
						O_pump_o=1;
					else
						O_pump_o=0;
				}
//==================================high wot position	check
	if(H_wotchk)
			{	if(f_highwot)
					{
							OFF_COM();
					M_FANsp=0;
					C_COM6mP=0;
					f_EXTon=0;
					O_pump_i=0;
						if(T_pbuzz==0)
								{		T_pbuzz=10;
									if(C_buzz<=7)										
										{
												BEEP1tms();
												C_buzz++;
										}
								}
						return;
					}
				C_buzz=0;	
				if(!f_wotcntx)
					{f_wotcntx=1;
						C_wotp1=50;
					}
				else{
						if(C_wotp1==0)
							{
									f_highwot=1;								
									f_wotcntx=0;
									
							}
					}
			}
	else
			{	f_highwot=0;
				f_wotcntx=0;		
			}
			
				
				
}

//===========================================================================================
//                                                                                           
//===========================================================================================


void PROTfrz()
{if(M_MODrun!=n_Mcool)
	{if(M_MODrun!=n_Mdry)		//not cool or dry mode,exit freeze mode
		CLRfrz();
	}	
	if(f_ERRTcoil)				//if coil erro,not freeze protect
		{CLRfrz();
		}
 	else
		{if(f_FRZoff )			//if freeze pro,check to exit
			EXTfrz();
		else
			{					//if freeze not ,check to entry
			if(compctrl)
				{	T_FRZstart=40;
					if(C_cmprun>=10)
					{
						if(T_FRZstart>=D_TMPcoil)		//D_TMPcoil<0 degree	one time check
								{
								
								if(!f_FRZcnt)
								{	f_FRZcnt=1;
									C_FRZ3m=n_3m1s;		//8 seconds check the coil temprature
									return;
								}
							else
								{if(C_FRZ3m==0)			//if D_TMPcoil<0 degree last 3min,comp off
										{	
											BEEP3tms();
											C_6min=0;
											C_4min=0;
											f_FRZoff=1;
											OFF_COM();
											f_EXTon=0;
											return;	
										}
								else
										{
											return;
										}
									
									}
								
							}
						else
							{	f_FRZcnt=0;
								C_FRZ3m=0;
							}
					}
				}
			else
				{
					CLRfrz();
				}
			}
		}
}
//===========================================================================================
//                                                                                           
//===========================================================================================

void COOLcomp()
{
	if(compctrl)
		{coolOFFchk();		//check comp if can maintain or not
		}
	else					//compressor is from off to open;
		{
				
				if(D_TMPrm>=(D_TMPset+40+1))
					{
					COOLon();
					C_6min=6;		//if from cool mode to dry cool or dry ,comp will continue running so C_6min=6;	 
				
					}
				else
					{	f_COMon=0;
						f_EXTon=0;
						return;
					}
				
					
		}
	}
//===========================================================================================
//                                                                                           
//===========================================================================================
	
	
void coolOFFchk()
{
	if(D_TMPrm<=(D_TMPset+40-1))
		{
				OFF_COM();
				f_EXTon=0;
		}
	else			
		{		f_COMon=1;
				f_EXTon=1;
	
		}
} 
//===========================================================================================
//                                                                                           
//===========================================================================================

void OFF_COM()
{f_COMon=0;
}
	
//===========================================================================================
//                                                                                           
//===========================================================================================
	
void OFFctrl() 
{
	
	CLRfrz();
	OFF_COM();
	M_FANsp=0;
	f_EXTon=0;
	f_MODchk=1;
	f_PTC=0;
	
	f_S4on=0;		//need delay ,if S4 is on in heat mode
	
	
}
//===========================================================================================
//                                                                                           
//===========================================================================================

void FANctrl()
{if(M_MODrun==n_Mfan)
	{OFF_COM();
		f_S4on=0;
		f_EXTon=0;
		C_COM6mP=0;
		f_S4on=0;
	//	f_FANon=1;
			//if(M_FANrun==n_FANauto)
			//	{
			//		COOLautoFAN();
			//	}
			//	else
					M_FANsp=M_FANrun;
	}
}
//===========================================================================================
//                                                                                           
//===========================================================================================

void EXTfrz()
{T_FRZend=48;
	if(C_COM3mfre==0&&T_FRZend<D_TMPcoil)		
		{CLRfrz();				//exit the freeze
		}
	else				//D_TMPcoil<10 degree
		{
		
		OFF_COM();
			f_EXTon=0;
			return;
		}
}
//===========================================================================================
//                                                                                           
//===========================================================================================

void CLRfrz()
{	f_FRZoff=0;
	f_FRZcnt=0;
	C_FRZ3m=0;
	return;
}
//void COOLautoFAN()
//{if(M_FANset==n_FANauto)
//	{if(f_ERRTrm)
//		{M_FANsp=n_FANmid;
//			return;
//		}
//	else
//		{if(M_FANsp==n_FANhigh)
//			{	Ch2mCHK();
//				coolLOWchk();
//				return;
//			}
//		else
//			{if(M_FANsp==n_FANmid)
//				{coolHIGHchk();
//				coolLOWchk();	
//				}
//			else
//				{M_FANsp=n_FANlow;
//					Clow2MEDchk();
//					coolHIGHchk();
//				}
//			}
//		}
//	}
//	else
//		M_FANsp=M_FANset;
//}

//===========================================================================================
//                                                                                           
//===========================================================================================

void DRYctrl()
{
		if(f_PWRon)
		{
			if(M_MODrun==n_Mdry)
			{ 	
				M_FANset=	M_FANsp=n_FANlow;
					f_S4on=0;
					if(C_COM3mP==0)
				{		
					f_COMon=1;
					f_EXTon=1;
				}
			
			PROTfrz();
			PROwot();
			}
		}
}
//===========================================================================================
//                                                                                           
//===========================================================================================


void OVCpro()
{	if(D_ADkey>100&&f_curtpro==0)
	{if(C_3seccurt==0)
		{	MODE_BUF=M_MODset;
			M_MODset=n_Mfan;
			if(!f_curtpro)
			{		f_crtproexit=0;
					f_curtpro=1;
					C_3mincurt=180;
					C_curtpro++;
			}	
		}
	}
else
	{if(!f_curtpro)				
		{
			C_3seccurt=3;		//if over current dont maintain for 3min ,the C_3seccurt=3;
		}
	else
		if(C_3mincurt==0)
		{		{if(D_ADkey>100)
				C_3seccurt=3;
			else
				if(C_3seccurt==0)
				{	f_curtpro=0;
					f_crtproexit=1;
				}
			}
		}
	}
	if(f_crtproexit)	
	{	if(C_3mincurt==0)
			{	M_MODset=MODE_BUF;			//if protection has maintain 3min already,protection is release . mode recover the former mode.
				f_crtproexit=0;
			}
		else
			M_MODset=n_Mfan;
	}
if(C_curtpro<6)
	{
		if(C_COM6mP==1)						//if the cmp has already run for 6min ,the protecting times should be clear to 0;
			C_curtpro=0;
	}
if(C_curtpro==6)								//if the protecting times is up to 6 times ,the set should be off only iner fan run
	{f_PWRon=0;
		//if(M_MODrun==n_Mheat)
		//C_heatfan60s=60;
	M_MODset=n_Mfan;
	}
}

//===========================================================================================
//                                                                                           
//===========================================================================================

void BEEP3tms()
{C_BUZmod=1;
	C_BUZcnt=n_01S3125x;		
}

⌨️ 快捷键说明

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