📄 lcd_main.lst
字号:
192 bit Signal_Stable(unsigned char Notify)
193 {
194 1 if (bReload != bStable) Notify = NOTIFY_RELOAD;
195 1
196 1 bReload = bStable;
197 1
198 1 // When input format changed, OSD will be cleared. OSD_Proc() can only runs when input signal is stabl
-e.
199 1 if (bStable)
200 1 {
201 2 OSD_Dispatcher(Notify);
202 2
203 2 if (MODE_OSDFORCE == ucMode_Curr) // OSD force to reset
204 2 {
205 3 Reset_Mode();
206 3 return _TRUE;
207 3 }
208 2 else
209 2 {
210 3 // Issac
211 3 // Run_Task() will prevent from usTaskCnt becoming smaller than BEGIN_SHOWHINT when input sign
-al is present.
212 3 if (BEGIN_SHOWHINT <= usTaskCnt)
213 3 {
214 4 if ( _OFF == bPanel_Status)
215 4 {
216 5 Set_Panel(1); // Turn on panel
217 5 }
218 4
219 4 if (NOTIFY_RELOAD == Notify)
220 4 {
221 5 if (MODE_NOSUPPORT == ucMode_Curr || MODE_NOSIGNAL == ucMode_Curr)
222 5 {
223 6 RTDSetBit(VDIS_CTRL_20, 0x5f, 0x20 | DHS_MASK); // Background display
224 6 }
225 5 else
226 5 {
227 6 RTDSetBit(VDIS_CTRL_20, 0x5f, 0x08 | DHS_MASK); // Normal Frame-Sync display
228 6
229 6 if (bFrameSync)
230 6 {
231 7 #if (AS_DV_TOTAL)
RTDSetByte(DV_TOTAL_STATUS_3D, 0x00); // Write once to clear status
RTDSetBit(DV_BKGD_STA_31, 0x7f, 0x80);
#endif
C51 COMPILER V6.20c LCD_MAIN 04/15/2004 12:59:10 PAGE 5
235 7 #if (AS_NON_FRAMESYNC)
RTDSetBit(ODD_CTRL_8E, 0xef, 0x10);
#endif
238 7 }
239 6 }
240 5 }
241 4
242 4 #if (MCU_TYPE == MCU_STD8051)
243 4 bLIGHT_PWR = LIGHT_ON;
244 4 #else
MCU_WriteBacklightPower(LIGHT_ON);
#endif
247 4 }
248 3 else if (1 == usTaskCnt && MODE_NOSIGNAL == ucMode_Curr)
249 3 {
250 4 if ( _ON == bPanel_Status)
251 4 {
252 5 Set_Panel(0); // Turn off panel
253 5
254 5 // Set RTD2523 to power-saving mode, and ADC to power-down mode.
255 5 // Do not power down TMDS or it can't detect input signal.
256 5 // DO NOT put VDC and TMDS into power-down mode.
257 5 // and VDC can not detect input when powered down.
258 5
259 5 PowerDown_ADC();
260 5 RTDSetByte(HOSTCTRL_02, 0x02);
261 5
262 5 Delay_Xms(250);
263 5 Delay_Xms(250);
264 5 Delay_Xms(250);
265 5 Delay_Xms(250);
266 5 Delay_Xms(250);
267 5 }
268 4 }
269 3 }
270 2 }
271 1
272 1 return _FALSE;
273 1 }
274
275
276 //////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////
277 // Main Program
278 //////////////////////////////////////////////////////////////////////////////////////////////////////////
-////////////
279
280 void main(void)
281 {
282 1 unsigned char idata ucNotify;
283 1
284 1 #if (USE_MCU_DDC)
MCU_DDC_Process();
#else
287 1 Firmware_Init();
288 1 #endif
289 1
290 1 #if (RS232_DEBUG)
UART_Initialize();
#endif
293 1
294 1 Power_Status_Init();
C51 COMPILER V6.20c LCD_MAIN 04/15/2004 12:59:10 PAGE 6
295 1
296 1 if (bPower_Status) Set_Task(STATE_POWERUP);
297 1
298 1 ISP_Check_Sum();
299 1
300 1 #if (RS232_DEBUG)
PutStringToScr("\nMain Loop..");
#endif
303 1
304 1 Delay_Xms(250);
305 1 Delay_Xms(250);
306 1
307 1 // Program Main Loop
308 1 while (1)
309 1 {
310 2 RTD_Test();
311 2
312 2 #if (GETREGISTER)
RTD_Get_Set();
#endif
315 2
316 2 if (Frame_Sync_Detector())
317 2 {
318 3 Set_Task(STATE_MODECHANGE); // Notify Task State Machine
319 3 bNotify_Timer0_Int = 0;
320 3 continue;
321 3 }
322 2
323 2 // The code below will be executed every 20ms (bNotify_Timer0_Int is set to 1)
324 2 // bNotify_Timer0_Int must and can only be cleared in the end of the iteration.
325 2 if (bNotify_Timer0_Int)
326 2 {
327 3 #if (RS232_DEBUG)
if (fTest)
{
fTest = 0;
DebugModeLoop();
}
#endif
334 3 // Key Translator
335 3 ucNotify = Key_Trans();
336 3
337 3 // Power Controller
338 3 if (Power_Control(ucNotify))
339 3 {
340 4 Set_Task(bPower_Status ? STATE_POWERUP : STATE_POWERDOWN);
341 4 bNotify_Timer0_Int = 0;
342 4 continue;
343 4 }
344 3
345 3 //Source Controller
346 3 if (Source_Control())
347 3 {
348 4 Set_Task(STATE_SOURCECHANGE);
349 4 bNotify_Timer0_Int = 0;
350 4 continue;
351 4 }
352 3
353 3 // Input Mode Detector
354 3 if (Input_Mode_Detector())
355 3 {
356 4 Set_Task(STATE_MODECHANGE); // Notify Task State Machine
C51 COMPILER V6.20c LCD_MAIN 04/15/2004 12:59:10 PAGE 7
357 4 }
358 3
359 3 #if (BURNIN_MODE)
if (((MODE_NOSUPPORT == ucMode_Curr) || (MODE_NOSIGNAL == ucMode_Curr)) && bStable)
BurnIn();
else
Run_Task();
#else
365 3 Run_Task();
366 3 #endif
367 3
368 3 if (Signal_Stable(ucNotify))
369 3 {
370 4 Set_Task(STATE_MODECHANGE); // Notify Task State Machine
371 4 }
372 3
373 3 bNotify_Timer0_Int = 0;
374 3 }
375 2 }
376 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 413 ----
CONSTANT SIZE = 23642 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 1
IDATA SIZE = 4 1
BIT SIZE = 1 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -