📄 pc_eep.lst
字号:
C51 COMPILER V7.50 PC_EEP 08/20/2007 10:23:35 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE PC_EEP
OBJECT MODULE PLACED IN pc_eep.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE pc_eep.c COMPACT OPTIMIZE(9,SIZE)
line level source
1 //pc_eep.c
2 //=========================================================================
3 // EEPROM structure
4
5 // 0x80 ----------- PC Color Temp Data --------------------------------
6 // 0 PC Color Temp Mode
7 // 1 R G B for Mode 1
8 // 4 R G B for Mode 2
9 // 7 R G B for Mode 3
10 // A R G B for User Mode
11 //
12 // 0x90 ----------- PC Input ------------------------------------------
13 //
14 // 0 ADC Coarse
15 // 1 ADC Phase
16 // 2 Vertical Active Start
17 // 3 Horizontal Active Start
18 //
19
20 #include "Config.h"
21
22 #if defined( SUPPORT_PC ) || defined( SUPPORT_DTV )
23
24 #include "typedefs.h"
25 #include "main.h"
26 #include "i2c.h"
27 #include "debug.h"
28 #include "pc_eep.h"
29 #include "printf.h"
30 #include "TW88.h"
31 #include "measure.h"
32 #include "adc.h"
33 #include "osdmenu.h"
34 #include "etc_eep.h"
35 #include "panel.h"
36
37 extern CODE struct _PCMDATA PCMDATA[];
38
39 extern IDATA BYTE PcMode, PcModeLast;
40 extern IDATA WORD IVF;
41 extern IDATA DWORD IHF;
42
43 ///extern IDATA BYTE CurrentADC;
44
45 WORD GetVactiveStartEE(BYTE mode)
46 {
47 1 WORD index;
48 1 WORD start;
49 1
50 1 index = EE_PCDATA + mode*LEN_PCDATA + 2;
51 1 start = PCMDATA[mode].Vstart + (char)ReadEEP(index);
52 1
53 1 return start;
54 1 }
55
C51 COMPILER V7.50 PC_EEP 08/20/2007 10:23:35 PAGE 2
56 WORD GetHactiveStartEE(BYTE mode)
57 {
58 1 WORD index;
59 1 WORD start;
60 1
61 1 index = EE_PCDATA + mode*LEN_PCDATA + 4;
62 1 start = PCMDATA[mode].Hstart + (char)ReadEEP(index);
63 1
64 1 return start;
65 1 }
66
67 //-----------------------------------------------------------------------------
68 // Get PC Function Data from EEPROM
69 //-----------------------------------------------------------------------------
70 void GetPCDataEE(BYTE mode)
71 {
72 1 char dat=0; // must be signed char
73 1 WORD index, temp;
74 1 DWORD scale, pres;
75 1 extern bit Flag4Bypass;
76 1 WORD hstart, vstart;
77 1
78 1 vstart = PCMDATA[mode].Vstart;
79 1 hstart = PCMDATA[mode].Hstart;
80 1
81 1 index = EE_PCDATA + mode*LEN_PCDATA;
82 1
83 1 //--------------------------------------------
84 1
85 1 // PPF
86 1 ChangeInternPLL(PCMDATA[mode].PPF * 100000L);
87 1 delay(5);
88 1
89 1 GetHpnVpn(1); // For correcting sync polarity
90 1
91 1 // ADC VCO
92 1 SetVCORange( PCMDATA[mode].IPF * 100000L );
93 1
94 1 // ADC PLL-----(0)
95 1
96 1 if( !IsDTVInput() ) dat = ReadEEP(index++);
97 1
98 1 if(GetInputSelection()==PC) WriteADC(0xc1, 0x30);
99 1
100 1 SetCoarse( dat + PCMDATA[mode].CLOCK );
101 1
102 1 if(GetInputSelection()==PC) WriteADC(0xc1, 0x20);
103 1
104 1 // ADC Phase---(1)
105 1 dat = ReadEEP(index++);
106 1 if( !IsDTVInput() )
107 1 SetPhase( dat );
108 1
109 1 // Vertical----(2)
110 1 if( !IsDTVInput() )
111 1 vstart += (char)ReadEEP(index++);
112 1
113 1 SetVactiveStart( vstart );
114 1 if( IsDTVInput() ) {
115 2 SetVactiveLen( PCMDATA[PcMode].VAN+20 );
116 2 }
117 1 else
C51 COMPILER V7.50 PC_EEP 08/20/2007 10:23:35 PAGE 3
118 1 SetVactiveLen( PCMDATA[mode].VAN );
119 1
120 1 pres=(DWORD)PVR_;
121 1 scale = (PCMDATA[mode].VAN * 0x10000L) / pres;
122 1
123 1 if( scale==0x10000 && Flag4Bypass ) // Bypass
124 1 BypassZoom();
125 1 else {
126 2 Clear_bypass();
127 2 YScale2(scale); // save V Scale Up Factor
128 2 }
129 1
130 1 SetVValueForPanel(vstart); // Vstart
131 1
132 1 dat=0;
133 1 // VBackPorch--(3)
134 1 if( !IsDTVInput() )
135 1 dat = (char)ReadEEP(index++);
136 1 dat += PCMDATA[mode].VBack;
137 1 SetVBackPorch( dat );
138 1
139 1 // Horizontal--(4)
140 1 if( !IsDTVInput() )
141 1 hstart += (char)ReadEEP(index++);
142 1 temp = hstart + PCMDATA[mode].HAN + 2;
143 1 SetHactiveStart( hstart );
144 1
145 1 //#ifdef SXGA
146 1 //if( mode>=EE_XGA_60 && mode <=EE_XGA_85 ) temp--;
147 1 //#endif
148 1
149 1 if( IsDTVInput() ) temp += 3;
150 1
151 1 SetHactiveEnd( temp );
152 1 SetHValueForPanel();
153 1
154 1 if( (PCMDATA[PcMode].VAN != GetPVR()) || !Flag4Bypass) {
155 2 pres = GetPHR();
156 2 scale = (PCMDATA[mode].HAN * 0x10000L + pres/2) / pres; // 256*han/phr
157 2
158 2 #ifdef DEBUG_EEP
dPrintf("\r\nXscaleFactor:%04x(%d)", scale, scale);
#endif
161 2
162 2 //#if (defined SXGA) || (defined WXGA)
163 2 if( PCMDATA[PcMode].HAN > 1024 ) {
164 3 scale = (PCMDATA[PcMode].HAN * 0x80L ) / 1024 + 1; // (HAN/1024)*256
165 3 XscaleD(scale);
166 3
167 3 #ifdef DEBUG_EEP
Printf("\r\nXscaleFactorD:%04x(%d)", scale, scale);
#endif
170 3
171 3 scale = (1024 * 0x10000L ) / 1280; // (1024/PHR)*256
172 3 XscaleU(scale);
173 3
174 3 #ifdef DEBUG_EEP
Printf("\r\nXscaleFactorU:%04x(%d)", scale, scale);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -