📄 key.c
字号:
#include "indash.h"
extern char Current_Status;
extern char PICSEL_Next_Mode;
extern char Down_Time_Flag;
extern char Mute_Flag;
extern char Down_Time_Cnt;
extern char Color_Value;
extern char Tint_Value;
extern char Bright_Value;
extern char Contrast_Value;
extern char Dimmer_Value;
extern bit Rearview_OnOff;
extern bit Rearview_Enable;
void Read_Key(void)
{
static int cnt = 0;
static char flag1 = 0;
static char flag2 = 0;
static char flag3 = 0;
static char flag4 = 0;
static char flag5 = 0;
if (cnt++ > 500)
{
cnt = 0;
if (POWER_KEY == 0 && flag1)
{
flag1 = False;
Key_Power();
Down_Time_Flag = True;
Down_Time_Cnt = 0;
}
else if (POWER_KEY)
flag1 = True;
if (MENU_KEY == 0 && flag2)
{
flag2 = False;
Key_PICSEL();
Down_Time_Flag = True;
Down_Time_Cnt = 0;
}
else if (MENU_KEY)
flag2 = True;
if (ZOOM_KEY == 0 && flag5)
{
flag5 = False;
Down_Time_Flag = True;
Down_Time_Cnt = 0;
Current_Status = IS_SET_ZOOM;
PICSEL_Next_Mode = ZOOM_MODE;
Reset_OSD();
Key_Volume_Up();
}
else if (ZOOM_KEY)
flag5 = True;
if (UP_KEY)
{
flag3 = 0;
}
else
{
if (flag3 > 15)
{
flag3 = 15;
Key_Volume_Up();
Down_Time_Flag = True;
Down_Time_Cnt = 0;
}
if (flag3 == 0)
{
Key_Volume_Up();
Down_Time_Flag = True;
Down_Time_Cnt = 0;
}
flag3++;
}
if (DOWN_KEY)
{
flag4 = 0;
}
else
{
if (flag4 > 15)
{
flag4 = 15;
Key_Volume_Down();
Down_Time_Flag = True;
Down_Time_Cnt = 0;
}
if (flag4 == 0)
{
Key_Volume_Down();
Down_Time_Flag = True;
Down_Time_Cnt = 0;
}
flag4++;
}
}
}
void Key_Power(void)
{
if (Current_Status == IS_POWER_OFF)
{
Power_ON();
Mute_Enable();
Delay(1000);//1000
Mute_Enable();
OSD_Init();
DA_88347_Init();
Delay(3000);//Added for Panel delay
LIGHT_POWER = ENABLE;
Reset_OSD();
#ifdef Rearview //deleted by Wayland 2006.10.27
if(!Rearview_Enable)
Select_Input();
else
Mute_Disable();//Added by Waylalnd 20006.11.6
#else
Select_Input();
#endif
Current_Status = IS_NORMAL;
}
else
#ifdef Rearview //Modified by Wayland 2006.10.26
if(Rearview_OnOff==OFF)
Power_OFF();
#else
Power_OFF();
#endif
}
void Show_PICSEL(void)
{
Reset_OSD();
switch(PICSEL_Next_Mode)
{
case GM1_MODE:
Current_Status = IS_SET_GM1;
Show_GM1();
break;
case GM2_MODE:
Current_Status = IS_SET_GM2;
Show_GM2();
break;
case RGBAMP_MODE:
Current_Status = IS_SET_RGBAMP;
Show_RGBAMP();
break;
case FM_MODE:
Current_Status = IS_SET_FM;
Show_FM();
break;
case POWER_MODE:
Current_Status = IS_SET_POWER_MODE;
Show_Power_Mode();
break;
case CONTRAST_MODE:
Current_Status = IS_SET_CONTRAST;
Show_Contrast();
break;
case BRIGHT_MODE:
Current_Status = IS_SET_BRIGHT;
Show_Bright();
break;
case PICTURE_MODE:
Current_Status = IS_SET_PICTURE;
Show_PICTURE();
break;
case COMAD_MODE:
Current_Status = IS_SET_COMAD;
Show_COMAD();
break;
case R_L_MODE:
Current_Status = IS_SET_R_L;
Show_R_L();
break;
case COLOR_MODE:
Current_Status = IS_SET_COLOR;
Show_Color();
break;
case ZOOM_MODE:
Current_Status = IS_SET_ZOOM;
Show_ZOOM();
break;
case DIMMER_MODE:
Current_Status = IS_SET_DIMMER;
Show_Dimmer();
break;
case TINT_MODE:
Current_Status = IS_SET_TINT;
Show_Tint();
break;
case RESET_PICTURE_MODE:
Current_Status = IS_RESET;
Show_Reset();
break;
case SPEAKER_MODE:
Current_Status = IS_SET_SPEAKER;
Show_Speaker();
break;
#ifdef Rearview //added by Wayland 2006.10.28
case REARVIEW_MODE:
Current_Status=IS_REARVIEW_ENABLE;
Show_Rearview();
break;
#endif
}
}
void Key_PICSEL(void)
{
switch(Current_Status)
{
case IS_SET_GM1:
case IS_SET_GM2:
case IS_SET_RGBAMP:
case IS_SET_TINT:
case IS_SET_POWER_MODE:
case IS_SET_FM:
case IS_SET_BRIGHT:
case IS_SET_CONTRAST:
case IS_SET_ZOOM:
case IS_SET_COLOR:
case IS_SET_DIMMER:
case IS_SET_PICTURE:
case IS_SET_COMAD:
case IS_SET_R_L:
case IS_SET_AV_IN:
case IS_SET_IR_IN:
case IS_SET_SPEAKER:
case IS_RESET:
#ifdef Rearview //added by Wayland 2006.10.26
case IS_REARVIEW_ENABLE:
#endif
PICSEL_Next_Mode++;
if (PICSEL_Next_Mode == TINT_MODE)
if (!NPC)
PICSEL_Next_Mode++;
if (PICSEL_Next_Mode > SETUP_MAX)
PICSEL_Next_Mode = 0;
break;
}
Show_PICSEL();
}
void Key_Mute(void)
{
if (Current_Status != IS_POWER_OFF)
{
Mute_Flag = Mute_Flag^1;
if (Mute_Flag)
Mute_Enable();
else
Mute_Disable();
Return_Normal();
}
}
//#ifndef Rearview //delete by Wayland 06.10.27
void Select_Input()
{
char sel;
Mute_Enable();
sel = EEPROM_Receive_25_Bit(OP_READ, EE_TV_AV_ADDR);
Set_AV_IN(sel);
Set_IR_IN(EEPROM_Receive_25_Bit(OP_READ, EE_IR_IN_ADDR));
Reset_OSD();
switch(sel)
{
case MAV1_MODE:
Printxy_Normal( 0, 0, "M-VIDEO 1", FONT_GREEN);
break;
case MAV2_MODE:
Printxy_Normal( 0, 0, "M-VIDEO 2", FONT_GREEN);
break;
case MAV3_MODE:
Printxy_Normal( 0, 0, "M-VIDEO 3", FONT_GREEN);
break;
}
Mute_Disable();
}
void Key_TV_AV(void)
{
if (Current_Status != IS_POWER_OFF)
{
Current_Status = IS_NORMAL;
if (EEPROM_Receive_25_Bit(OP_READ, EE_TV_AV_ADDR))
EEPROM_Transmit_25_Bit(OP_WRITE, EE_TV_AV_ADDR,False);
else
EEPROM_Transmit_25_Bit(OP_WRITE, EE_TV_AV_ADDR, True);
Select_Input();
}
}
//#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -