⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd_msg.c

📁 液晶显示器程序代码
💻 C
📖 第 1 页 / 共 2 页
字号:
                if (KEY_TURBO_ENABLE > ucKey_Issued)
                {
                    ucKey_Issued    += 1;
                    ucKey_Repeat    = KEY_REPEAT_PERIOD;
                }
                else
                    ucKey_Repeat    = 0;

                ucNotify        = (ucP3_Curr == RIGHT_KEY_MASK) ? NOTIFY_RIGHT_KEY : NOTIFY_LEFT_KEY;  // Post right-key repeat message
            }
        }
        break;
/*    
    case LEFT_KEY_MASK :
        //usOSD_Timer     = (unsigned int)stGUD1.OSD_TIMEOUT << 9;        // Reset OSD timeout timer
        usOSD_Timer         = (unsigned int)stGUD1.OSD_TIMEOUT * 51; 

        if ((ucP3_Prev ^ ucP3_Curr) & LEFT_KEY_MASK)
        {
            ucKey_Issued    = 0;

            ucNotify        = NOTIFY_LEFT_KEY;                          // Post left-key pressed message
            ucKey_Repeat    = KEY_REPEAT_COUNT;
        }
        else
        {
            if (ucKey_Repeat)
                ucKey_Repeat    -= 1;
            else
            {
                if (KEY_TURBO_ENABLE > ucKey_Issued)
                {
                    ucKey_Issued    += 1;
                    ucKey_Repeat    = KEY_REPEAT_PERIOD;
                }
                else
                    ucKey_Repeat    = 0;

                ucNotify        = NOTIFY_LEFT_KEY;                      // Post left-key repeat message
            }
        }
        break;
*/
/*    case IR_KEY_MASK :
        ucKey_Issued    = 0;
        if ((ucP3_Prev ^ ucP3_Curr) & IR_KEY_MASK)
        {
            if (SOURCE_TV == (stGUD1.INPUT_SOURCE & 0x07))
            {
                //usOSD_Timer     = (unsigned int)stGUD1.OSD_TIMEOUT << 9;    // Reset OSD timeout timer
                usOSD_Timer         = (unsigned int)stGUD1.OSD_TIMEOUT * 51; 
            }

            ucNotify        = Data[0];                                      // Post IR-key pressed message
            ucKey_Repeat    = KEY_REPEAT_COUNT;
        }
        else if (NOTIFY_IR_VOLINC == Data[0] || NOTIFY_IR_VOLDEC == Data[0])
        {
            if (ucKey_Repeat)
                ucKey_Repeat    -= 1;
            else
            {
                ucNotify        = Data[0];
                ucKey_Repeat    = KEY_REPEAT_PERIOD;
            }
        }
        break;
 */   
    default :
        // No key or more than 1 key pressed. Post no message and reset key-repeat.
        ucKey_Repeat    = KEY_REPEAT_COUNT;
        ucKey_Issued    = 0;

#if (HIDDEN_PAGE)        
        // For triggering the hidden page
        if (0 == ucOSD_Page_Index && (RIGHT_KEY_MASK | LEFT_KEY_MASK) == ucP3_Curr)     ucNotify    = NOTIFY_LR_KEY;
#endif
        break;
    }

    return ucNotify;
}


