home > RTD2660 Source Code > Mode_customer.c

  1. //----------------------------------------------------------------------------------------------------  
  2. // ID Code      : Mode.c No.0002  
  3. // Update Note  :  
  4. //  
  5. //----------------------------------------------------------------------------------------------------  
  6.   
  7. #define __MODE_CUSTOMER__  
  8.   
  9. #include "Core\Header\Include.h"  
  10.   
  11. /** 
  12.  * CModeHandler 
  13.  * main control flow 
  14.  * first system initial, then main loop 
  15.  * @param <none> 
  16.  * @return {none} 
  17.  * 
  18. */  
  19. //--------------------------------------------------  
  20. // Description  : Mode handler, the main control flow  
  21. // Input Value  : None  
  22. // Output Value : None  
  23. //--------------------------------------------------  
  24. //--------------------------------------------------  
  25. // Description  : No signal event  
  26. // Input Value  : None  
  27. // Output Value : None  
  28. //--------------------------------------------------  
  29. void CModeNoSignalEvent(void)  
  30. {  
  31.   
  32.     //    ucOsdEventMsg = _SHOW_NOSIGNAL_MSG;  
  33.     if(!bForcePanelOff)  
  34.         {  
  35.     CPowerPanelOn(); // avoid power on not active panel power  
  36.         }  
  37.     COsdMessagePush(_SHOW_NOSIGNAL_MESSAGE);  
  38.     SET_DONT_ENABLE_OSD_WHEN_CHANGE_SRC();  
  39.   
  40. //741002***   
  41. #if (_HDMI_SUPPORT == _ON)    
  42.     CLR_HDMISHOWSEARCH();  
  43. #endif  
  44. //741002###  
  45.   
  46.     SET_SHOW_IS_NOSIGNAL_STATE();  
  47. //20080823 ccy modify  
  48.     #if (_PCB_TYPE == _PCB_TEST)  
  49.     LED_Message(_LED_MSG_RED);  
  50.     #endif  
  51.   
  52.   
  53. }  
  54.   
  55. //--------------------------------------------------  
  56. // Description  : No cable event  
  57. // Input Value  : None  
  58. // Output Value : None  
  59. //--------------------------------------------------  
  60. void CModeNoCableEvent(void)  
  61. {  
  62.   
  63.     //    ucOsdEventMsg = _SHOW_NOCABLE_MSG;  
  64.     if(!bForcePanelOff)  
  65.     CPowerPanelOn(); // avoid power on not active panel power  
  66.     COsdMessagePush(_SHOW_NOCABLE_MESSAGE);  
  67.     SET_DONT_ENABLE_OSD_WHEN_CHANGE_SRC();  
  68.   
  69. //741002***   
  70. #if (_HDMI_SUPPORT == _ON)    
  71.     CLR_HDMISHOWSEARCH();  
  72. #endif  
  73. //741002###  
  74.       
  75. }  
  76.   
  77. //--------------------------------------------------  
  78. // Description  : No support event  
  79. // Input Value  : None  
  80. // Output Value : None  
  81. //--------------------------------------------------  
  82. void CModeNoSupportEvent(void)  
  83. {  
  84.     if(!bForcePanelOff)  
  85.     CPowerPanelOn(); // avoid power on not active panel power  
  86.     COsdMessagePush(_SHOW_NOSUPPORT_MESSAGE);  
  87.     SET_DONT_ENABLE_OSD_WHEN_CHANGE_SRC();  
  88.   
  89.     //    ucOsdEventMsg = _SHOW_NOSUPPORT_MSG;  
  90. //741002***   
  91. #if (_HDMI_SUPPORT == _ON)    
  92.     CLR_HDMISHOWSEARCH();  
  93. #endif  
  94. //741002###  
  95.       
  96. }  
  97.   
  98. void CModeResetCustomer(void)  
  99. {   
  100.     #if (_IR_HANDLER_MODE==_HW_MODE)  
  101.         CIrdaInitial();  
  102.     #endif  
  103.       
  104.     COsdIconMoveDisableResetEnv();  
  105. }  
  106.   
  107. //void CPowerSavingCustomer(void)  
  108. //{  
  109.   
  110. //}  
  111.   
  112. void CModeNoSignalIconMoveEvent(void)  
  113. {  
  114.     COsdMessagePush(_SHOW_ICONMOVE_MESSAGE);  
  115. }  
  116.   
  117. void CTimerCancelNosignal_Icon_Powersaving(void)  
  118. {  
  119.     CTimerCancelTimerEvent(CModeNoSignalEvent);  
  120.     CTimerCancelTimerEvent(CModeNoSignalIconMoveEvent);  
  121.     CTimerCancelTimerEvent(CModePowerSavingEvent);  
  122. }  
  123.   
  124. //type : 0=no icon, 1=icon  
  125. void CTimerReactiveNosignal_Icon_Powersaving(BYTE type)  
  126. {  
  127.     if (type==0)  
  128.     {  
  129.         CTimerReactiveTimerEvent(SEC(_TIMER_NOSIGNAL), CModeNoSignalEvent);  
  130.         CTimerReactiveTimerEvent(SEC(_TIMER_POWERSAVING_BURNIN), CModePowerSavingEvent);  
  131.     }  
  132.     else  
  133.     {  
  134.         CTimerReactiveTimerEvent(SEC(_TIMER_NOSIGNAL), CModeNoSignalEvent);  
  135.         CTimerReactiveTimerEvent(SEC(_TIMER_ICONMOVE), CModeNoSignalIconMoveEvent);  
  136. #if(_CUSTOMER_CGT)  
  137.         if (GET_INPUTPORT_TYPE(stSystemData.InputSource)==_DSUB_A0_PORT)  
  138.         {  
  139.             CTimerReactiveTimerEvent(SEC(10), CModePowerSavingEvent);  
  140.         }  
  141.         else  
  142.         {  
  143.             CTimerReactiveTimerEvent(SEC(_TIMER_POWERSAVING), CModePowerSavingEvent);  
  144.         }             
  145. //20080912 ccy add  
  146. #elif( _PCB_TYPE == _PCB_TEST)  
  147. #else  
  148.         CTimerReactiveTimerEvent(SEC(_TIMER_POWERSAVING), CModePowerSavingEvent);  
  149.   
  150. #endif  
  151.     }  
  152. }  
  153.   
  154. // type: 0-source, 1-NoSignal  
  155. void COsdShowNoSignalOrSrc(UINT8 type)  
  156. {  
  157.     if (type==0)  
  158.     {  
  159.         //COsdMessagePush(_SHOW_SIGNALSOURCE_MESSAGE);  
  160.         ;//COsdMessagePush(_SHOWINFO_MESSAGE);  
  161.     }  
  162.     if(GET_INPUTPORT_TYPE(stSystemData.InputSource)!=_YPBPR_A0_PORT)    //add 20091210  
  163.     if (GET_BURNSTATUS())  
  164.         CTimerReactiveNosignal_Icon_Powersaving(0);  
  165.     else  
  166.     {  
  167.             if(GET_INPUTPORT_TYPE(stSystemData.InputSource)==_VIDEO_TV_PORT)  
  168.             {  
  169.             //czl disable 080708 for close blue background  
  170.               
  171.                 if(GET_TV_BACKGROUND())  
  172.                     CTimerReactiveNosignal_Icon_Powersaving(1);  
  173.               
  174.             }  
  175.             else  
  176.                 CTimerReactiveNosignal_Icon_Powersaving(1);  
  177.         }         
  178.   
  179. //20080829 ccy modify  
  180.         if ((GET_INPUTPORT_TYPE(stSystemData.InputSource) == _VIDEO_TV_PORT))  
  181.         {      //   CLR_DVD_POWERONOFF();  
  182.             if (GET_TV_BACKGROUND() ==0)//20081020 ccy modify  
  183.             {  
  184.                 CScalerPageSelect(_PAGE8);  
  185.                 CScalerSetBit(_P8_OUTPUT_CTRL_A7, 0x4f, 0xB0);      //Enable snow noise. zhang_dc 2008.01.28  
  186.                 CVideoDisplaySet();  
  187.                 CScalerSetBit(_VDISP_CTRL_28, ~(_BIT7 | _BIT5 | _BIT3 | _BIT1 | _BIT0), (_BIT7 | _BIT3 |_BIT1 | _BIT0));  
  188.             //if(Panel[0].PanelConfig&_BIT3 == 0)  
  189.             //  CScalerSetBit(_VDISP_CTRL_28, ~( _BIT3), (0));  
  190.             //else  
  191.             //  CScalerSetBit(_VDISP_CTRL_28, ~( _BIT3), (_BIT3));  
  192.                 CAdjustBackgroundColor(0,0,0x00);  
  193.                 }  
  194.             else  
  195.             {  
  196.                 CScalerPageSelect(_PAGE8);  
  197.                 CScalerSetBit(_P8_OUTPUT_CTRL_A7, 0x4f, 0x20);      //Disable snow noise. zhang_dc 2008.01.28  
  198.                 CModeSetFreeRun();  
  199.                 CScalerSetBit(_VDISP_CTRL_28, ~(_BIT7 | _BIT5 | _BIT3 | _BIT1 | _BIT0), (_BIT5 | _BIT1 | _BIT0));  
  200.                 CAdjustBackgroundColor(0x00, 0x00, 0xff);     
  201.             }  
  202.         }  
  203.         else   
  204.         {  
  205.         //if(GET_INPUTPORT_TYPE(stSystemData.InputSource)!=_YPBPR_A0_PORT)  
  206.         //   CLR_DVD_POWERONOFF();    //add by dengyi on  2010-01-11  
  207.             CModeSetFreeRun();  
  208.             if(GET_TV_BACKGROUND())  
  209.                 {  
  210.                 if(GET_INPUTPORT_TYPE(stSystemData.InputSource)==_YPBPR_A0_PORT)  
  211.                     CAdjustBackgroundColor(0x00, 0x00, 0x00);     
  212.                   
  213.                     else  
  214.                 CAdjustBackgroundColor(0x00, 0x00, 0xff);     
  215.                 }  
  216.             else  
  217.                 CAdjustBackgroundColor(0x00, 0x00, 0x00);  
  218.             CScalerSetBit(_VDISP_CTRL_28, ~(_BIT7 | _BIT5 | _BIT3 | _BIT1 | _BIT0), (_BIT5 | _BIT1 | _BIT0));  
  219.         }  
  220.   
  221. }  
  222.   
  223.   
  224.   
  225.   
  226. </none>