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

📄 tftsetup.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 2 页
字号:
{    show_string [0] = (_bLEVEL/100)+1;    show_string [1] = (((_bLEVEL-(show_string [0]-1)*100))/10)+1;    show_string [2] = (_bLEVEL-((show_string [0]-1)*100)-((show_string [1]-1)*10))+1;    show_string [3] = _VIPOR_EOF;}    void  show_TFT_MENU(void){		Vipor_PrintString(0,0,TFT_SETUPOSD_OSDColor,(BYTE*) &TFTOSD_BR_String);		   show_num_string(_bLEVEL_TABLE[0]);		Vipor_PrintString_ALL(0,3,TFT_SETUPOSD_OSDColor,(BYTE*) &show_string);		Vipor_PrintString(1,0,TFT_SETUPOSD_OSDColor,(BYTE*) &TFTOSD_CO_String);		   show_num_string(_bLEVEL_TABLE[1]);		Vipor_PrintString_ALL(1,3,TFT_SETUPOSD_OSDColor,(BYTE*) &show_string);				Vipor_PrintString(2,0,TFT_SETUPOSD_OSDColor,(BYTE*) &TFTOSD_HU_String);		   show_num_string(_bLEVEL_TABLE[2]);		Vipor_PrintString_ALL(2,3,TFT_SETUPOSD_OSDColor,(BYTE*) &show_string);				Vipor_PrintString(3,0,TFT_SETUPOSD_OSDColor,(BYTE*) &TFTOSD_SA_String);		   show_num_string(_bLEVEL_TABLE[3]);		Vipor_PrintString_ALL(3,3,TFT_SETUPOSD_OSDColor,(BYTE*) &show_string);				Vipor_PrintString(4,0,TFT_SETUPOSD_OSDColor,(BYTE*) &TFTOSD_RG_String);		   show_num_string(_bLEVEL_TABLE[4]);		Vipor_PrintString_ALL(4,3,TFT_SETUPOSD_OSDColor,(BYTE*) &show_string);				Vipor_PrintString(5,0,TFT_SETUPOSD_OSDColor,(BYTE*) &TFTOSD_GG_String);		   show_num_string(_bLEVEL_TABLE[5]);		Vipor_PrintString_ALL(5,3,TFT_SETUPOSD_OSDColor,(BYTE*) &show_string);				Vipor_PrintString(6,0,TFT_SETUPOSD_OSDColor,(BYTE*) &TFTOSD_BG_String);					   show_num_string(_bLEVEL_TABLE[6]);		Vipor_PrintString_ALL(6,3,TFT_SETUPOSD_OSDColor,(BYTE*) &show_string);				Vipor_PrintString(7,0,TFT_SETUPOSD_OSDColor,(BYTE*) &TFTOSD_RO_String);		   show_num_string(_bLEVEL_TABLE[7]);		Vipor_PrintString_ALL(7,3,TFT_SETUPOSD_OSDColor,(BYTE*) &show_string);				Vipor_PrintString(8,0,TFT_SETUPOSD_OSDColor,(BYTE*) &TFTOSD_GO_String);		   show_num_string(_bLEVEL_TABLE[8]);		Vipor_PrintString_ALL(8,3,TFT_SETUPOSD_OSDColor,(BYTE*) &show_string);				Vipor_PrintString(9,0,TFT_SETUPOSD_OSDColor,(BYTE*) &TFTOSD_BO_String);		   show_num_string(_bLEVEL_TABLE[9]);		Vipor_PrintString_ALL(9,3,TFT_SETUPOSD_OSDColor,(BYTE*) &show_string);} void show_Hilight_ID(BYTE id){	OsdWindow(0x01,	0, id, 5,id, TFT_SETUPOSD_HilightColor);}BYTE TFTSetup_ProcessKey(BYTE bKey){	  BYTE  bKeyReturn;    if (__TFTOSDStatusInfo.bSetupMenu == TFT_OSD_SetupMenu_OFF && KEY_PICTURE!= bKey)        return bKey;	switch(bKey)	{		case KEY_PICTURE:  			if(__TFTOSDStatusInfo.bSetupMenu==TFT_OSD_SetupMenu_OFF)			{				__TFTOSDStatusInfo.bSetupMenu=TFT_OSD_SetupMenu_ON;		    show_TFT_MENU();		    OsdWindow(0x02,	0, 0, 5,9, TFT_SETUPOSD_BackGroundColor);        show_Hilight_ID(_bLEVEL_ID);			}			else			{				__TFTOSDStatusInfo.bSetupMenu=TFT_OSD_SetupMenu_OFF;				__dwTFT_OsdSetupTimer=0xffffffff;				TFTOSD_SetupClearAll();			}				bKeyReturn =KEY_NO_KEY;			break;		case KEY_UP:				if(_bLEVEL_ID==0)					_bLEVEL_ID=9;				else _bLEVEL_ID--;        show_Hilight_ID(_bLEVEL_ID);				bKeyReturn =KEY_NO_KEY;				break;						case KEY_DOWN:				if(_bLEVEL_ID==9)					_bLEVEL_ID=0;				else _bLEVEL_ID++;        show_Hilight_ID(_bLEVEL_ID);				bKeyReturn =KEY_NO_KEY;				break;					case KEY_LEFT:				if(_bLEVEL_TABLE[_bLEVEL_ID]==0)					_bLEVEL_TABLE[_bLEVEL_ID]=255;				else _bLEVEL_TABLE[_bLEVEL_ID]--;				show_TFT_MENU();			bKeyReturn = KEY_NO_KEY;			break;		case KEY_RIGHT:				if(_bLEVEL_TABLE[_bLEVEL_ID]==255)					_bLEVEL_TABLE[_bLEVEL_ID]=0;				else _bLEVEL_TABLE[_bLEVEL_ID]++;				show_TFT_MENU();			bKeyReturn = KEY_NO_KEY;			break;			case KEY_PREV:				if(_bLEVEL_TABLE[_bLEVEL_ID]<10)					_bLEVEL_TABLE[_bLEVEL_ID]=_bLEVEL_TABLE[_bLEVEL_ID]+245;				else _bLEVEL_TABLE[_bLEVEL_ID]=_bLEVEL_TABLE[_bLEVEL_ID]-10;				show_TFT_MENU();			bKeyReturn = KEY_NO_KEY;			break;		case KEY_NEXT:				if(_bLEVEL_TABLE[_bLEVEL_ID]>245)					_bLEVEL_TABLE[_bLEVEL_ID]=_bLEVEL_TABLE[_bLEVEL_ID]-245;				else _bLEVEL_TABLE[_bLEVEL_ID]=_bLEVEL_TABLE[_bLEVEL_ID]+10;				show_TFT_MENU();			bKeyReturn = KEY_NO_KEY;			break;						default:                    bKeyReturn = bKey;                    break;	}  Vipor_SetPicture_ALL();	return bKeyReturn;}						      #else#ifdef  MUSTEK_RING_BRIGHT //SetPicture_ALLBYTE TFTSetup_ProcessKey(BYTE bKey){	  BYTE  bKeyReturn;          if(__bSetupMode)                   return bKey;                      if (__TFTOSDStatusInfo.bSetupMenu == TFT_OSD_SetupMenu_OFF && (bKey != KEY_PICTURE && bKey != KEY_BRIGHT_UP && bKey != KEY_BRIGHT_DOWN))        return bKey;            	switch(bKey)	{		case KEY_PICTURE:  		  __dwTFT_OsdSetupTimer = OS_GetSysTimer()+COUNT_3_SEC;			if(__TFTOSDStatusInfo.bSetupMenu==TFT_OSD_SetupMenu_OFF)			{				__TFTOSDStatusInfo.bSetupMenu=TFT_OSD_SetupMenu_ON;		    show_BRIGHT_MENU(_bLEVEL_ID-5);		    //OsdWindow(0x02,	0, 0, 5,9, TFT_SETUPOSD_BackGroundColor);			}			else			{				_bLEVEL_ID++;					if (_bLEVEL_ID > 11)				  _bLEVEL_ID = 5;				  Vipor_SetPicture_Brightness(TFT_BRIGHTNESS_VALUE_LIST[_bLEVEL_ID-1]);        show_BRIGHT_MENU(_bLEVEL_ID-5);				  			}				bKeyReturn =KEY_NO_KEY;			break;		case KEY_BRIGHT_UP:  		  __dwTFT_OsdSetupTimer = OS_GetSysTimer()+COUNT_3_SEC;			if(__TFTOSDStatusInfo.bSetupMenu==TFT_OSD_SetupMenu_OFF)			{				__TFTOSDStatusInfo.bSetupMenu=TFT_OSD_SetupMenu_ON;		    show_BRIGHT_MENU(_bLEVEL_ID-5);		    //OsdWindow(0x02,	0, 0, 5,9, TFT_SETUPOSD_BackGroundColor);			}			else			{				_bLEVEL_ID++;					if (_bLEVEL_ID > 11)				  _bLEVEL_ID = 5;				  Vipor_SetPicture_Brightness(TFT_BRIGHTNESS_VALUE_LIST[_bLEVEL_ID-1]);        show_BRIGHT_MENU(_bLEVEL_ID-5);				  			}				bKeyReturn =KEY_NO_KEY;			break;		case KEY_BRIGHT_DOWN:  		  __dwTFT_OsdSetupTimer = OS_GetSysTimer()+COUNT_3_SEC;			if(__TFTOSDStatusInfo.bSetupMenu==TFT_OSD_SetupMenu_OFF)			{				__TFTOSDStatusInfo.bSetupMenu=TFT_OSD_SetupMenu_ON;		    show_BRIGHT_MENU(_bLEVEL_ID-5);		    //OsdWindow(0x02,	0, 0, 5,9, TFT_SETUPOSD_BackGroundColor);			}			else			{				_bLEVEL_ID--;					if (_bLEVEL_ID < 5)				  _bLEVEL_ID = 11;				  Vipor_SetPicture_Brightness(TFT_BRIGHTNESS_VALUE_LIST[_bLEVEL_ID-1]);        show_BRIGHT_MENU(_bLEVEL_ID-5);				  			}				bKeyReturn =KEY_NO_KEY;			break;		default:                    bKeyReturn = bKey;                    break;				}	return bKeyReturn;}				#else //MUSTEK_RING_BRINESSBYTE TFTSetup_ProcessKey(BYTE bKey){    BYTE  bKeyReturn;    if (__TFTOSDStatusInfo.bSetupMenu == TFT_OSD_SetupMenu_OFF && KEY_PICTURE!= bKey)        return bKey;	switch(bKey)	{		case KEY_PICTURE:			if(__TFTOSDStatusInfo.bSetupMenu==TFT_OSD_SetupMenu_OFF)			{				__TFTOSDStatusInfo.bSetupMenu=TFT_OSD_SetupMenu_ON;				TFTOSD_SetupBackGround();				TFTOSD_SetupDrawBar(TFT_SETUP_BRIGHTNESS,__TFTPicAttr.bBrightness);				TFTOSD_SetupDrawBar(TFT_SETUP_CONTRAST,__TFTPicAttr.bContrast);				TFTOSD_SetupDrawBar(TFT_SETUP_SATURATION,__TFTPicAttr.bSaturation);				TFTOSD_SetupDrawBar(TFT_SETUP_RESET,0);								TFTOSD_SetupHilight(TFT_SETUP_BEGIN);				__bTFTSetupId=TFT_SETUP_BEGIN;        __dwTFT_OsdSetupTimer = OS_GetSysTimer()+COUNT_5_SEC;			}			else			{				__TFTOSDStatusInfo.bSetupMenu=TFT_OSD_SetupMenu_OFF;				__dwTFT_OsdSetupTimer=0xffffffff;				TFTOSD_SetupClearAll();			}				bKeyReturn =KEY_NO_KEY;			break;		case KEY_UP:				if(__bTFTSetupId==TFT_SETUP_BEGIN)					__bTFTSetupId=TFT_SETUP_NUM-1;				else __bTFTSetupId--;				TFTOSD_SetupHilight(__bTFTSetupId);				__dwTFT_OsdSetupTimer= OS_GetSysTimer()+COUNT_5_SEC;				bKeyReturn =KEY_NO_KEY;				break;						case KEY_DOWN:				__bTFTSetupId++;				if(__bTFTSetupId==TFT_SETUP_NUM)					__bTFTSetupId=TFT_SETUP_BEGIN;				TFTOSD_SetupHilight(__bTFTSetupId);				__dwTFT_OsdSetupTimer= OS_GetSysTimer()+COUNT_5_SEC;				bKeyReturn =KEY_NO_KEY;				break;		case KEY_LEFT:                        _TFT_AdjustSetting(TFT_SETTING_MINUS);			bKeyReturn = KEY_NO_KEY;			break;		case KEY_RIGHT:                        _TFT_AdjustSetting(TFT_SETTING_PLUS);			bKeyReturn = KEY_NO_KEY;			break;		case KEY_ENTER:    case KEY_PLAY:			if (TFT_SETUP_RESET == __bTFTSetupId)                        {						__TFTPicAttr.bBrightness=TFT_SETUP_BRIGHTNESS_DEFAULT_LEVEL;						__TFTPicAttr.bContrast=TFT_SETUP_CONTRAST_DEFAULT_LEVEL;						__TFTPicAttr.bSaturation=TFT_SETUP_SATURATION_DEFAULT_LEVEL;						TFTOSD_SetupDrawBar(TFT_SETUP_BRIGHTNESS,__TFTPicAttr.bBrightness);						TFTOSD_SetupDrawBar(TFT_SETUP_CONTRAST,__TFTPicAttr.bContrast);						TFTOSD_SetupDrawBar(TFT_SETUP_SATURATION,__TFTPicAttr.bSaturation);						Vipor_SetPicture_Brightness(TFT_BRIGHTNESS_VALUE_LIST[__TFTPicAttr.bBrightness-1]);						Vipor_SetPicture_Contrast(TFT_CONTRAST_VALUE_LIST[__TFTPicAttr.bContrast-1]);						Vipor_SetPicture_Saturation(TFT_SATURATION_VALUE_LIST[__TFTPicAttr.bSaturation-1]);                        }                        else                        {                            __TFTOSDStatusInfo.bSetupMenu=TFT_OSD_SetupMenu_OFF;                            TFTOSD_SetupClearAll();                        }			bKeyReturn =KEY_NO_KEY;			break;		default:                    bKeyReturn = bKey;                    break;	}	return bKeyReturn;}#endif //MUSTEK_RING_BRIGHT#endif //SetPicture_ALL//*******************************************************************************//--------------------------------------------------------------------------// Function    : TFTSetup_Trigger// Description :setup ui trigger // input      //--------------------------------------------------------------------------void TFTSetup_Trigger(void){	if (__TFTOSDStatusInfo.bSetupMenu==TFT_OSD_SetupMenu_ON)	{		if(__dwTFT_OsdSetupTimer< OS_GetSysTimer())		{			__dwTFT_OsdSetupTimer=0xffffffff;			__TFTOSDStatusInfo.bSetupMenu=TFT_OSD_SetupMenu_OFF;			TFTOSD_SetupClearAll();		}	}}	void _TFT_AdjustSetting(BOOL blPlus){    switch(__bTFTSetupId)    {        case TFT_SETUP_BRIGHTNESS:            if (blPlus)            {                if (__TFTPicAttr.bBrightness < TFT_SETUP_VALUE_LEVEL)                    __TFTPicAttr.bBrightness++;            }            else            {            if (__TFTPicAttr.bBrightness > 1)                __TFTPicAttr.bBrightness--;            }            Vipor_SetPicture_Brightness(TFT_BRIGHTNESS_VALUE_LIST[__TFTPicAttr.bBrightness-1]);            TFTOSD_SetupFillBar(blPlus, __bTFTSetupId,__TFTPicAttr.bBrightness - blPlus);            break;        case TFT_SETUP_CONTRAST:            if (blPlus)            {                if (__TFTPicAttr.bContrast < TFT_SETUP_VALUE_LEVEL)                    __TFTPicAttr.bContrast++;            }            else            {            if (__TFTPicAttr.bContrast > 1)                __TFTPicAttr.bContrast--;            }            Vipor_SetPicture_Contrast(TFT_CONTRAST_VALUE_LIST[__TFTPicAttr.bContrast-1]);            TFTOSD_SetupFillBar(blPlus, __bTFTSetupId,__TFTPicAttr.bContrast - blPlus);            break;        case TFT_SETUP_SATURATION:            if (blPlus)            {                if (__TFTPicAttr.bSaturation < TFT_SETUP_VALUE_LEVEL)                    __TFTPicAttr.bSaturation++;            }            else            {            if (__TFTPicAttr.bSaturation > 1)                __TFTPicAttr.bSaturation--;            }            Vipor_SetPicture_Saturation(TFT_SATURATION_VALUE_LIST[__TFTPicAttr.bSaturation-1]);            TFTOSD_SetupFillBar(blPlus, __bTFTSetupId,__TFTPicAttr.bSaturation  - blPlus);            break;        default:            break;    }    TFTSetup_WriteSetupData();    __dwTFT_OsdSetupTimer = OS_GetSysTimer()+COUNT_5_SEC;}#else//add dummy const code for *.linBYTE code bDummyTFTSetup;#endif

⌨️ 快捷键说明

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