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

📄 keypad.c

📁 mcu for gm5621带遥控,键盘输入的单片机代码.供学习参考使用.谢谢.
💻 C
📖 第 1 页 / 共 2 页
字号:
	}
	else if (keypadStatus == KEY_IR_DOWN)	
	{
	//	if (KeypadButton == BTN_IR_Down ||KeypadButton == BTN_Repeat)
	//		KeypadButton = BTN_Repeat;
	//	else
	//	{
	//		KeypadButton = BTN_IR_Down;
			gm_sendByte(Key_Down|CMD_HEAD_IR);
	//	}
	}
	else if (keypadStatus == KEY_IR_LEFT)	
	{
		gm_sendByte(Key_Left|CMD_HEAD_IR);
	}
	else if (keypadStatus == KEY_IR_RIGHT)	
	{
		gm_sendByte(Key_Right|CMD_HEAD_IR);	
	}
	else if (keypadStatus == KEY_IR_POWER)
      	{
      	  	if (KeypadButton==BTN_IR_Power || KeypadButton==BTN_Repeat)
            		KeypadButton=BTN_Repeat;
      	  	else
      	  	{

		#if 1
			if (gm_StandbyHi())
			//if (!PowerOnFlag)
			{
				//printMsg("standby high, standby high");
				Clr_gm_Standby();
				Set_DoPowerOnFlag();
				Set_PowerOnStatus();
				ForceDelay1ms(1);
				//cmd_Power_Handler = POWER_ON_SYSTEM;
			}
			else
			{
				Clr_DoPowerOnFlag();
			}
		#endif
			
            		KeypadButton=BTN_IR_Power;
		  	gm_sendByte(Key_PowerKey|CMD_HEAD_IR);
      	  	}
       }
	else if (keypadStatus == KEY_IR_SOURCESWITCH)
      	{
      	  	//if (KeypadButton==BTN_IR_SourceSwitch || KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_SourceSwitch;
		  	gm_sendByte(Key_SourceKey|CMD_HEAD_IR);
      	  	//}
        }
      	else if (keypadStatus == KEY_IR_MENUENTER)
      	{
      	  	//if (KeypadButton==BTN_IR_MenuEnter || KeypadButton==BTN_Repeat)
      	  	//{
		//	KeypadButton=BTN_Repeat;
      	  	//}
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_MenuEnter;
			gm_sendByte(Key_MenuEnter|CMD_HEAD_IR);
        	//}
      	}
      	else if (keypadStatus == KEY_IR_MUTE)
      	{
      	  	//if (KeypadButton==BTN_IR_Mute || KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else{
            	//	KeypadButton=BTN_IR_Mute;
			gm_sendByte(Key_Mute|CMD_HEAD_IR);
      	  	//}
      	}
      	else if (keypadStatus == KEY_IR_AUTOCOLOR)
      	{
      	  	//if (KeypadButton==BTN_IR_AutoColor || KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_AutoColor;
			gm_sendByte(Key_ADC_1_AUTO|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_ENTERKEY)
      	{
      	  	//if (KeypadButton==BTN_IR_EnterKey|| KeypadButton==BTN_Repeat)
            		//KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            		//KeypadButton=BTN_IR_EnterKey;
			gm_sendByte(Key_EnterKey|CMD_HEAD_IR);
      	  	//}
      	}
	else if(keypadStatus==KEY_IR_RETURN)
       {
		gm_sendByte(Key_Exit|CMD_HEAD_KEY);
       }
	else if (keypadStatus == KEY_IR_ASPECT)
      	{
      	  	//if (KeypadButton==BTN_IR_Aspect|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Aspect;
			gm_sendByte(Key_Aspect|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_TELETEXT_CC)
      	{
      	  	//if (KeypadButton==BTN_IR_Teletext_CC|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Teletext_CC;
			gm_sendByte(Key_Teletext_CC|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_INFO)
      	{
      	  	//if (KeypadButton==BTN_IR_Info|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Info;
			gm_sendByte(Key_Info|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_F1)
      	{
      	  	//if (KeypadButton==BTN_IR_F1|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_F1;
			gm_sendByte(Key_F1|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_F2)
      	{
      	  	//if (KeypadButton==BTN_IR_F2|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_F2;
			gm_sendByte(Key_F2|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_F3)
      	{
      	  	//if (KeypadButton==BTN_IR_F3|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_F3;
			gm_sendByte(Key_F3|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_F4)
      	{
      	  	//if (KeypadButton==BTN_IR_F4|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_F4;
			gm_sendByte(Key_F4|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_HOLD)
      	{
      	  	//if (KeypadButton==BTN_IR_Hold|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Hold;
			gm_sendByte(Key_Hold|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_REVEAL)
      	{
      	  	//if (KeypadButton==BTN_IR_Reveal|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Reveal;
			gm_sendByte(Key_Reveal|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_SIZE)
      	{
      	  	//if (KeypadButton==BTN_IR_Size|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Size;
			gm_sendByte(Key_Size|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_CANCEL)
      	{
      	  	//if (KeypadButton==BTN_IR_Cancel|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Cancel;
			gm_sendByte(Key_Cancel|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_MODE)
      	{
      	  	//if (KeypadButton==BTN_IR_Mode|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Mode;
			gm_sendByte(Key_Mode|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_INDEX)
      	{
      	  	//if (KeypadButton==BTN_IR_Index|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Index;
			gm_sendByte(Key_Index|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_SWAP)
      	{
      	  	//if (KeypadButton==BTN_IR_Swap|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Swap;
			gm_sendByte(Key_IR_SWAP|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_PIP_SIZE)
      	{
      	  	//if (KeypadButton==BTN_IR_PIP_Size|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_PIP_Size;
			gm_sendByte(Key_PIP_Size|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_SUB)
      	{
      	  	//if (KeypadButton==BTN_IR_Sub|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Sub;
			gm_sendByte(Key_Sub|CMD_HEAD_IR);
      	  	//}
      	}  
	else if (keypadStatus == KEY_IR_FREEZE)
      	{
      	  	//if (KeypadButton==BTN_IR_Freeze|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Freeze;
			gm_sendByte(Key_Freeze|CMD_HEAD_IR);
      	  	//}
      	}
	else if (keypadStatus == KEY_IR_AUDIOMODE)
      	{
      	  	//if (KeypadButton==BTN_IR_Freeze|| KeypadButton==BTN_Repeat)
            	//	KeypadButton=BTN_Repeat;
      	  	//else
      	  	//{
            	//	KeypadButton=BTN_IR_Freeze;
			//gm_sendByte(Key_IR_AudioMode|CMD_HEAD_IR);
      	  	//}
      	}



 
	//=====================================================
      		else
      		{
      	
      			KeypadButton=BTN_Nothing;
		
      		}
    	}
  	else
    	{
		if(!IR_ErrTimeCount)
		{	
			KeypadButton=BTN_Nothing;	
		}
	}

}

⌨️ 快捷键说明

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