main.lst

来自「显示屏驱动源代码」· LST 代码 · 共 721 行 · 第 1/3 页

LST
721
字号
C51 COMPILER V7.06   MAIN                                                                  02/21/2008 14:00:27 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN .\Output\Main.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Main.c COMPACT OPTIMIZE(9,SIZE) BROWSE INCDIR(.\Include\) DEBUG OBJECTEXTEN
                    -D PRINT(.\Source\Main.lst) OBJECT(.\Output\Main.obj)

stmt level    source

   1          /*****************************************************************************/
   2          /*                                                                           */
   3          /*                    TW880x Demo Board   Techwell,Inc                       */
   4          /*                                                                           */
   5          /* CPU        : Winbond 78E62BP-40                                           */
   6          /* LANGUAGE   : Tasking C / Keil C                                           */
   7          /* PROGRAMMER : Jooyeon Lee / Harry Han                                      */
   8          /*                                                                           */
   9          /*****************************************************************************/
  10          /* See 'Release.txt' for firmware revision history                           */
  11          
  12          #include "Config.h"
  13          
  14          #include "reg.h"
  15          #include "typedefs.h"
  16          #include "main.h"
  17          #include "tw88.h"
  18          #include "i2c.h"
  19          #include "adc.h"
  20          #include "osdbasic.h"
  21          #include "dispinfo.h"
  22          #include "etc_eep.h"
  23          #include "measure.h"
  24          #include "Printf.h"
  25          #include "audio.h"
  26          #include "osdmenu.h"
  27          #include "pc_eep.h"
  28          #include "KeyRemo.h"
  29          #include "Monitor.h"
  30          #include "CPU.h"
  31          
  32          #include "rgbmix.h"                     
  33          #include "panel.h"
  34          #ifdef SUPPORT_TV
              #include "Tuner.h"
              #endif
  37          #include "measure.h" // Hans
  38          
  39          
  40          void Loader(BYTE);
  41          
  42          #ifdef SUPPORT_GAMMA
              extern CODE BYTE GammaRed[];
              extern CODE BYTE GammaBlue[];
              extern CODE BYTE GammaGreen[];
              #endif
  47          
  48          extern  DATA  WORD  tic_pc;
  49          
  50          extern  IDATA BYTE    cSourceState; // Hans
  51          
  52                          IDATA BYTE  InputSelection;
  53          //              IDATA BYTE      InputSelectionInx = 0;
  54          ///         bit   PcDetectFlag = 1;
