osdctrl.lst

来自「宏芯T102芯片驱动(51单片机作主控)」· LST 代码 · 共 526 行 · 第 1/2 页

LST
526
字号
C51 COMPILER V7.06   OSDCTRL                                                               12/28/2004 10:14:05 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE OSDCTRL
OBJECT MODULE PLACED IN .\obj\OSDCTRL.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE source\new_osd\OSDCTRL.C BROWSE INCDIR(.\include\;.\source\) DEBUG OBJECTEX
                    -TEND PRINT(.\OSDCTRL.lst) OBJECT(.\obj\OSDCTRL.obj)

stmt 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          #include "System.h"
  18          #include "Struct.h"
  19          #include "TW101Reg.h"
  20          #include "OSDCtrl.h"
  21          #include "TwoWire.h"
  22          #include "OSDDraw.h"
  23          #include "Keypad.h"
  24          //#include "SrcCtrl.h"
  25          //#include "ModeCtrl.h"
  26          #include "Video.h"
  27          //#include "Auto.h"
  28          #include "Tuner.h"
  29          
  30          #ifdef NVRAM
  31          #include "NVRam.h"
  32          extern uWORD idata m_wEepRom;
  33          #endif
  34          extern bit m_bAir_Cable;
  35          extern bit m_bTV_Skip;
  36          extern uCHAR ir_data;
  37          extern void BKPower(void);
  38          #ifdef TIMER1
  39          extern void Timer1Reset(void);
  40          extern void Timer1Start(void);
  41          extern void Timer1Stop(void);
  42          #endif
  43          
  44          extern uCHAR m_cSoundSystem;
  45          extern bit m_bBKPowerOn;
  46          extern LoadFilter(uCHAR);
  47          extern BOOL SrcOptimizing(uCHAR cTuneType);
  48          extern OSDPARAMS code sOSDParamsDef, sOSDParamsMin, sOSDParamsMax;
  49          extern uCHAR idata m_cOSDEvent;
  50          extern uCHAR idata m_cOSDFunc;
  51          extern uCHAR idata m_cItem;
  52          extern uCHAR idata m_cSource;
  53          extern uCHAR code OSDPositionTable[];
  54          extern uCHAR idata m_cBuff[4];
C51 COMPILER V7.06   OSDCTRL                                                               12/28/2004 10:14:05 PAGE 2   

  55          extern uWORD idata m_wBuff[3];
  56          
  57          bit idata skipon=0;
  58          
  59          #if VIDEO_AVAILABLE
  60          extern EEPVIDEO idata EepVideo;
  61          #endif
  62          
  63          
  64          void OSDItemAdj(uCHAR cAdj)
  65          {
  66   1              sCHAR sStep;
  67   1              if(cAdj==INCREASE)
  68   1                      sStep=1;
  69   1              else if(cAdj==DECREASE)
  70   1                      sStep=-1;
  71   1              
  72   1              if(m_cOSDFunc==idVOLUMEMENU)
  73   1              {
  74   2                      if(sStep>0)
  75   2                              AdjVolume(1);
  76   2                      else
  77   2                              AdjVolume(-1);
  78   2                      return;
  79   2              }
  80   1              if(cAdj==INCREASE1)
  81   1              {
  82   2                      AdjTimingB8(1);
  83   2                      return;
  84   2              }
  85   1              else if(cAdj==DECREASE1)
  86   1              {
  87   2                      AdjTimingB8(-1);
  88   2                      return;
  89   2          }
  90   1              
  91   1                      OSDItemAdjVideo(sStep);
  92   1      }
  93          
  94          
  95          
  96          void OSDItemAdjVideo(sCHAR sStep)
  97          {
  98   1              switch(m_cOSDFunc){
  99   2              case idBRIGHT_VIDEO:
 100   2              case idBRIGHTMENU_VIDEO:
 101   2                      AdjVideoBright(sStep);
 102   2                      break;
 103   2              case idCONTRAST_VIDEO:
 104   2              case idCONTRASTMENU_VIDEO:
 105   2                      AdjVideoContrast(sStep);
 106   2                      break;
 107   2              case idSHARP_VIDEO:
 108   2              case idSHARPMENU_VIDEO:
 109   2                      AdjVideoSharp(sStep);
 110   2                      break;
 111   2              case idSAT_VIDEO:       
 112   2              case idSATMENU_VIDEO:
 113   2                      AdjVideoSat(sStep);
 114   2                      break;
 115   2              case idHUE_VIDEO:
 116   2              case idHUEMENU_VIDEO:
C51 COMPILER V7.06   OSDCTRL                                                               12/28/2004 10:14:05 PAGE 3   

 117   2                      AdjVideoHue(sStep);
 118   2                      break;
 119   2              case idTIMEMENU_VIDEO:
 120   2                      AdjTimingB2(sStep);
 121   2                      break;
 122   2      #ifdef TV
 123   2              case idCHANNEL_TV:
 124   2                      AdjTVChannel(sStep, 1);
 125   2                      break;
 126   2      #ifdef PAL
                      case iSOUNDSYSTEM_TV:
                              AdjTVSoundSystem();
                              break;
              #endif
 131   2      #ifdef NTSC
 132   2              case idSKIP_TV:
 133   2                      AdjTVSkip();
 134   2                      break;
 135   2              case idSOURCE_TV:
 136   2              OSDShowTVSource(sStep);
 137   2                      break;
 138   2      #endif
 139   2              case idFINETUNE_TV:
 140   2                      AdjTVFineTune(sStep);
 141   2                      break;
 142   2              case idAUTOMEMORY_TV:
 143   2                      AutoMemory();
 144   2      //              OSDExit();
 145   2                      break;
 146   2              case idRECALL_TV:
 147   2                      ResetTVChannel();
 148   2      //      case idAUTOSCAN_TV:
 149   2      //              AutoScan();
 150   2                      break;
 151   2      #endif
 152   2              default: break;
 153   2              }
 154   1      }
 155          
 156          
 157          
 158          void AdjVolume(sCHAR sStep)
 159          {
 160   1              if( (EepVideo.cVolume+sStep)<=sOSDParamsMax.cVolume
 161   1                &&(EepVideo.cVolume+sStep)>=sOSDParamsMin.cVolume)
 162   1              {
 163   2                      EepVideo.cVolume += sStep;
 164   2                 I2CWriteByte(TW101, 0xE9, EepVideo.cVolume);
 165   2                      OSDShowVideoData();
 166   2                      if(EepVideo.cVolume==sOSDParamsMin.cVolume)
 167   2                              AUDIO_MUTE=1;  //MUTE audio
 168   2                      else
 169   2                              AUDIO_MUTE=0;  //open audio     
 170   2              }
 171   1              
 172   1              #ifdef NVRAM
 173   1              I2CWriteByte(EEPVIDEOBLOCK, idVIDEO_VOLUME_INDEX, EepVideo.cVolume);
 174   1              #endif
 175   1              return;
 176   1      
 177   1      }
 178          
