Src_Ctrl.i
上传用户:xmyjxjd
上传日期:2013-05-04
资源大小:1517k
文件大小:19k
- #line 1 "CodeSrc_Ctrl.c" /0
-
-
-
- #line 1 "HeaderLcd_main.h" /0
-
- #line 1 "HEADERTimer.h" /0
-
- #line 1 "HEADERMain_def.h" /0
-
- #line 1 "HEADERCHAR_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERMODE_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 2 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERRTD_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 3 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERCODE_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 4 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 144 "HEADERMain_def.h" /1
-
-
-
-
-
-
-
-
-
-
-
- #line 155 "HEADERMain_def.h" /0
-
-
- #line 157 "HEADERMain_def.h" /1
-
-
- #line 159 "HEADERMain_def.h" /0
-
-
-
-
- #line 163 "HEADERMain_def.h" /1
-
-
- #line 165 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 270 "HEADERMain_def.h" /1
-
-
- #line 272 "HEADERMain_def.h" /0
-
- #line 273 "HEADERMain_def.h" /1
-
-
- #line 275 "HEADERMain_def.h" /0
-
- #line 276 "HEADERMain_def.h" /1
-
-
- #line 278 "HEADERMain_def.h" /0
-
- #line 279 "HEADERMain_def.h" /1
-
-
- #line 281 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1 "HEADERTimer.h" /0
-
-
-
-
-
-
-
-
- #line 9 "HEADERTimer.h" /1
-
-
-
-
- #line 13 "HEADERTimer.h" /0
-
-
-
-
-
-
-
- #line 20 "HEADERTimer.h" /1
-
-
-
-
-
- #line 25 "HEADERTimer.h" /0
-
-
-
-
-
-
-
-
-
-
- #line 35 "HEADERTimer.h" /1
-
-
-
-
-
-
- #line 41 "HEADERTimer.h" /0
-
-
- #line 43 "HEADERTimer.h" /1
-
-
-
-
-
-
-
-
- #line 68 "HEADERTimer.h" /0
-
- extern bit bNotify_Timer0_Int;
- extern bit bNotify_Timer1_Int;
- extern void Delay_Xms(unsigned char x);
-
- #line 1 "HeaderLcd_main.h" /0
-
-
- #line 1 "HEADERPower_Ctrl.h" /0
-
-
-
-
-
-
-
-
-
-
-
- #line 12 "HEADERPower_Ctrl.h" /1
-
-
-
-
-
-
-
-
- #line 20 "HEADERPower_Ctrl.h" /0
-
- extern bit bPower_Status;
- extern bit bPanel_Status;
-
- extern void PowerDown_ADC(void);
- extern void PowerUp_ADC(void);
- extern void PowerDown_VDC(void);
- extern void PowerUp_VDC(void);
- extern void PowerDown_LVDS(void);
- extern void PowerUp_LVDS(void);
- extern void PowerDown_TMDS(void);
- extern void PowerUp_TMDS(void);
-
- extern void Set_Panel(unsigned char status);
- extern bit Power_Control(unsigned char Notify);
-
-
-
-
- #line 2 "HeaderLcd_main.h" /0
-
-
- #line 1 "HEADERMode_Detect.h" /0
-
- #line 2 "HEADERMode_Detect.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 64 "HEADERMode_Detect.h" /0
-
- extern bit bVpole_Curr;
- extern bit bHpole_Curr;
- extern bit bStable;
- extern bit bOverSpec;
-
- extern unsigned int idata usHsync;
- extern unsigned int idata usStdHS;
- extern unsigned int idata usVsync;
- extern unsigned char idata ucMode_Curr;
- extern unsigned char idata ucMode_Found;
- extern unsigned char idata ucMode_Times;
- extern unsigned char idata ucAV_Mode;
- extern unsigned char idata ucInputSrc;
- extern unsigned char idata ucRefresh;
- extern unsigned char idata ucModeCnt;
- extern unsigned char idata ucSync_Type;
- extern void Mode_Detector(void);
- extern void Measure_Mode(void);
- extern void Measure_Source(unsigned char SOURCE);
- extern void Input_Mode_Detector(void);
- extern unsigned char idata ucPE_Level;
- extern unsigned char idata ucCE_Value;
-
- extern void New_Mode_Auto(void);
- extern unsigned int idata ucfrist ;
-
-
- #line 3 "HeaderLcd_main.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 32 "HeaderLcd_main.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 86 "HeaderLcd_main.h" /0
-
-
- extern bit bReload;
-
-
- #line 91 "HeaderLcd_main.h" /1
-
-
-
- #line 94 "HeaderLcd_main.h" /0
-
- extern unsigned int idata usOSD_Timer;
- extern unsigned int idata usTaskCnt;
- extern unsigned char idata ucID_Code;
-
-
-
-
- extern void ISP_Check_Sum(void);
- extern void Set_Task(unsigned char state);
-
-
-
- #line 3 "CodeSrc_Ctrl.c" /0
-
-
- #line 1 "HeaderLcd_func.h" /0
-
- #line 1 "HEADERMain_def.h" /0
-
- #line 1 "HEADERCHAR_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERMODE_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 2 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERRTD_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 3 "HEADERMain_def.h" /0
-
-
- #line 1 "HEADERCODE_DEF.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 4 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 144 "HEADERMain_def.h" /1
-
-
-
-
-
-
-
-
-
-
-
- #line 155 "HEADERMain_def.h" /0
-
-
- #line 157 "HEADERMain_def.h" /1
-
-
- #line 159 "HEADERMain_def.h" /0
-
-
-
-
- #line 163 "HEADERMain_def.h" /1
-
-
- #line 165 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 270 "HEADERMain_def.h" /1
-
-
- #line 272 "HEADERMain_def.h" /0
-
- #line 273 "HEADERMain_def.h" /1
-
-
- #line 275 "HEADERMain_def.h" /0
-
- #line 276 "HEADERMain_def.h" /1
-
-
- #line 278 "HEADERMain_def.h" /0
-
- #line 279 "HEADERMain_def.h" /1
-
-
- #line 281 "HEADERMain_def.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1 "HeaderLcd_func.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- typedef struct _GLOBAL_USER_DATA0
- {
- unsigned char CONTRAST;
- unsigned char BRIGHT;
- unsigned char RTD_R_CONTRAST;
- unsigned char RTD_G_CONTRAST;
- unsigned char RTD_B_CONTRAST;
- unsigned char RTD_R_BRIGHT;
- unsigned char RTD_G_BRIGHT;
- unsigned char RTD_B_BRIGHT;
- }
- GLOBAL_USER_DATA0, *LP_GLOBAL_USER_DATA0;
-
- typedef struct _GLOBAL_USER_DATA1
- {
- unsigned char FUNCTION;
-
-
-
-
-
-
-
-
-
-
-
-
-
- unsigned char INPUT_SOURCE;
-
-
-
-
-
-
-
-
-
-
- unsigned char FILTER;
- unsigned int OSD_POSH;
- unsigned char OSD_POSV;
- unsigned char OSD_TIMEOUT;
-
- unsigned char OSD_INPUT;
-
-
-
- }
- GLOBAL_USER_DATA1, *LP_GLOBAL_USER_DATA1;
-
-
- typedef struct _GLOBAL_USER_DATA2
- {
- unsigned char AD_R_GAIN;
- unsigned char AD_G_GAIN;
- unsigned char AD_B_GAIN;
- unsigned char AD_R_OFFSET;
- unsigned char AD_G_OFFSET;
- unsigned char AD_B_OFFSET;
- }
- GLOBAL_USER_DATA2, *LP_GLOBAL_USER_DATA2;
-
- typedef struct _GLOBAL_USER_DATA3
- {
- unsigned char VOLUME;
- unsigned char CURR_CHANNEL;
- unsigned char PREV_CHANNEL;
- unsigned char TV_SETTING;
-
-
-
-
-
-
-
-
-
-
-
- unsigned char SPREAD;
- }
- GLOBAL_USER_DATA3, *LP_GLOBAL_USER_DATA3;
-
- typedef struct _GLOBAL_USER_DATA4
- {
- unsigned char C1_R;
- unsigned char C1_G;
- unsigned char C1_B;
- unsigned char C2_R;
- unsigned char C2_G;
- unsigned char C2_B;
- unsigned char C3_R;
- unsigned char C3_G;
- unsigned char C3_B;
- }
- GLOBAL_USER_DATA4, *LP_GLOABL_USER_DATA4;
-
- typedef struct _RGB_MODE_USER_DATA
- {
- unsigned char H_POSITION;
- unsigned char V_POSITION;
- unsigned char CLOCK;
- unsigned char PHASE;
- }
- RGB_MODE_USER_DATA, *LP_RGB_MODE_USER_DATA;
-
- typedef struct _VIDEO_MODE_USER_DATA
- {
- unsigned char VBRIGHT;
- unsigned char VCONTRAST;
- unsigned char VSATURATION;
- unsigned char VHUE;
- }
- VIDEO_MODE_USER_DATA, *LP_VIDEO_MODE_USER_DATA;
-
-
-
- #line 134 "HeaderLcd_func.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 313 "HeaderLcd_func.h" /0
-
-
-
-
- extern GLOBAL_USER_DATA0 data stGUD0;
- extern GLOBAL_USER_DATA1 data stGUD1;
- extern GLOBAL_USER_DATA2 data stGUD2;
- extern GLOBAL_USER_DATA3 data stGUD3;
- extern GLOBAL_USER_DATA4 data stGUD4;
- extern RGB_MODE_USER_DATA data stMUD;
-
- extern unsigned int idata usIPH_ACT_STA;
- extern unsigned int idata usIPV_ACT_STA;
- extern unsigned int idata usIPH_ACT_WID;
- extern unsigned int idata usIPV_ACT_LEN;
-
- extern unsigned int idata usADC_Clock;
- extern unsigned int idata usDH_Total;
- extern unsigned int idata usDV_Total;
- extern unsigned char idata ucDV_Delay;
-
- extern unsigned char idata ucV_Max_Margin;
- extern unsigned char idata ucV_Min_Margin;
- extern unsigned char idata ucH_Max_Margin;
- extern unsigned char idata ucH_Min_Margin;
- extern unsigned char idata UartNum;
- extern unsigned char idata UartData[4];
-
-
-
- extern void SetMute(bit val);
- extern void SetVolume();
-
- extern void WriteGamma(unsigned char code *arrayR, unsigned char code *arrayG, unsigned char code *arrayB);
- extern void WriteDither(unsigned char code *array);
- extern void WriteSU_COEF(unsigned char code *arrayH, unsigned char code *arrayV);
-
- extern void Set_H_Position(void);
- extern void Set_V_Position(void);
- extern void Set_Clock(void);
- extern void Set_Phase(unsigned char phase);
- extern void Set_Bright_Contrast(void);
- extern void Set_Gamma(void);
- extern void Set_Dithering(void);
- extern void Sharpness(void);
- extern void Set_Mode_Params(void);
-
- extern void SetADC_VCO(unsigned char ucRate);
- extern void SetADC_Gain(void);
- extern void SetADC_Offset(void);
- extern void SetADC_GainOffset(void);
-
- #line 365 "HeaderLcd_func.h" /1
-
-
- #line 367 "HeaderLcd_func.h" /0
-
- extern void Wait_For_Event(unsigned char event);
-
-
-
- extern void Save_GUD0(void);
- extern void Load_GUD0(void);
- extern void Save_GUD1(void);
- extern void Load_GUD1(void);
- extern void Save_GUD2(void);
- extern void Load_GUD2(void);
- extern void Save_GUD3(void);
- extern void Load_GUD3(void);
- extern void Save_GUD4(void);
- extern void Load_GUD4(void);
- extern void Save_MUD(unsigned char mode_num);
- extern void Load_MUD(unsigned char mode_num);
- extern void Init_GUD(void);
- extern void Init_MUD(void);
- extern void Check_EEPROM(void);
- extern unsigned char code INIT_EEPROM2[];
- extern void RTD_Test(void);
- extern void Free_Background(void);
- extern void Reset_Mode(void);
-
-
-
- extern void Set_Spread(void);
- extern void Init_FACTORY(void);
- extern void Init_FRecall(void);
-
-
-
-
-
- #line 402 "HeaderLcd_func.h" /1
-
-
-
-
- #line 406 "HeaderLcd_func.h" /0
-
-
- #line 4 "CodeSrc_Ctrl.c" /0
-
-
- #line 1 "HeaderMode_Detect.h" /0
-
- #line 2 "HeaderMode_Detect.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 64 "HeaderMode_Detect.h" /0
-
- extern bit bVpole_Curr;
- extern bit bHpole_Curr;
- extern bit bStable;
- extern bit bOverSpec;
-
- extern unsigned int idata usHsync;
- extern unsigned int idata usStdHS;
- extern unsigned int idata usVsync;
- extern unsigned char idata ucMode_Curr;
- extern unsigned char idata ucMode_Found;
- extern unsigned char idata ucMode_Times;
- extern unsigned char idata ucAV_Mode;
- extern unsigned char idata ucInputSrc;
- extern unsigned char idata ucRefresh;
- extern unsigned char idata ucModeCnt;
- extern unsigned char idata ucSync_Type;
- extern void Mode_Detector(void);
- extern void Measure_Mode(void);
- extern void Measure_Source(unsigned char SOURCE);
- extern void Input_Mode_Detector(void);
- extern unsigned char idata ucPE_Level;
- extern unsigned char idata ucCE_Value;
-
- extern void New_Mode_Auto(void);
- extern unsigned int idata ucfrist ;
-
-
- #line 5 "CodeSrc_Ctrl.c" /0
-
-
- #line 1 "HeaderInitial.h" /0
-
- #line 2 "HeaderInitial.h" /1
-
-
-
-
-
- #line 7 "HeaderInitial.h" /0
-
- extern void MCU_Init(void);
- extern void Firmware_Init(void);
- extern void Power_Up_Init(void);
- extern void Reset_RTD(void);
- extern void Init_Input_Source(void);
- extern void Power_Status_Init(void);
-
-
- #line 6 "CodeSrc_Ctrl.c" /0
-
-
- #line 1 "HeaderSrc_Ctrl.h" /0
-
-
-
- bit bSourceScanEnable = 0;
-
-
- unsigned char idata ucNext_Source = 0;
- unsigned char idata ucSource_Times = 0;
-
-
-
-
- #line 13 "HeaderSrc_Ctrl.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 7 "CodeSrc_Ctrl.c" /0
- #line 7 "CodeSrc_Ctrl.c" /0
-
-
- #line 1 "HeaderAccess.h" /0
-
-
-
- #line 4 "HeaderAccess.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 90 "HeaderAccess.h" /0
-
-
- extern unsigned char data Data[16];
-
-
- extern void BitDly(void);
- extern void SetPortBit(unsigned char port, unsigned char and, unsigned char or);
- extern void SetSFRPort(unsigned char port, unsigned char Data);
- extern unsigned char GetSFRPort(unsigned char port);
-
- extern unsigned char I2CGetByte(unsigned char ack);
- extern void I2CSendByte(unsigned char send);
- extern void I2CSendAddr(unsigned char addr, unsigned char index ,unsigned char rd);
- extern void I2CSendStop(void);
- extern void I2CRead(unsigned char addr, unsigned char index, unsigned char count);
- extern void I2CWrite(unsigned char *array);
-
- extern unsigned char RTDGetByte(void);
- extern void RTDSendByte(unsigned char send);
- extern void RTDSendAddr(unsigned char addr, unsigned char rd, unsigned char inc);
- extern void RTDRead(unsigned char index, unsigned char count, unsigned char inc);
- extern void RTDWrite(unsigned char data *array);
- extern void RTDCodeW(unsigned char code *array);
- extern void RTDOSDW(unsigned char code *array);
- extern void RTDOSDW(unsigned char code *array);
-
- extern void RTDSetBit(unsigned char addr,unsigned char and, unsigned char or);
- extern void RTDSetByte(unsigned char addr, unsigned char val);
-
-
- extern void Load_Font(unsigned char code *array, unsigned int start, unsigned int length);
- extern void Load_VLC_Font(unsigned char code *array, unsigned int start, unsigned int length);
-
-
- #line 124 "HeaderAccess.h" /1
-
-
- #line 126 "HeaderAccess.h" /0
-
-
- #line 128 "HeaderAccess.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 159 "HeaderAccess.h" /0
-
-
- #line 8 "CodeSrc_Ctrl.c" /0
-
-
- bit Source_Control(void)
- {
- if ((stGUD1.INPUT_SOURCE & 0x07) != ucInputSrc)
- {
- stGUD1.INPUT_SOURCE = (stGUD1.INPUT_SOURCE & 0xf8) | (ucInputSrc & 0x07);
- Save_GUD1();
-
- ucModeCnt = 2;
-
- Reset_Mode();
-
-
- Init_Input_Source();
- Measure_Mode();
-
- Set_Task(1);
-
- bNotify_Timer0_Int = 0;
-
-
- return 1;
- }
- return 0;
- }
-
- void Change_Source(unsigned char source)
- {
- if (1 < source) return;
-
- if (0 == source)
- {
- ucInputSrc = 0;
- }
- else if (1 == source)
- {
-
- ucInputSrc = 1;
-
- #line 48 "CodeSrc_Ctrl.c" /1
-
-
- #line 50 "CodeSrc_Ctrl.c" /0
- }
- else if (2 == source || 3 == source)
- {
-
- #line 54 "CodeSrc_Ctrl.c" /1
-
-
- #line 56 "CodeSrc_Ctrl.c" /0
- ucInputSrc = 0;
-
- }
- else if (4 == source)
- {
-
- #line 62 "CodeSrc_Ctrl.c" /1
-
-
- #line 64 "CodeSrc_Ctrl.c" /0
- ucInputSrc = 0;
-
- }
- else
- {
-
- #line 70 "CodeSrc_Ctrl.c" /1
-
-
- #line 72 "CodeSrc_Ctrl.c" /0
- ucInputSrc = 0;
-
- }
- }
-
-
- void Source_Auto_Scan(void)
- {
-
- Data[0] = stGUD1.INPUT_SOURCE & 0x07;
- if((Data[0] == 0) || (Data[0] == 1) || (Data[0] == 3))
- bSourceScanEnable = !bSourceScanEnable;
-
- if(!bSourceScanEnable)
- Mode_Detector();
-
- if(bStable && bSourceScanEnable)
- {
-
- Measure_Source(ucNext_Source);
-
- if((ucNext_Source == 0) || (ucNext_Source == 1))
- {
- RTDRead(0x4C, 0x09, 0);
-
- if(Data[0] & 0x02)
- {
- RTDSetByte(0x4C,0x20);
- Data[2] = 0x80;
- Data[4] = 0x80;
- }
-
- if(((Data[4] & 0x80) != 0x80) && ((Data[2] & 0x80) != 0x80))
- {
- Data[5] = Data[3];
- Data[4] = Data[4] & 0x87;
- Data[3] = Data[1];
- Data[2] = Data[2] & 0x8f;
-
- if( (((unsigned int*)Data)[1] < 1024) && (((unsigned int*)Data)[1] > 260) &&
- (((unsigned int*)Data)[2] < 1260) && (((unsigned int*)Data)[2] > 430))
- {
- if(ucSource_Times < 3)
- ucSource_Times += 1;
- else
- {
- ucInputSrc = ucNext_Source;
- ucNext_Source = 0;
- ucSource_Times = 0;
- }
- }
- else
- {
- ucSource_Times = 0;
-
- ucNext_Source = (ucNext_Source == 0) ? 1 :
- (ucNext_Source == 1 ) ? 3 : 0;
-
- }
-
- }
- else
- {
- ucSource_Times = 0;
- ucNext_Source = (ucNext_Source == 0) ? 1 :
- (ucNext_Source == 1 ) ? 3 : 0;
-
- }
- }
- else
- {
- I2CRead(0x42, 0x1f, 0x01);
-
- if (0 == (Data[0] & 0x40))
- {
- if(ucSource_Times < 3)
- ucSource_Times += 1;
- else
- {
- ucInputSrc = ucNext_Source;
- ucNext_Source = 0;
- ucSource_Times = 0;
- }
- }
- else
- {
- ucSource_Times = 0;
-
- ucNext_Source = (ucNext_Source == 0) ? 1 :
- (ucNext_Source == 1 ) ? 3 : 0;
- }
- }
-
- RTDSetByte(0x4A,0x00);
-
-
- if(((stGUD1.INPUT_SOURCE & 0x07) == 0) && (0x00 != ucSync_Type))
- RTDSetByte(0x4C,0x32);
- else
- RTDSetByte(0x4C,0x02);
-
- }
- }
-