📄 pc_eep.lst
字号:
#endif
177 3 }
178 2 else
179 2 //#endif
C51 COMPILER V7.50 PC_EEP 08/20/2007 10:23:35 PAGE 4
180 2
181 2 XScale2(scale);
182 2
183 2 }
184 1
185 1 dPuts("\r\n +++++++++++++++++=>Auto PHP Enable");
186 1 WriteTW88( 0xb6, (ReadTW88(0xb6) & 0x7f) ); // Auto PHP Enable
187 1 WriteTW88( 0xb2, ReadTW88(0xb2) );
188 1
189 1 DisplayResultAndSetActiveRange();
190 1
191 1 //-------- Clear changed status -------------
192 1 MeasureAndWait(3);
193 1
194 1 #ifdef WIDE_SCREEN
195 1 Set4WideScreen(GetWideModeEE());
196 1 #endif
197 1
198 1 WriteTW88( 0x06, 0x80 ); // Software Reset
199 1
200 1 }
201 //=============================================================================
202 // Save PC Function Data to EEPROM
203 //=============================================================================
204 void SavePCDataEE(BYTE mode)
205 {
206 1 WORD index;
207 1
208 1 index = EE_PCDATA + mode*LEN_PCDATA ;
209 1
210 1 #ifdef DEBUG_EEP
dPrintf("\r\nSave PC DATA mode(%d) index(%04x) IHF(%ld)", (WORD)mode, (WORD)index, IHF );
dPrintf(" IVF(%d) PPF(%dM)", IVF, (WORD)(GetPPF()/1000000) );
#endif
214 1
215 1 WriteEEP( index++, (char)( GetCoarse() - PCMDATA[mode].CLOCK) );
216 1 WriteEEP( index++, GetPhaseCurrent() );
217 1 WriteEEP( index++, (char)( GetVactiveStart() - PCMDATA[mode].Vstart) );
218 1 WriteEEP( index++, (char)( GetVBackPorch() - PCMDATA[mode].VBack) );
219 1 WriteEEP( index++, (char)( GetHactiveStart() - PCMDATA[mode].Hstart) );
220 1 }
221
222 //=============================================================================
223 void SaveDefaultPCDataEE(void)
224 {
225 1 WORD index, i;
226 1
227 1 index = EE_PCDATA + PcMode*LEN_PCDATA;
228 1
229 1 for(i=0; i<LEN_PCDATA; i++) {
230 2 WriteEEP( index++, 0 );
231 2 delay(1);
232 2 }
233 1 }
234
235 void SaveDefaultPCDataAllEE(void)
236 {
237 1 for(PcMode=0; PcMode<EE_PC_MAX; PcMode++)
238 1 SaveDefaultPCDataEE();
239 1 }
240
241 void SaveCoarseEE(BYTE mode)
C51 COMPILER V7.50 PC_EEP 08/20/2007 10:23:35 PAGE 5
242 {
243 1 WORD index;
244 1
245 1 index = EE_PCDATA + mode*LEN_PCDATA + 0;
246 1 WriteEEP( index, (char)(GetCoarse() - PCMDATA[mode].CLOCK) );
247 1 }
248
249 void SavePhaseEE(BYTE mode)
250 {
251 1 WORD index;
252 1
253 1 index = EE_PCDATA + mode*LEN_PCDATA + 1;
254 1 WriteEEP( index, GetPhaseCurrent() );
255 1 }
256
257 //=============================================================================
258
259 void SaveVactiveEE(BYTE mode)
260 {
261 1 WORD index;
262 1
263 1 index = EE_PCDATA + mode*LEN_PCDATA + 2;
264 1 WriteEEP( index, (char)(GetVactiveStart() - PCMDATA[mode].Vstart) );
265 1 }
266
267 void SaveVBackPorchEE(BYTE mode)
268 {
269 1 WORD index;
270 1
271 1 index = EE_PCDATA + mode*LEN_PCDATA + 3;
272 1 WriteEEP( index, (char)(GetVBackPorch() - PCMDATA[mode].VBack) );
273 1
274 1 }
275
276 void SaveHactiveEE(BYTE mode)
277 {
278 1 WORD index;
279 1
280 1 index = EE_PCDATA + mode*LEN_PCDATA + 4;
281 1 WriteEEP( index, (char)(GetHactiveStart() - PCMDATA[mode].Hstart) );
282 1 }
283
284 //-----------------------------------------------------------------------------
285 // Save ADC Gain & Offset mod=0 default value, mod=1 current value
286 //-----------------------------------------------------------------------------
287 /*void SaveADCGainOffsetEE(BYTE mod)
288 {
289 BYTE i, dat;
290 WORD index;
291
292 index = EE_ADC_GO;
293
294 for(i=0; i<6; i++) {
295 if( mod==0 ) dat = 0x80;
296 else dat = ReadADC(i+0x08);
297 WriteEEP(index+i, dat);
298 }
299 }
300
301 void GetADCGainOffsetEE(void)
302 {
303 BYTE i, dat;
C51 COMPILER V7.50 PC_EEP 08/20/2007 10:23:35 PAGE 6
304 WORD index;
305
306 index = EE_ADC_GO;
307
308 for(i=0; i<6; i++) {
309 dat = ReadEEP(index+i);
310 WriteADC(i+0x08, dat);
311 }
312 }
313
314 #ifdef SUPPORT_DTV
315 //-----------------------------------------------------------------------------
316 // Save ADC Gain & Offset for DTV mod=0 default value, mod=1 current value
317 //-----------------------------------------------------------------------------
318 void SaveADCGainOffsetForDTVEE(BYTE mod)
319 {
320 BYTE i, dat;
321
322 for(i=0; i<6; i++) {
323 if( mod==0 ) dat = 0x80;
324 else dat = ReadADC(0x08+i);
325 WriteEEP(EE_ADC_GO_DTV + i, dat);
326 }
327 }
328
329 void GetADCGainOffsetForDTVEE(void)
330 {
331 BYTE i, dat;
332
333 for(i=0; i<6; i++) {
334 dat = ReadEEP(EE_ADC_GO_DTV + i);
335 WriteADC(0x08+i, dat);
336 }
337 }
338 #endif // SUPPORT_DTV
339 */
340 #endif // SUPPORT_PC
341
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1238 ----
CONSTANT SIZE = 38 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- 41
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -