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

📄 console.lst

📁 dvr
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.50   CONSOLE                                                               12/14/2005 10:05:10 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE CONSOLE
OBJECT MODULE PLACED IN .\OBJ\console.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE console.c LARGE OPTIMIZE(9,SIZE) BROWSE PRINT(.\LST\console.lst) OBJECT(.\O
                    -BJ\console.obj)

line level    source

   1          /*
   2          ********************************************************************************
   3          *
   4          * (c) Copyright 2002, Vineyard Technologies, Inc.
   5          *
   6          * Filename : console.c
   7          * Programmer(s): Steve KyeongHyeon Lee
   8          * Created : 2003/05/07
   9          * Modified :
  10          *
  11          * Description : Console command processing for debugging
  12          ********************************************************************************
  13          */
  14          
  15          #include "types.h"
  16          #ifdef CONIF
              
              //###############################################################################
              //Standard Includes
              //###############################################################################
              #include "8052reg.h"
              #include <stdio.h>
              #include <absacc.h>
              
              //###############################################################################
              // Includes
              //###############################################################################
              #include "sio.h"
              #include "gio.h"
              #include "console.h"
              #include "lib.h"
              #include "ghdd.h"
              #include "i2c.h"
              #ifdef TEST_G1PP
              #include "bfpga.h"
              #endif
              #ifdef DEBUG_LANRPT
              #include "socket.h"
              #endif
              #include "rmcon.h"
              
              
              //###############################################################################
              // External variables and functions
              //###############################################################################
              extern xdata u8 gv_encoder_mode;
              extern xdata u16 gv_delay;
              extern xdata u32 gv_int0_cnt;
              #ifdef TEST_G1PP
              extern xdata u32 gv_check_ready_counter;
              #endif
              
              //###############################################################################
              // Global data structure
C51 COMPILER V7.50   CONSOLE                                                               12/14/2005 10:05:10 PAGE 2   

              //###############################################################################
              xdata u8 cmd_line[80];
              xdata u8 cmd_len = 0;
              xdata u8 cmd_special_key=0;
              //###############################################################################
              // Function prototypes
              //###############################################################################
              
              
              //###############################################################################
              // Static Function prototypes
              //###############################################################################
              static void console_parse( u8* line );
              
              //=============================================================================
              // Process console commands
              //=============================================================================
              void console_process(void)
              {
                      xdata u8 rx_size;
                      xdata u8 ch;
                      static u8 flag = 0;
                      
                      if(flag==0){
                              printf("\n\r>");
                              flag = 1;
                      }
                      
                      rx_size = sio_rbuflen();
                      if(rx_size!=0){
                              ch = sio_getchar();
              
                              if((ch&0xF0)==0x40) // remote control key value
                              {
                                      rmcon_sendkey( ch );
                              }
                              else
                              {
                                      // process special key
                                      if(ch=='='||ch=='-')
                                      {
                                              cmd_special_key = ch;
                                              cmd_len = 0;
                                              console_parse(0);
                                              return;
                                      }
                                      cmd_special_key = 0;
                                      printf("%c", (u8)ch, (u16)ch); // echo
                                      cmd_line[cmd_len] = ch;
                                      if(ch == '\b'){ // back space key
                                              cmd_len--;
                                      }
                                      else{
                                              cmd_len = (cmd_len<79)? cmd_len+1: 0; // If over, the command line buffer will be clear
                                      }
                                      if(ch==0x0D){ // CR --> one line
                                              cmd_line[--cmd_len] = '\0';
                                              printf("\n\r");
                                              console_parse( cmd_line );
                                              cmd_len = 0; // clear local line buffer
                                              printf("\n\r> ");
                                  }
C51 COMPILER V7.50   CONSOLE                                                               12/14/2005 10:05:10 PAGE 3   

                              }
                      }
              
              }
              
              //=============================================================================
              // Parse console commands and execute
              //=============================================================================
              static void console_parse( u8* line )
              {
                      xdata u16       base_addr=0x8000;
                      xdata u8        data8;
                      xdata u16       addr16;
              #ifdef DEBUG_I2C_WRITE
                      xdata u8        sub8, v8;
              #endif
              #if defined(DEBUG_HDD_DUMP)
                      xdata u32       val32;
                      xdata u16       val16;
                      xdata u32       v32a;
                      xdata u32       v32b;
              #endif
              
              
              
                      if(!mem_cmp(line, "help", 4)){
                              
                              printf("\n\r rd{g|n} AA    -- read  g1 or fpga reg (AA is offset)");
                              printf("\n\r wt{g|n} AA XX -- write g1 or fpga reg");           
              #ifdef TEST_G1PP
                              printf("\n\r list  -- list   current values for setting G1pp regs");
                              printf("\n\r setup X4 X6 X7 X8 X9 XA XB -- Xn is hex and n is offset of g1pp reg");
                              printf("\n\r startenc {v|a|b} -- v:video, a:audio, b:both");
                              printf("\n\r stopenc {v|a|b} -- v:video, a:audio, b:both");
                              printf("\n\r status -- show g1pp status register");
                              printf("\n\r cvb    -- clear encoder video buffer");
                              printf("\n\r +      -- increase network speed");
                              printf("\n\r -      -- decrease network speed");
              #endif          
              #ifdef DEBUG_LANRPT
                              printf("\n\r sock {c|v} -- (c)ontrol, (v)ideo sock status");
              #endif
                              printf("\n\r reboot");
                              
              #ifdef DEBUG_HDD_BW
                              printf("\n\r hdd_bw SS CCCC A -- S:sector cnt, C is the number of LBA, A is option");
                              printf("\n\r                0: Read HDD");
                              printf("\n\r                1: Read MEM only");
              #endif
              
              #if defined(DEBUG_HDD_REPORT) || defined(DEBUG_HDD_DUMP)
                              printf("\n\r hdd_report");
                              printf("\n\r hdd_dump  {0|1} LLLLLLLL SSSS CCCC -- L is LBA, S is size(Bytes)");
                              printf("\n\r hdd_clear {0|1}");
              //              printf("\n\r hdd_rw LLLLLLLL TTTTTTTT CCCCCCCC -- L:LBA, T:Sector#, C:cnt");
              //              printf("\n\r hdd_cache {0|1} -- 0:disable, 1:enable");
              #endif
              
              #ifdef DEBUG_I2C_WRITE
                              printf("\n\r i2cw DD SS VV -- DD:device SS:subaddr VV:value");
              #endif
                              printf("\n\r");
C51 COMPILER V7.50   CONSOLE                                                               12/14/2005 10:05:10 PAGE 4   

                      }
              
              #ifdef DEBUG_I2C_WRITE
                      if(!mem_cmp(line, "i2cw", 4)){
                              data8 = hatoc( &line[5] );
                              sub8 = hatoc( &line[8] );
                              v8 = hatoc( &line[11] );
                              i2c_pkt_write(data8, sub8, v8);

⌨️ 快捷键说明

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