📄 osdctrl.lst
字号:
C51 COMPILER V7.50 OSDCTRL 10/30/2006 16:14:44 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE OSDCTRL
OBJECT MODULE PLACED IN .\Obj\OSDCTRL.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Source\OSD\OSDCTRL.C LARGE OPTIMIZE(6,SPEED) BROWSE INCDIR(.\Include\;.\Sou
-rce\;.\Include\Panel\;.\Include\GammaTable\;.\Include\tuner\) DEFINE(T103) DEBUG OBJECTEXTEND PRINT(.\OSDCTRL.lst) OBJEC
-T(.\Obj\OSDCTRL.obj)
line level source
1 //---------------------------------------------------------------------------
2 // Terawins Inc. Company Confidential Strictly Private
3 //
4 // $Archive: OSDCtrl.c $
5 // $Revision: 2.0 $
6 // $Author: jwang $
7 // $Date: 2003/08/13 $
8 //
9 // --------------------------------------------------------------------------
10 // >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
11 // --------------------------------------------------------------------------
12 // Copyright 2002 (c) Terawins Inc.
13 // This is an unpublished work.
14 // --------------------------------------------------------------------------
15 #include <reg51.h>
16 #include "common.h"
17
18 #include "Struct.h"
19 #include "System.h"
20
21 #include "SRC_ctrl.h"
22 #include "TW803Reg.h"
23 #include "OSDCtrl.h"
24 #include "TwoWire.h"
25 #include "OSDDraw.h"
26 #include "Keypad.h"
27 //#include "Video.h"
28 #include "Tuner.h"
29 #include "Global.h"
30 #include "NVRam.h"
31 #include "struct.h"
32
33
34
35 bit idata skipon=0;
36
37 void OSDItemAdj(uCHAR cAdj)
38 {
39 1 sCHAR sStep;
40 1 if(cAdj==INCREASE)
41 1 sStep=1;
42 1 else if(cAdj==DECREASE)
43 1 sStep=-1;
44 1 #ifdef LOAD_TIME
if(cAdj==INCREASE1)
{
AdjTimingB8(1);
return;
}
else if(cAdj==DECREASE1)
{
AdjTimingB8(-1);
return;
C51 COMPILER V7.50 OSDCTRL 10/30/2006 16:14:44 PAGE 2
}
#endif
56 1 OSDItemAdjVideo(sStep);
57 1 }
58
59 //extern uCHAR idata m_cOSDMenu;
60
61 void OSDItemAdjVideo(sCHAR sStep)
62 {
63 1 if(m_cOSDMenu==idVIDEOMENU)
64 1 {
65 2
66 2 switch(m_cOSDFunc){
67 3 case idBRIGHTMENU:
68 3 AdjVideoBright(sStep);
69 3 break;
70 3 case idCONTRASTMENU:
71 3 AdjVideoContrast(sStep);
72 3 break;
73 3
74 3 case idSHARPMENU:
75 3 AdjVideoSharp(sStep);
76 3 break;
77 3
78 3 case idSATMENU:
79 3 AdjVideoSat(sStep);
80 3 break;
81 3
82 3 case idHUEMENU:
83 3 AdjVideoHue(sStep);
84 3 break;
85 3 #ifdef T112
case idRGBMENU: // add by Sherman 06'01'18
AdjVideoRGB(sStep);
break;
case idVCOMAMENU: // add by Sherman 06'01'23
AdjVideoVCOMA(sStep);
break;
case idVCOMDMENU: // add by Sherman 06'01'23
AdjVideoVCOMD(sStep);
break;
#endif
96 3 #ifdef LOAD_TIME
case idTIMEMENU:
AdjTimingB2(sStep);
break;
#endif
101 3 default :break;
102 3 }
103 2 }
104 1
105 1 #ifdef TV
else
{
switch(m_cOSDFunc){
case idCHANNEL_TV:
AdjTVChannel(sStep, 1);
break;
#ifdef PAL
case iSOUNDSYSTEM_TV:
C51 COMPILER V7.50 OSDCTRL 10/30/2006 16:14:44 PAGE 3
AdjTVSoundSystem();
break;
#endif
#ifdef NTSC
case idSKIP_TV:
AdjTVSkip();
break;
case idSOURCE_TV:
AdjTVSource();
//OSDShowTVSource(sStep);
break;
#endif
case idFINETUNE_TV:
AdjTVFineTune(sStep);
break;
case idAUTOMEMORY_TV:
AutoMemory();
break;
case idRECALL_TV:
// OSDShowRESET(0);
ResetTVChannel();
// OSDShowRESET(1);
break;
default: break;
}
}
#endif
145 1
146 1 }
147
148 #if 0
void AdjVolume(sCHAR sStep)
{
if( (EepVideo.cVolume+sStep)<=sOSDParamsMax.cVolume
&&(EepVideo.cVolume+sStep)>=sOSDParamsMin.cVolume)
{
EepVideo.cVolume += sStep;
I2CWriteByte(TW803_P0, 0xE9, EepVideo.cVolume);
OSDShowVideoData();
if(EepVideo.cVolume==sOSDParamsMin.cVolume)
AUDIO_MUTE=1; //MUTE audio
else
AUDIO_MUTE=0; //open audio
}
#ifdef NVRAM
I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_VOLUME_INDEX, EepVideo.cVolume);
#endif
return;
}
#endif
171
172
173 //extern uCHAR idata m_cStandard;
174 #ifdef LOADTIME
void AdjTimingB2(sCHAR sStep)
{
sStep=sStep;
C51 COMPILER V7.50 OSDCTRL 10/30/2006 16:14:44 PAGE 4
if(I2CReadByte(TW803_P0,0xb2)+sStep>=0&&I2CReadByte(TW803_P0,0xb2)+sStep<=0xFF)
{
if(m_cStandard==S_NTSC)
{
EepVideo.cB2=I2CReadByte(TW803_P0,0xb2)+sStep;
EepVideo.cB8=I2CReadByte(TW803_P0,0xb8);
I2CWriteByte(TW803_P0,0xb2,EepVideo.cB2);
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8, EepVideo.cB8);
twdDelay(NVRDELAY);
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2, EepVideo.cB2);
twdDelay(NVRDELAY);
EepVideo.cFlag=Panel_ID;
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX, EepVideo.cFlag);
}
else if(m_cStandard==S_PAL)
{
EepVideo.cB2_PAL=I2CReadByte(TW803_P0,0xb2)+sStep;
EepVideo.cB8_PAL=I2CReadByte(TW803_P0,0xb8);
I2CWriteByte(TW803_P0,0xb2,EepVideo.cB2_PAL);
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8_PAL, EepVideo.cB8_PAL);
twdDelay(NVRDELAY);
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2_PAL, EepVideo.cB2_PAL);
twdDelay(NVRDELAY);
EepVideo.cFlag_PAL=Panel_ID;
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX1, EepVideo.cFlag_PAL);
}
twdDelay(NVRDELAY);
OSDShowVideoData();
}
}
void AdjTimingB8(sCHAR sStep)
{
sStep=sStep;
if(I2CReadByte(TW803_P0,0xb8)+sStep>=0&&I2CReadByte(TW803_P0,0xb8)+sStep<=0xFF)
{
if(m_cStandard==S_NTSC)
{
EepVideo.cB2=I2CReadByte(TW803_P0,0xb2);
EepVideo.cB8=I2CReadByte(TW803_P0,0xb8)+sStep;
I2CWriteByte(TW803_P0,0xb8,EepVideo.cB8);
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8,EepVideo.cB8);
twdDelay(NVRDELAY);
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2,EepVideo.cB2);
twdDelay(NVRDELAY);
EepVideo.cFlag=Panel_ID;
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX, EepVideo.cFlag);
}
else if(m_cStandard==S_NPAL)
{
EepVideo.cB2_PAL=I2CReadByte(TW803_P0,0xb2);
EepVideo.cB8_PAL=I2CReadByte(TW803_P0,0xb8)+sStep;
I2CWriteByte(TW803_P0,0xb8,EepVideo.cB8_PAL);
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8_PAL, EepVideo.cB8_PAL);
twdDelay(NVRDELAY);
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2_PAL, EepVideo.cB2_PAL);
C51 COMPILER V7.50 OSDCTRL 10/30/2006 16:14:44 PAGE 5
twdDelay(NVRDELAY);
EepVideo.cFlag_PAL=Panel_ID;
I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX1, EepVideo.cFlag_PAL);
}
twdDelay(NVRDELAY);
OSDShowVideoData();
}
}
#endif
250 #if VIDEO_AVAILABLE
251 void AdjVideoBright(sCHAR sStep)
252 {
253 1 if( (EepVideo.cBright+sStep)<=V_BRIGHT_MAX && (EepVideo.cBright+sStep)>=V_BRIGHT_MIN)
254 1 {
255 2 EepVideo.cBright+=sStep;
256 2 I2CWriteByte(TW803_P0,VBRIGHT,EepVideo.cBright); //Ruby 2004-10-09
257 2 OSDShowVideoData();
258 2 I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_BRIGHT_INDEX, EepVideo.cBright);
259 2 twdDelay(NVRDELAY);
260 2 }
261 1 }
262
263 void AdjVideoContrast(sCHAR sStep)
264 {
265 1 if( (EepVideo.cContrast+sStep)<=V_CONTRAST_MAX && (EepVideo.cContrast+sStep)>=V_CONTRAST_MIN)
266 1 {
267 2 EepVideo.cContrast+=sStep;
268 2 I2CWriteByte(TW803_P0,VCONTRAST,EepVideo.cContrast); //Ruby 2004-10-09
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -