Frame_Sync.i
上传用户:xmyjxjd
上传日期:2013-05-04
资源大小:1517k
文件大小:42k
- #line 1 "CodeFrame_Sync.c" /0
-
-
-
- #line 1 "HeaderFrame_Sync.h" /0
-
-
-
-
- bit bFrameSync = 0;
- unsigned char idata ucSyncErrorCnt = 0;
-
- unsigned char idata ucStatus = 0;
- unsigned char idata ucPE_Max = 0;
- unsigned char idata ucI_Code = 0;
- unsigned char idata ucP_Corr = 0;
-
-
- void AbortSync(void);
-
- unsigned char TestSync(unsigned int offset);
- unsigned char Frame_Sync(void);
- void Adjust_I_Code(void);
-
-
- #line 21 "HeaderFrame_Sync.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 3 "CodeFrame_Sync.c" /0
- #line 3 "CodeFrame_Sync.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 "CodeFrame_Sync.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 5 "CodeFrame_Sync.c" /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 6 "CodeFrame_Sync.c" /0
-
-
- #line 1 "HeaderConfig.h" /0
-
-
-
-
-
-
-
-
-
-
- #line 11 "HeaderConfig.h" /1
-
-
-
-
- #line 15 "HeaderConfig.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 30 "HeaderConfig.h" /1
-
-
- #line 32 "HeaderConfig.h" /0
-
-
- #line 34 "HeaderConfig.h" /1
-
-
-
-
-
-
-
-
-
-
- #line 44 "HeaderConfig.h" /0
-
-
-
-
- #line 48 "HeaderConfig.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 70 "HeaderConfig.h" /0
-
-
- #line 72 "HeaderConfig.h" /1
-
-
- #line 74 "HeaderConfig.h" /0
-
- #line 75 "HeaderConfig.h" /1
-
-
- #line 77 "HeaderConfig.h" /0
-
- #line 78 "HeaderConfig.h" /1
-
-
- #line 80 "HeaderConfig.h" /0
-
-
- #line 82 "HeaderConfig.h" /1
-
-
- #line 84 "HeaderConfig.h" /0
-
-
- #line 86 "HeaderConfig.h" /1
-
-
- #line 88 "HeaderConfig.h" /0
-
-
-
- #line 1 "DisplayDISP_B6.H" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 562 "DisplayDISP_B6.H" /0
-
- extern unsigned char code RTD_PWUP_INI[];
- extern unsigned char code RTD_DDC_TABLE[];
- extern unsigned char code RTD_IO_INI[];
-
- extern unsigned char code FreeV[];
- extern unsigned char code OSD_PWUP_INI[];
-
- extern unsigned int code VGA_Mode[][6];
- extern unsigned int code Mode_Preset[][5];
-
- extern unsigned char code RTD_VIDEO_60[];
- extern unsigned char code RTD_VIDEO_50[];
-
-
- #line 90 "HeaderConfig.h" /0
-
-
-
-
- #line 94 "HeaderConfig.h" /1
-
-
- #line 96 "HeaderConfig.h" /0
-
-
-
-
-
-
- #line 102 "HeaderConfig.h" /1
-
-
- #line 104 "HeaderConfig.h" /0
-
-
- #line 106 "HeaderConfig.h" /1
-
-
- #line 108 "HeaderConfig.h" /0
-
-
-
- #line 1 "PCB2523d1_pcb.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 "PCB2523d1_pcb.h" /0
-
-
-
-
- #line 1 "HeaderMTV512.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 "HeaderMTV512.h" /0
-
-
-
-
-
-
-
-
-
- extern unsigned char xdata byMTV512_DDCRAMA[128];
- extern unsigned char xdata byMTV512_DDCRAMB[128];
-
-
-
-
-
- extern unsigned char xdata M512_PadMode0;
- extern unsigned char xdata M512_PadMode1;
- extern unsigned char xdata M512_PadMode2;
- extern unsigned char xdata M512_PadMode3;
- extern unsigned char xdata M512_PadMode4;
- extern unsigned char xdata M512_PadMode5;
- extern unsigned char xdata M512_Option1;
- extern unsigned char xdata M512_PadMode6;
- extern unsigned char xdata M512_PadMode7;
-
- extern unsigned char xdata M512_Port40;
- extern unsigned char xdata M512_Port41;
- extern unsigned char xdata M512_Port42;
-
-
-
-
-
-
-
- extern unsigned char xdata M512_Port50;
- extern unsigned char xdata M512_Port51;
- extern unsigned char xdata M512_Port52;
- extern unsigned char xdata M512_Port53;
- extern unsigned char xdata M512_Port54;
- extern unsigned char xdata M512_Port55;
- extern unsigned char xdata M512_Port56;
-
- extern unsigned char xdata M512_Port60;
- extern unsigned char xdata M512_Port61;
- extern unsigned char xdata M512_Port62;
- extern unsigned char xdata M512_Port63;
- extern unsigned char xdata M512_Port64;
- extern unsigned char xdata M512_Port65;
- extern unsigned char xdata M512_Port66;
- extern unsigned char xdata M512_Port67;
-
- extern unsigned char xdata M512_Port76;
- extern unsigned char xdata M512_Port77;
-
- extern unsigned char xdata M512_DA0;
- extern unsigned char xdata M512_DA1;
- extern unsigned char xdata M512_DA2;
- extern unsigned char xdata M512_DA3;
- extern unsigned char xdata M512_DA4;
- extern unsigned char xdata M512_DA5;
- extern unsigned char xdata M512_DA6;
- extern unsigned char xdata M512_DA7;
- extern unsigned char xdata M512_DA8;
- extern unsigned char xdata M512_DA9;
- extern unsigned char xdata M512_DA10;
- extern unsigned char xdata M512_DA11;
- extern unsigned char xdata M512_DA12;
- extern unsigned char xdata M512_DA13;
-
-
- extern unsigned char xdata M512_HVSTUS;
- extern unsigned char xdata M512_HCNTH;
- extern unsigned char xdata M512_HCNTL;
- extern unsigned char xdata M512_VCNTH;
- extern unsigned char xdata M512_VCNTL;
- extern unsigned char xdata M512_INTFLG;
- extern unsigned char xdata M512_INTEN;
-
-
-
- extern unsigned char xdata M512_IIC_CTR;
- extern unsigned char xdata M512_IIC_STUS1;
- extern unsigned char xdata M512_IIC_STUS2;
- extern unsigned char xdata M512_IIC_INTFLG;
- extern unsigned char xdata M512_IIC_INTEN;
- extern unsigned char xdata M512_IIC_MBUF;
- extern unsigned char xdata M512_IIC_TXRCABUF;
- extern unsigned char xdata M512_IIC_SLVAADR;
- extern unsigned char xdata M512_IIC_TXRCBBUF;
- extern unsigned char xdata M512_IIC_SLVBADR;
-
- extern unsigned char xdata M512_ISPSLV;
- extern unsigned char xdata M512_ISPEN;
-
-
-
-
- extern unsigned char xdata M512_ADC;
- extern unsigned char xdata M512_WDT;
- extern unsigned char xdata EINT1PEN ;
-
-
- #line 105 "HeaderMTV512.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 130 "HeaderMTV512.h" /0
-
-
-
-
-
-
-
-
- #line 4 "PCB2523d1_pcb.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
- #line 16 "PCB2523d1_pcb.h" /1
-
-
-
- #line 19 "PCB2523d1_pcb.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 33 "PCB2523d1_pcb.h" /1
-
-
- #line 90 "PCB2523d1_pcb.h" /0
-
-
-
-
- sbit bRTD_SDIO_0 = 0x90;
-
-
- #line 158 "PCB2523d1_pcb.h" /1
-
-
-
-
- #line 162 "PCB2523d1_pcb.h" /0
-
- sbit bRTD_SCLK = 0x94;
- sbit bRTD_SCSB = 0x95;
- sbit bIIC_SCL = 0x96;
- sbit bIIC_SDA = 0x97;
-
- sbit bDDC_SCL = 0xb0;
- sbit bDDC_SDA = 0xb1;
-
- sbit bRTD_RST = 0xb2;
- sbit bRIGHT_KEY = 0xb4;
- sbit bLEFT_KEY = 0xb5;
-
-
-
-
-
-
-
-
- #line 182 "PCB2523d1_pcb.h" /1
-
-
-
- #line 185 "PCB2523d1_pcb.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 217 "PCB2523d1_pcb.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 282 "PCB2523d1_pcb.h" /0
-
-
- #line 110 "HeaderConfig.h" /0
-
-
-
-
- #line 114 "HeaderConfig.h" /1
-
-
- #line 116 "HeaderConfig.h" /0
-
-
- #line 118 "HeaderConfig.h" /1
-
-
- #line 120 "HeaderConfig.h" /0
-
- #line 1 "HEADERVDC_CFG.H" /0
-
- #line 2 "HEADERVDC_CFG.H" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 1229 "HEADERVDC_CFG.H" /0
-
- extern unsigned char code V_NOWORK[];
- extern unsigned char code V_DISABLE[];
- extern unsigned char code V_ENABLE[];
-
- extern unsigned char code AV_DETECT[];
- extern unsigned char code SV_DETECT[];
-
- extern unsigned char code YUV_DETECT[];
-
- extern unsigned char code AV_60_0[];
- extern unsigned char code AV_60_1[];
- extern unsigned char code AV_60_2[];
- extern unsigned char code AV_60_3[];
- extern unsigned char code AV_60_4[];
- extern unsigned char code AV_50_0[];
- extern unsigned char code AV_50_1[];
- extern unsigned char code AV_50_2[];
- extern unsigned char code AV_50_3[];
- extern unsigned char code AV_50_4[];
- extern unsigned char code AV_SECAM[];
-
- extern unsigned char code SV_60_0[];
- extern unsigned char code SV_60_1[];
- extern unsigned char code SV_60_2[];
- extern unsigned char code SV_60_3[];
- extern unsigned char code SV_60_4[];
- extern unsigned char code SV_50_0[];
- extern unsigned char code SV_50_1[];
- extern unsigned char code SV_50_2[];
- extern unsigned char code SV_50_3[];
- extern unsigned char code SV_50_4[];
- extern unsigned char code SV_SECAM[];
-
- extern unsigned char code VIDEO_ALL[];
- extern unsigned char code VIDEO_YUV[];
- extern unsigned char code VIDEO_60[];
- extern unsigned char code VIDEO_50[];
-
- extern unsigned char code TV_SOURCE_SEL[];
- extern unsigned char code TV_SCAN_GAIN[];
- extern unsigned char code TV_DISP_GAIN[];
-
-
- #line 120 "HeaderConfig.h" /0
-
-
-
-
- #line 124 "HeaderConfig.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 435 "HeaderConfig.h" /0
-
- extern unsigned int code CAP_WIN[][5];
- extern unsigned int code ADC_SD_SET[][3];
-
- extern unsigned char code VGA_INI_SS[];
- extern unsigned char code VGA_INI_CS[];
- extern unsigned char code VGA_INI_SOG[];
- extern unsigned char code VIDEO_INI[];
- extern unsigned char code DVI_INI[];
- extern unsigned char code VGA_SET_SS[];
- extern unsigned char code VGA_SET_CS[];
- extern unsigned char code VGA_SET_SOG[];
- extern unsigned char code LVDS_POWERUP[];
- extern unsigned char code LVDS_POWERDOWN[];
- extern unsigned char code Palette_Open[];
- extern unsigned char code Palette_Close[];
- extern unsigned char code Palette_1[];
- extern unsigned char code Palette_2[];
- extern unsigned char code Palette_3[];
- extern unsigned char code Palette_4[];
- extern unsigned char code Palette_5[];
- extern unsigned char code Palette_6[];
- extern unsigned char code Palette_7[];
- extern unsigned char code DCLK_OFFSET[16];
-
-
- #line 7 "CodeFrame_Sync.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 8 "CodeFrame_Sync.c" /0
-
-
- #line 1 "HeaderLCD_OSD.h" /0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 24 "HeaderLCD_OSD.h" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 90 "HeaderLCD_OSD.h" /0
-
- extern unsigned char idata ucOSD_Page_Index;
- extern unsigned char idata ucOSD_Item_Index0;
- extern unsigned char idata ucOSD_Item_Index1;
- extern unsigned char idata ucOSD_Item_Index2;
-
- extern unsigned char idata ucOSD_Pre_Page_Index;
-
- #line 98 "HeaderLCD_OSD.h" /1
-
-
-
-
- #line 102 "HeaderLCD_OSD.h" /0
-
-
- extern void OSD_Proc(unsigned char action);
-
-
- extern void OSD_Window(unsigned char win_no, unsigned int row_start, unsigned int row_end, unsigned int col_start, unsigned int col_end,
- unsigned char width, unsigned char height, unsigned char color, unsigned char color_sb, unsigned char gradient,
- unsigned char gra_level,unsigned char attr);
-
-
- extern void OSD_Line(unsigned char row, unsigned char col, unsigned char length, unsigned char value, unsigned char indicate);
-
- extern void Get_OSD_Margin(void);
-
- extern void OSD_Opening(void);
- extern void OSD_Ending(void);
-
- extern void Show_Note(void);
- extern void Show_Hint(void);
- extern void OSD_Clear(unsigned char row_start, unsigned char height, unsigned char col_start, unsigned char width);
-
- extern void OSD_Show_Check(void);
- extern void rgb_OSD_Slider(unsigned char row, unsigned char col, unsigned char length, unsigned char value, unsigned char range,
- unsigned char color, unsigned char color_slider);
-
-
-
- extern void OSD_Fact_Line(unsigned char row, unsigned char col, unsigned char length, unsigned char value, unsigned char indicate);
- extern void OSD_Fact_Clear(unsigned char row_start, unsigned char height, unsigned char col_start, unsigned char width);
- extern void OSD_Position(unsigned char para);
- extern void Value_Adjust(unsigned char *Var, unsigned char Key, unsigned char VMax, unsigned char VMin);
-
-
-
-
-
- #line 9 "CodeFrame_Sync.c" /0
-
-
-
-
-
-
-
- bit Frame_Sync_Detector(void)
- {
- if (bPower_Status && bStable && 0 != ucMode_Curr && 255 != ucMode_Curr)
- {
- if (bFrameSync)
- {
- RTDRead(0x1F, 1, 1);
- ucStatus |= (Data[0] >> 6);
-
- if(Data[0])
- RTDSetByte(0x1F,0x00);
-
- if (Data[0] & 0xc0)
- {
- ucSyncErrorCnt += 1;
-
- #line 32 "CodeFrame_Sync.c" /1
-
-
- #line 34 "CodeFrame_Sync.c" /0
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
-
- if (1 >= ucSyncErrorCnt)
- {
- RTDRead(0x01, 1, 1);
- ucStatus |= (Data[0] & 0xfc);
-
-
- if(Data[0])
- RTDSetByte(0x01,0x00);
-
- if (Data[0] & 0x60) ucSyncErrorCnt += (1 + 1);
-
- if (0 == (stGUD1.INPUT_SOURCE & 0x07))
- {
- if (Data[0] & 0x80)
- {
- ucSyncErrorCnt += 1;
-
- #line 68 "CodeFrame_Sync.c" /1
-
-
- #line 70 "CodeFrame_Sync.c" /0
- }
- else
- {
-
-
-
- RTDSetBit(0x3D, 0x7f, 0x20);
- Delay_Xms(1);
- RTDRead(0x3D, 1, 1);
- ucPE_Max = Data[0] & 0x1f;
- if((ucPE_Max > 0x10) && (ucPE_Level == 0))
- {
- ucPE_Level = 1;
- Adjust_I_Code();
- if((ucI_Code & 0x80) == 0x80)
- RTDSetBit(0xCA,0xdf,0x20);
- else
- RTDSetBit(0xCA,0xdf,0x00);
-
- ucI_Code = ucI_Code & 0x7f;
- RTDSetByte(0xC9,0x1c | ((ucI_Code & 0x07) << 5));
- RTDSetBit(0xCA,0xfc,0x04 | ((ucI_Code & 0x18) >> 3));
-
- RTDSetBit(0x3D, 0xdf, 0x00);
- RTDSetByte(0x3D,0x40);
- ucPE_Max = 0;
- }
-
-
- }
- }
- }
-
- if (1 < ucSyncErrorCnt)
- {
- Reset_Mode();
-
- Set_Task(2);
-
- bNotify_Timer0_Int = 0;
-
- return 1;
-
- }
-
- if (bNotify_Timer0_Int && 2 == ucModeCnt)
- {
- if (ucSyncErrorCnt) ucSyncErrorCnt -= 1;
-
- }
- }
- return 0;
- }
-
-
-
-
- void AbortSync(void)
- {
- Data[0] = 5;
- Data[1] = 0;
- Data[2] = 0x22;
- Data[3] = (unsigned char)usDH_Total;
- Data[4] = (unsigned char)(usDH_Total >> 8);
- Data[5] = 0;
- RTDWrite(Data);
-
- RTDSetBit(0x2E, 0x07, 0x00);
- }
-
- unsigned char TestSync(unsigned int offset)
- {
-
- RTDSetByte(0x9a,(unsigned char)offset);
- RTDSetBit(0x9b,0xf0,(unsigned char)((offset >> 8) & 0x0f) | 0x20);
-
-
-
- Wait_For_Event(0x08);
-
-
- RTDSetByte(0x01,0x00);
-
- Wait_For_Event(0x08);
-
-
-
- Wait_For_Event(0x08);
-
-
-
-
- RTDRead(0x01, 1, 1);
-
-
- if(Data[0])
- RTDSetByte(0x01,0x00);
-
-
- if (Data[0] & 0x60)
- {
- AbortSync();
- return 1;
- }
-
- Data[0] &= 0x03;
-
- return 0;
- }
-
-
-
-
-
-
-
-
- unsigned char Frame_Sync(void)
- {
- unsigned int idata usBuffer,usDelta;
- unsigned char idata ucFine,ucTemp=0;
-
-
- #line 198 "CodeFrame_Sync.c" /1
-
-
- #line 200 "CodeFrame_Sync.c" /0
-
-
-
- RTDRead(0x9a , 2, 0);
- Data[2] = Data[1] & 0x0f;
- Data[3] = Data[0];
- usBuffer = ((unsigned int*)Data)[1];
-
- usDelta = usBuffer;
-
-
- if(((stGUD1.INPUT_SOURCE & 0x07) == 0) || ((stGUD1.INPUT_SOURCE & 0x07) == 1))
- {
-
-
- while(usBuffer < (1228 + 14 * 32))
-
- {
- RTDRead(0xD1,2,0);
- RTDSetByte(0xD1,Data[0]+1);
- RTDSetByte(0xD2,Data[1]);
-
-
-
-
-
-
- usBuffer = (unsigned int)((unsigned long)(32768 + (unsigned long)(Data[0] + 2) * usBuffer)/(unsigned long)(Data[0] + 3));
-
- usDelta = usBuffer;
-
- }
-
-
-
- usDelta -= 128;
- }
-
- usBuffer = usDelta;
-
-
- for(ucFine =0;ucFine < 14;ucFine++)
- {
- if (TestSync(usDelta)) return 2;
-
- if(Data[0] & 0x03)
- {
- usDelta = (Data[0] & 0x02) ? usDelta - 32 : usDelta + 32;
- ucTemp += 1;
- }
- else if((Data[0] & 0x03) == 0)
- break;
- }
-
- if(Data[0] & 0x03)
- return 1;
-
- else if(usDelta < usBuffer)
- {
-
- if(TestSync(usDelta - 4)) return 2;
-
- if(Data[0] & 0x03)
- TestSync(usDelta);
- else
- usDelta -= 2;
-
- }
- else
- {
-
- if(TestSync(usDelta + 4)) return 2;
-
- if(Data[0] & 0x03)
- TestSync(usDelta);
- else
- usDelta += 2;
- }
-
-
-
-
- #line 298 "CodeFrame_Sync.c" /1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #line 417 "CodeFrame_Sync.c" /0
-
-
- RTDSetBit(0x99,0x0f,(6 << 4));
- if(TestSync(usDelta + DCLK_OFFSET[6]))
- return 2;
-
- if(Data[0] & 0x03)
- {
- if(TestSync((Data[0] & 0x02) ? (usDelta + DCLK_OFFSET[6] - 1)
- : (usDelta + DCLK_OFFSET[6] + 1)))
- return 2;
- else
- {
- if(Data[0] & 0x03)
- return 1;
- else
- return 0;
- }
-
- }
-
- #line 438 "CodeFrame_Sync.c" /1
-
-
- #line 440 "CodeFrame_Sync.c" /0
- return 0;
-
-
- }
-
-
-
-
- void Adjust_I_Code(void)
- {
-
- ((unsigned int*)Data)[0] = 24576/usHsync;
-
-
-
- ucI_Code = 14;
- Data[2] = ((unsigned long)ucCE_Value * 50737400 / (unsigned long)((unsigned int*)Data)[0]) >> 20;
- Data[3] = (4 == 0) ? (ucPE_Level ? (185 - ucP_Corr) : ((ucP_Corr >> 2) + 10)) :
- 4;
-
- while(1)
- {
-
- if(Data[2] > Data[3])
- {
- Data[2] = Data[2] >> 1;
- ucI_Code -= 1;
-
- if(Data[2] <= Data[3])
- break;
- }
- else
- {
- if((Data[2] << 1) > Data[3])
- break;
- else
- {
- Data[2] = Data[2] << 1;
- ucI_Code += 1;
- }
- }
- }
-
-
-
- if((unsigned char)((unsigned int)Data[2]*3/2) <= Data[3])
- {
- ucI_Code |= 0x80;
-
- }
- else
- {
-
- }
-
-
- }