C51 COMPILER V7.06   MAIN                                                                  02/21/2008 14:00:27 PAGE 2   

  55          //              bit       PowerMode = ON;
  56                          IDATA WORD  IVF;
  57                          IDATA DWORD     IHF;
  58          IDATA BYTE  VInputStd;
  59          
  60                          bit   Range4Coarse=0, AutoDetect=1;
  61                          BYTE  VInputStdDetectMode;
  62                          BYTE  CheckBuf;
  63          
  64          CODE struct struct_IdName       struct_InputSelection[]={
  65                  { UNKNOWN                       ,       "" },                           //don't remove or change this.
  66                  { COMPOSITE                     ,       "CVBS" },                       //don't remove or change this.
  67          
  68                                                                                                          // you can change the order of the followings
  69                  #ifdef SUPPORT_SVIDEO
  70                  { SVIDEO                        ,       "S-Video" },
  71                  #endif
  72          
  73                  #ifdef SUPPORT_COMPONENT
  74                  { COMPONENT     ,                       "Component" },
  75                  #endif
  76          
  77                  #ifdef SUPPORT_DTV
                      { DTV   ,                               "DTV-SOG" },
                      #endif
  80          
  81                  #ifdef SUPPORT_TV
                      { TV                            ,       "TV       " },
                      #endif
  84          
  85                  #ifdef SUPPORT_PC
  86                  { PC                            ,       "PC-HV"},
  87                  #endif
  88          
  89                  #ifdef SUPPORT_DIGITALVGA
                      { DIGITALVGA            ,       "DVI" },
                      #endif
  92          
  93                  {0                                      ,       ""},                            //don't remove or change this.
  94          };
  95          
  96          
  97          CODE struct struct_IdName struct_VInputStd[]={
  98                  { UNKNOWN                       ,       "" },                           //don't remove or change this.
  99                  { NTSC,                                 "NTSC"},                        //don't remove or change this.
 100          
 101                  #ifdef SUPPORT_PAL
 102                  { PAL,                                  "PAL"},
 103                  #endif
 104          
 105                  #ifdef SUPPORT_SECAM
 106                  { SECAM,                                "SECAM"},
 107                  #endif
 108          
 109                  #ifdef SUPPORT_PALM
 110                  { PALM,                                 "PALM"},
 111                  #endif
 112          
 113                  #ifdef SUPPORT_PALN
 114                  { PALN,                                 "PALN"},
 115                  #endif
 116          
C51 COMPILER V7.06   MAIN                                                                  02/21/2008 14:00:27 PAGE 3   

 117                  #ifdef SUPPORT_PAL60
 118                  { PAL60,                                "PAL60"},
 119                  #endif
 120          
 121                  #ifdef SUPPORT_NTSC4
 122                  { NTSC4,                                "NTSC4.43"},
 123                  #endif
 124          
 125                  {0                                      ,       ""},                            //don't remove or change this.
 126          };
 127          
 128          
 129          
 130          //===================== OSD ===================================================
 131                      WORD  OSDLastKeyInTime;             // in ms
 132          //===================== Button Key ============================================
 133          
 134          //================= Etc. ======================================================
 135          #ifdef WIDE_SCREEN
 136                          BYTE  WideScreenMode;
 137          #endif
 138                          BYTE    DebugLevel;
 139          
 140                          bit   Flag4AutoPanelRegs = 0;
 141                          bit   I2CAutoIncFlagOn = 0;
 142          #ifdef SUPPORT_COMPONENT
 143                      IDATA BYTE  ComponentMode;
 144          #endif
 145          //extern  bit               OnChangingValue;
 146          extern  BYTE    TVInputSel;
 147          #ifdef SUPPORT_DEBUG
              extern  bit Debug_On;
              #endif
 150          
 151          #ifdef NO_INITIALIZE
 152                          bit             NoInitAccess=0;
 153          #endif
 154          #ifdef INTERNAL_MCU
              extern WORD     TW88IRQ;
              #endif
 157          
 158                      bit   DisplayInputHold = 0;
 159          
 160          
 161          //////////////////////////////////////////////////////////////////////////////
 162          
 163          //=============================================================================
 164          //              Prompt                                                                         
 165          //=============================================================================
 166          /*
 167          void CheckDipSwitch(void)
 168          {
 169                  static bit BW_STATUS=0, EDGE_STATUS=0;
 170                                  //----- Check DIP Switch ---------------
 171          
 172                                  if( EDGE_STATUS != DIP_EDGE_ENHANCE ) {
 173                                          if( DIP_EDGE_ENHANCE==0 ) {
 174                                                  EDGE_STATUS = 0;
 175                                                  WriteTW88(0xdd, ReadTW88(0xdd) | 0x80);
 176                                                  Printf("\r\nEnable Color Enhancement");
 177                                          }
 178                                          else {
C51 COMPILER V7.06   MAIN                                                                  02/21/2008 14:00:27 PAGE 4   

 179                                                  EDGE_STATUS = 1;
 180                                                  WriteTW88(0xdd, ReadTW88(0xdd) & 0x7f);
 181                                                  Printf("\r\nDisable Color Enhancement");
 182                                          }
 183                                  }
 184                                  
 185                                  if( BW_STATUS != DIP_BW_STRETCH ) {
 186                                          if( DIP_BW_STRETCH==0 ) {
 187                                                  BW_STATUS = 0;
 188                                                  #ifdef WQVGA
 189                                                  WriteTW88(0x86, 0x0c);
 190                                                  WriteTW88(0x87, 0xff);
 191                                                  #else
 192                                                  WriteTW88(0x86, 0x20);
 193                                                  WriteTW88(0x87, 0xe0);
 194                                                  #endif
 195                                                  Printf("\r\nEnable Black/White Stretch");
 196                                          }
 197                                          else {
 198                                                  BW_STATUS = 1;
 199                                                  WriteTW88(0x86, 0x00);
 200                                                  WriteTW88(0x87, 0xff);
 201                                                  Printf("\r\nDisable Black/White Stretch");
 202                                          }
 203                                  }
 204          
 205          }*/
 206          
 207          #ifdef SUPPORT_GAMMA
              
              #include "Gamma.c"
              
              void DownLoadGamma(void)
              {
                              // Red
                              WriteI2C(TW88I2CAddress, 0xf0, 0xe8|1 ); 
                              WriteI2C(TW88I2CAddress, 0xf1, 0x00); //  Start Address
                              WriteI2C(TW88I2CAddress, 0xf2, GammaRed[0]); //  
                              WriteI2Cn(TW88I2CAddress, 0xf2, &GammaRed[1], 255);
                              // Blue
                              WriteI2C(TW88I2CAddress, 0xf0, 0xe8|2 ); 
                              WriteI2C(TW88I2CAddress, 0xf1, 0x00); //  Start Address
                              WriteI2C(TW88I2CAddress, 0xf2, GammaGreen[0]); //  
                              WriteI2Cn(TW88I2CAddress, 0xf2, &GammaGreen[1], 255);
                              // Red
                              WriteI2C(TW88I2CAddress, 0xf0, 0xe8|3 ); 
                              WriteI2C(TW88I2CAddress, 0xf1, 0x00); //  Start Address

⌨️ 快捷键说明

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