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

📄 text1.lst

📁 用89C51SND1C实现MP3播放器的源代码.用KEIL c51编写.
💻 LST
字号:
C51 COMPILER V6.23a  TEXT1                                                                 06/13/2003 10:08:25 PAGE 1   


C51 COMPILER V6.23a, COMPILATION OF MODULE TEXT1
OBJECT MODULE PLACED IN Text1.OBJ
COMPILER INVOKED BY: E:\Program Files\keil\C51\BIN\C51.EXE Text1.c LARGE BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          #include "REGSND1.H"
   2          #include "uart.h"
   3          #include "flash.h"
   4          
   5          int i=0;
   6          int j=0;
   7          int k=0;
   8          int l=0;
   9          int m=0;
  10          int c=0;
  11          
  12          //char databuff[512];
  13          //unsigned char SONG[]     ={'I','B','E','L','I','E','V','E','M','P','3'};
  14          unsigned char SONG[]     ={'M','O','O','N',' ',' ',' ',' ','M','P','3'};
  15          
  16          unsigned char SONG1[]     ={'M','O','O','N','1',' ',' ',' ','M','P','3'};
  17          
  18          #define VOLUME          1
  19          #define EFFECTION       2
  20          #define SELECTSONG      3
  21          #define PLAY            1
  22          #define STOP            0
  23          unsigned char CurrentFun=SELECTSONG;
  24          unsigned char PlayState=STOP;
  25          
  26          
  27          
  28          void MP3Init()
  29          {
  30   1              int m=0,n=0;
  31   1              int delay=10000;
  32   1              
  33   1              i=0;
  34   1              j=0;
  35   1              k=0;
  36   1              l=0;
  37   1      
  38   1              Flash_Reset();
  39   1      
  40   1              printuf("this is a simple test\n.");
*** WARNING C209 IN LINE 40 OF TEXT1.C: '_printuf': too few actual parameters
  41   1              printuf("con :%x\n",MP3CON);
  42   1              printuf("sta :%x\n",MP3STA);
  43   1              printuf("sta1 :%x\n",MP3STA1);
  44   1              MP3STA1=0xff;
  45   1              printuf("sta1:%x\n",MP3STA1);
  46   1              printuf("vol: %x\n",MP3VOL);
  47   1              printuf("bas: %x\n",MP3BAS);
  48   1              printuf("audcon0: %x\n",AUDCON0);
  49   1              printuf("audcon1: %x\n",AUDCON1);
  50   1              printuf("audsta: %x\n",AUDSTA);
  51   1      
  52   1              printuf("Ready to set the pll clock\n");
*** WARNING C209 IN LINE 52 OF TEXT1.C: '_printuf': too few actual parameters
  53   1              PLLNDIV=0x03;                                           //pll 84,000,000 1 13 7, 3 6 1, 1 6 3, 336000000 0,1b,1f
C51 COMPILER V6.23a  TEXT1                                                                 06/13/2003 10:08:25 PAGE 2   

  54   1              PLLRDIV=0x06;                                           //pll 72M mp3clk 36M audclk 7.2M(3,6,a)
  55   1                                                                                      //        92M        
  56   1              PLLCON=PLLCON|PLLEN;
  57   1              PLLCON=PLLCON|PLOCK;
  58   1              CKCON=0x01;
  59   1              printuf("Ready to open the mp3 interrupt\n");
*** WARNING C209 IN LINE 59 OF TEXT1.C: '_printuf': too few actual parameters
  60   1              MP3CON=MP3CON&~MSKREQ;
  61   1      //      MP3CON=MP3CON&~MSKANC;
  62   1      //      MP3CON=MP3CON&~MSKLAY;
  63   1      //      MP3CON=MP3CON&~MSKSYN;
  64   1      //      MP3CON=MP3CON&~MSKCRC;
  65   1              MP3VOR=0x1f;
  66   1              MP3VOL=0x1f;
  67   1              MP3CLK=0x02;
  68   1              MP3BAS=0x1f;
  69   1              MP3MED=0x1f;
  70   1              MP3TRE=0x1f;
  71   1              MP3CON=MP3CON|MPEN;
  72   1              printuf("Ready to open the mp3 decoder\n");
*** WARNING C209 IN LINE 72 OF TEXT1.C: '_printuf': too few actual parameters
  73   1      //      EMP3=1;
  74   1              
  75   1              printuf("ready to set the audcon0 register:\n");
*** WARNING C209 IN LINE 75 OF TEXT1.C: '_printuf': too few actual parameters
  76   1              AUDCON0=0x77;
  77   1              AUDCON1=0x41;
  78   1              AUDCLK=0x05;    // 1a
  79   1      
  80   1      }
  81          
  82          void PlayMP3(unsigned char *SongName)
  83          {
  84   1          char databuff[512];
  85   1              
  86   1              int m=0,n=0;
  87   1      
  88   1                      //First 1024 Byte MP3 Data
  89   1                      m=ReadSector(SongName,databuff);
  90   1                      if(MP3STA1&MPFREQ)
  91   1                      {
  92   2                              for(i=0;i<1024;i++)
  93   2                              {
  94   3                                      if(j==512)
  95   3                                      {
  96   4                                              m=ReadSector(SongName,databuff);
  97   4                                              j=0;
  98   4                                      }
  99   3                                      MP3DAT=databuff[j++];
 100   3                                      while(!(MP3STA1&MPBREQ));
 101   3      
 102   3                              }
 103   2                      }
 104   1      
 105   1              
 106   1                      //Other MP3 data
 107   1                      while(MP3STA1&MPFREQ)   {
 108   2                                      if(j==512){
 109   3                                              j=0;
 110   3                                              m=ReadSector(SongName,databuff);
 111   3                                              if(m<512) return;
 112   3                                              }
C51 COMPILER V6.23a  TEXT1                                                                 06/13/2003 10:08:25 PAGE 3   

 113   2                                      MP3DAT=databuff[j++];
 114   2                                      while(!(MP3STA1&MPBREQ)) ;
 115   2                                      }
 116   1              
 117   1      }
 118          
 119          void KeyBoardInit()
 120          {
 121   1              P1=0x0f;
 122   1              KBCON=0x00;//Low Level,Enable Interrupt
 123   1              IEN1=IEN1|EKB;  //Enable KeyBoard Interrupt
 124   1      
 125   1      }
 126          
 127          void Func()
 128          {
 129   1              if(CurrentFun<3) CurrentFun++;
 130   1              else if(CurrentFun==3) CurrentFun=1;
 131   1      }
 132          void Next()
 133          {
 134   1      
 135   1              switch(CurrentFun){
 136   2                      case VOLUME             :
 137   2                              {
 138   3                              if(MP3VOR>0x00)
 139   3                              {
 140   4                              MP3VOR-=0x01;
 141   4                              MP3VOL-=0x01;
 142   4                              }
 143   3      
 144   3                              break;
 145   3                              }
 146   2                      case EFFECTION  :
 147   2                              {
 148   3      
 149   3                              break;
 150   3                              }
 151   2                      case SELECTSONG :
 152   2                              {
 153   3      
 154   3                              break;
 155   3                              }
 156   2                      default:break;
 157   2              }
 158   1      }
 159          void Previous()
 160          {
 161   1              switch(CurrentFun){
 162   2                      case VOLUME             :
 163   2                              {
 164   3                              if(MP3VOR<0x1f)
 165   3                              {
 166   4                              MP3VOR+=0x01;
 167   4                              MP3VOL+=0x01;
 168   4                              }
 169   3      
 170   3                              break;
 171   3                              }
 172   2                      case EFFECTION  :
 173   2                              {
 174   3      
C51 COMPILER V6.23a  TEXT1                                                                 06/13/2003 10:08:25 PAGE 4   

 175   3                              break;
 176   3                              }
 177   2                      case SELECTSONG :
 178   2                              {
 179   3      
 180   3                              break;
 181   3                              }
 182   2                      default:break;
 183   2              }
 184   1      }
 185          void PlayPause()
 186          {
 187   1              PlayState=!PlayState;
 188   1      
 189   1      }
 190          void key_interrupt() interrupt 11
 191          {
 192   1                      unsigned char i=0;
 193   1                      EA=0;
 194   1                      IEN1&=(~EKB);   //Enable KeyBoard Interrupt
 195   1                      i=KBSTA;
 196   1                      switch(i){
 197   2                              case 1: Func();break;
 198   2                              case 2: Next();break;
 199   2                              case 4: Previous();break;
 200   2                              case 8: PlayPause();break;
 201   2                              default:break;
 202   2                      }
 203   1                      IEN1|=EKB;      //Enable KeyBoard Interrupt
 204   1                      EA=1;
 205   1                      return;
 206   1      }
 207          
 208          void main()
 209          {
 210   1              int i;
 211   1              for(i=0;i<100;i++) Flash_Reset();
 212   1      
 213   1              KeyBoardInit();
 214   1              MP3Init();
 215   1              printuf("Ready to open the all interrupt\n");
*** WARNING C209 IN LINE 215 OF TEXT1.C: '_printuf': too few actual parameters
 216   1              EA=1;
 217   1              P3_5=0;
 218   1              P3_3=1;
 219   1              while(1) {
 220   2              if(PlayState==PLAY) PlayMP3(SONG);
 221   2      
 222   2                      }
 223   1      }
 224          
 225          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    727    ----
   CONSTANT SIZE    =    278    ----
   XDATA SIZE       =     36     525
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
C51 COMPILER V6.23a  TEXT1                                                                 06/13/2003 10:08:25 PAGE 5   

END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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