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

📄 leddriver.lst

📁 音响效果程序
💻 LST
字号:
C51 COMPILER V6.23a  LEDDRIVER                                                             02/21/2005 21:27:34 PAGE 1   


C51 COMPILER V6.23a, COMPILATION OF MODULE LEDDRIVER
OBJECT MODULE PLACED IN LedDriver.OBJ
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE LedDriver.c

stmt level    source

   1          #include <reg52.h>
   2          #include "LedDriver.h"
   3          
   4          code unsigned char LedHexCode[]=
   5                  {
   6                          //0     1     2     3     4     5     6     7
   7                          0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 
   8                          //8     9     a     b     c     d     e     f
   9                          0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71,
  10                          //-     H     L     P     o
  11                          0x40, 0x76, 0x38, 0x73, 0x5c,
  12          
  13                  };
  14          
  15          unsigned char DisBuf[4];
  16          unsigned int LedInterval=1;
  17          /*
  18          void LedPrint( unsigned char bitN, unsigned char Dat )
  19          {       DisBuf[ bitN ] = Dat; }
  20          */
  21           
  22          void LedOutput( void )
  23          {
  24   1              static unsigned char index=0;
  25   1              P2 |= 0x0f;
  26   1              P0 = LedHexCode[ DisBuf[index] & 0x1f ] | (DisBuf[index]&0x80);
  27   1              P2 &= (1<<index)^0xff;
  28   1              if( ++index == 4 ) index=0;
  29   1      } 
  30          
  31          void LedSetInterval( unsigned int time ){ LedInterval = time; }
  32          
  33          /*下面是延时函数的描述*/
  34          void delayMs( unsigned int tc ) //tc是形参
  35          {
  36   1              while( tc != 0 )                        //如果tc为0则终止延时
  37   1              {
  38   2                      unsigned int i;                 //局部正整数变量 i
  39   2                      for(i=0; i<400; i++);   //执行400次将耗时1毫秒
  40   2                      tc--;                                   //tc计数减一
  41   2              }
  42   1      }
  43          
  44          void LedWork( void )
  45          {
  46   1              static unsigned int delayTime=1;
  47   1              delayMs( 1 );
  48   1              if( --delayTime==0 )
  49   1              {
  50   2                      delayTime = LedInterval;
  51   2                      LedOutput();
  52   2              }
  53   1      } 


C51 COMPILER V6.23a  LEDDRIVER                                                             02/21/2005 21:27:34 PAGE 2   

MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    120    ----
   CONSTANT SIZE    =     21    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      9       2
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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