C51 COMPILER V7.06   OSDCTRL                                                               12/28/2004 10:14:05 PAGE 4   

 179          
 180          #if VIDEO_AVAILABLE
 181          extern uCHAR idata m_cStandard;
 182          void AdjTimingB2(sCHAR sStep)
 183          {
 184   1      
 185   1                  if(I2CReadByte(TW101,0xb2)+sStep>=0&&I2CReadByte(TW101,0xb2)+sStep<=0xFF)
 186   1                      {
 187   2      
 188   2               
 189   2                              if(!m_cStandard)   
 190   2                              {
 191   3                                      EepVideo.cB2=I2CReadByte(TW101,0xb2)+sStep;
 192   3                                      EepVideo.cB8=I2CReadByte(TW101,0xb8);
 193   3                                      I2CWriteByte(TW101,0xb2,EepVideo.cB2);          
 194   3                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8, EepVideo.cB8);
 195   3                                      twdDelay(NVRDELAY);     
 196   3                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2, EepVideo.cB2);
 197   3                              twdDelay(NVRDELAY);
 198   3                                      EepVideo.cFlag=Panel_ID;
 199   3                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX, EepVideo.cFlag);
 200   3                              }
 201   2                  else
 202   2                              {
 203   3                                      EepVideo.cB2_PAL=I2CReadByte(TW101,0xb2)+sStep;
 204   3                                      EepVideo.cB8_PAL=I2CReadByte(TW101,0xb8);
 205   3                                      I2CWriteByte(TW101,0xb2,EepVideo.cB2_PAL);              
 206   3                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8_PAL, EepVideo.cB8_PAL);
 207   3                                      twdDelay(NVRDELAY);     
 208   3                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2_PAL, EepVideo.cB2_PAL);
 209   3                              twdDelay(NVRDELAY);
 210   3                                      EepVideo.cFlag_PAL=Panel_ID;
 211   3                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX1, EepVideo.cFlag_PAL);
 212   3                              }
 213   2                      twdDelay(NVRDELAY);     
 214   2                              OSDShowVideoData();
 215   2                      }
 216   1      }
 217          
 218          void AdjTimingB8(sCHAR sStep)
 219          {
 220   1                  if(I2CReadByte(TW101,0xb8)+sStep>=0&&I2CReadByte(TW101,0xb8)+sStep<=0xFF)
 221   1                      {
 222   2      
 223   2                              if(!m_cStandard)   
 224   2                              {
 225   3                                      EepVideo.cB2=I2CReadByte(TW101,0xb2);
 226   3                                      EepVideo.cB8=I2CReadByte(TW101,0xb8)+sStep;
 227   3                                      I2CWriteByte(TW101,0xb8,EepVideo.cB8);          
 228   3                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8,EepVideo.cB8);
 229   3                                      twdDelay(NVRDELAY);     
 230   3                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2,EepVideo.cB2);
 231   3                              twdDelay(NVRDELAY);
 232   3                                      EepVideo.cFlag=Panel_ID;
 233   3                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX, EepVideo.cFlag);
 234   3                              }
 235   2                  else
 236   2                              {
 237   3                                      EepVideo.cB2_PAL=I2CReadByte(TW101,0xb2);
 238   3                                      EepVideo.cB8_PAL=I2CReadByte(TW101,0xb8)+sStep;
 239   3                                      I2CWriteByte(TW101,0xb8,EepVideo.cB8_PAL);              
 240   3                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B8_PAL, EepVideo.cB8_PAL);
C51 COMPILER V7.06   OSDCTRL                                                               12/28/2004 10:14:05 PAGE 5   

 241   3                                      twdDelay(NVRDELAY);     
 242   3                                      I2CWriteByte(EEPVIDEOBLOCK, idTIMING_B2_PAL, EepVideo.cB2_PAL);
 243   3                              twdDelay(NVRDELAY);
 244   3                                      EepVideo.cFlag_PAL=Panel_ID;
 245   3                              I2CWriteByte(EEPVIDEOBLOCK, idTIMING_FLAG_INDEX1, EepVideo.cFlag_PAL);

⌨️ 快捷键说明

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