void OSD_Dispatcher(unsigned char message)
{
    if (bReload)
    {
        // When bStable and bReload are both 1s, it is the first iteration after input signal becomes stable.
        // bReload will be cleared and user's font will be reloaded.
        bReload = 0;

        RTDSetByte(HOSTCTRL_02, 0x40);          // Wake RTD up
    	RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);	// Disable overlay control
        RTDOSDW(OSD_Reset);                    // Clear OSD
      //  RTDSetBit(OVL_CTRL_6D, 0xff, 0x02);     // Turn back to the original osd display width

       // Load_Font(JAPANESS == (stGUD1.FUNCTION & 0x07) ? Font_East_J : Font_East_C, 0x00, 0x12);
		//Load_Font(Font_Global, 0x00, 0x154);
/*
		Load_VLC_Font(Font_Global, 0x00, 0xa1);
      		if( (stGUD1.FUNCTION & 0x07) == JAPANESS )
      		{
      			Load_VLC_Font(Font_East_J, 0x573, 0x4B);
      		}
      		else
      		{
     		     	Load_VLC_Font(Font_East_C, 0x5a9, 0x45);
      		}
      		Load_VLC_Font(Font_Icons, 0x828, 0x70);
*/
        if (ucOSD_Page_Index)
        {
            message = NOTIFY_SHOW;
        }
        else
        {
            message = NOTIFY_NONE;

		RTDSetBit(OVL_CTRL_6D, 0x3f, 0x00);	//Red
		RTDSetBit(BGCOLOR_CONTROL_6C, 0x00, 0x00);
		RTDSetBit(OVL_CTRL_6D, 0x3f, 0x40);	//Green
		RTDSetBit(BGCOLOR_CONTROL_6C, 0x00, 0x00);
		RTDSetBit(OVL_CTRL_6D, 0x3f, 0x80);	//Blue
		RTDSetBit(BGCOLOR_CONTROL_6C, 0x00, 0x00);
	
           if (BEGIN_MODECHANGE < usTaskCnt)    Show_Note();
        }

        // We always read REG[1F] to see if frame-sync is OK.
        // ucStatus is the OR result of REG[1F] when OSD is open, and clear to 0 when OSD is close.
        //ucStatus    = 0;

    }

    if ((0 == ucOSD_Page_Index) && (!b_rgb_VOLUME_STATUS))
    {
        if ((BEGIN_MODECHANGE == usTaskCnt))
        {
            // Disable and clear input source note text
            RTDSetByte(HOSTCTRL_02, 0x40);
	     RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);     
            RTDOSDW(OSD_Reset);
        }
        else if ((BEGIN_SHOWHINT == usTaskCnt))
        {
           Show_Hint();
        }
		
		
		//else if (1 == usTaskCnt)
		//{
		//    RTDOSDW(OSD_Reset);            // Clear OSD
		//}
    }
    else if (NOTIFY_NONE == message)
    {
//        if (0 == usOSD_Timer && 0 != stGUD1.OSD_TIMEOUT && SOURCE_TV != (stGUD1.INPUT_SOURCE & 0x07))
        if (0 == usOSD_Timer && 0 != stGUD1.OSD_TIMEOUT )
        {
            message = NOTIFY_CLEAR_OSD;
        }
    }

    switch (message)
    {
    case NOTIFY_CLEAR_OSD :
//        if (ucOSD_Page_Index && SOURCE_TV != (stGUD1.INPUT_SOURCE & 0x07))
        if ((ucOSD_Page_Index) || (b_rgb_VOLUME_STATUS))
        {
            // OSD time-out
            ucOSD_Page_Index    = 0;
            ucOSD_Item_Index0   = 0;
            ucOSD_Item_Index1   = 0;
            ucOSD_Item_Index2   = 0;

            b_rgb_VOLUME_STATUS = 0;  // echo add 04/05/18

            RTDSetByte(HOSTCTRL_02, 0x40);  // Wake RTD up

            // Although you can add ending animation here, I don't think it is necessary.
				RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
            RTDOSDW(OSD_Reset);            // Clear OSD
        }
        break;
/*
    case NOTIFY_EXIT_KEY :
            ucOSD_Page_Index    = 0;
            ucOSD_Item_Index0   = 0;
            ucOSD_Item_Index1   = 0;
            ucOSD_Item_Index2   = 0;

            b_rgb_VOLUME_STATUS = 0;  // echo add 04/05/18

            RTDSetByte(HOSTCTRL_02, 0x40);  // Wake RTD up

            // Although you can add ending animation here, I don't think it is necessary.
				RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);
            RTDOSDW(OSD_Reset);            // Clear OSD
        break;
*/

/*
    case NOTIFY_EXIT_KEY :
        break;
*/
    case NOTIFY_MENU_KEY :
    case NOTIFY_IR_SOURCE :
        if (SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07))
        {
#if (TMDS_ENABLE) 
            Change_Source(SOURCE_DVI);
#else
            Change_Source(SOURCE_AV);
#endif
        }
        else if (SOURCE_DVI == (stGUD1.INPUT_SOURCE & 0x07))
            Change_Source(SOURCE_AV);
        else if (SOURCE_AV == (stGUD1.INPUT_SOURCE & 0x07))
            Change_Source(SOURCE_SV);
        else if (SOURCE_SV == (stGUD1.INPUT_SOURCE & 0x07))
        {
#if (VIDEO_CHIP == VDC_SAA7118)
            Change_Source(SOURCE_YUV);
#else
            Change_Source(SOURCE_TV);
#endif
        }
        else if (SOURCE_YUV == (stGUD1.INPUT_SOURCE & 0x07))
        {
            Change_Source(SOURCE_TV);
        }
        else
        {
            Change_Source(SOURCE_VGA);
        }
        break;

    default :
        {
            // Save the current OSD page index
            unsigned char   ucPage_Curr     = ucOSD_Page_Index;

            // Send messages to OSD process
            //(*OSD_Proc[ucOSD_Page_Index][stGUD1.INPUT_SOURCE & 0x07])(message);
            OSD_Proc(message);

            // If OSD page is changed ...
            if (ucPage_Curr != ucOSD_Page_Index)
            {
                if (ucOSD_Page_Index)
                {
                    if (0 == ucPage_Curr)
                    {
                        // ucOSD_Page_Index becomes non-zero value from zero. It is the first show of OSD.
                        // Maybe RTD3001 is still in power-saving mode, or we are showing some text on screen,
                        // like "No Signal". So we must wake up RTD3001 and clear screen before we display OSD.
                        RTDSetByte(HOSTCTRL_02, 0x40);
                        RTDSetBit(VDIS_CTRL_20, 0xff, 0x01);
						RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);     
                        RTDOSDW(OSD_Reset);
                    }

                    //(*OSD_Proc[ucOSD_Page_Index][stGUD1.INPUT_SOURCE & 0x07])(NOTIFY_SHOW);
                    OSD_Proc(NOTIFY_SHOW);

					if (0 == ucPage_Curr)
					{
						//RTDCodeW(OSD_Enable);
						//RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);

						OSD_Opening();
					}
                }
                else
                {
                    // OSD should be cleared when ucOSD_Page_Index becomes 0. 
                    // Clear other OSD status registers for safety
                    ucOSD_Item_Index0   = 0;
                    ucOSD_Item_Index1   = 0;
                    ucOSD_Item_Index2   = 0;

                    RTDSetByte(HOSTCTRL_02, 0x40);  // Wake RTD up

                    OSD_Ending();
					//RTDSetBit(OVL_CTRL_6D, 0xfe, 0x00);     
                    //RTDCodeW(OSD_Reset);            // Clear OSD
                }
            }
            else
            {
                // OSD page is not changed
                if (ucOSD_Page_Index)
                {
					if (NOTIFY_SHOW == message)     
					{
						RTDCodeW(OSD_Enable);
						RTDSetBit(OVL_CTRL_6D, 0xfe, 0x01);
					}

                    // Change H/V Position and ADC clock may cause overflow/underflow temporarily.
                    if (NOTIFY_RIGHT_KEY == message || NOTIFY_LEFT_KEY == message)
                    {

						RTDSetByte(STATUS0_01, 0x00);  // Clear status
                        RTDSetByte(STATUS1_1F, 0x00);  // Clear status

                    }
#if (SHOW_CHECK)
                    // Just for showing debug information
                    OSD_Show_Check();
			if( ucOSD_Item_Index0 == 5 &&  ucOSD_Page_Index == 1 &&  ucOSD_Item_Index1)
			{
				ucOSD_Page_Index = 7;
				OSD_Show_Check();
				ucOSD_Page_Index = 1;

			}
#endif
                }
                else
                {
                    // We always read REG[1F] to see if frame-sync is OK.
                    // ucStatus is the OR result of REG[1F] when OSD is open, and clear to 0 when OSD is close.
                    ucStatus    = 0;
#if (RTDDEBUG)
                    usPE_Sum    = 0;
#endif
                }
            }
        }
        break;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -