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

📄 common.lst

📁 智原mp3 SDK 开发包 与巨力 有mp3 wma ogg decoder
💻 LST
字号:
C51 COMPILER V7.50   COMMON                                                                08/18/2008 13:50:29 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE COMMON
OBJECT MODULE PLACED IN ..\output\output_bin\output_fm\common.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\..\code\ap_fm\src\common.c LARGE OPTIMIZE(9,SIZE) BROWSE INCDIR(..\..\..
                    -\bsp\include;..\..\code\ap_fm\src\include;..\..\code\global;..\..\code\include) DEFINE(CONFIG_ASIC,dynamic_load) DEBUG O
                    -BJECTEXTEND PRINT(..\output\output_bin\output_fm\common.lst) OBJECT(..\output\output_bin\output_fm\common.obj)

line level    source

   1          /*******************
   2           *  common.c
   3           *******************/
   4          #include <string.h>
   5          #include "api.h"
   6          #include "lcd.h"
   7          #include "common.h"
   8          #include "display.h"
   9          #include "ap_common.h"
  10          #include "prefer.h"
  11          #include "global_user.h"
  12          #include "fm_tea5767.h"
  13          #include "res.h"
  14          #include "res_show.h" 
  15          #include "ui_message.h"
  16           
  17          UINT32 u16TimerCount=0; 
  18          extern INT8U record_start;
  19           
  20          MUSIC_INFORMATION curr_music;
  21          UINT16 curr_lyric_time;
  22          
  23          INT8U _buf[256];
  24          INT8U vol_flag=0;
  25          FILE_INFORMATION curr_finfo, curr_dir, play_dir;
  26          SCREENLEVEL screen_level;
  27          
  28          UINT16 select;
  29          
  30          UINT16 totdir, totfile, totitem;
  31          UINT8 *search_extstr;
  32          
  33          
  34          BOOLEAN bHotKeyHandle(UINT8 ekey)
  35          {
  36   1              //api_bRecordStop();
  37   1      
  38   1              switch(ekey)
  39   1              {
  40   2              
  41   2                      case KEY_LONG_MENU:    
  42   2                              api_bRecordStop();                              
  43   2                              api_vSetFMOnOFF(FM_TURN_OFF);
  44   2                              bRadioStop();  
  45   2                              if(record_start)
  46   2                              {    
  47   3                                      ui_show_message(RSAVING);
  48   3                              }                        
  49   2                              key_menu_long = 1;                                             
  50   2                              api_bSavePreferenceData(&tUserPreference,sizeof(USER_PREFERENCE_T));
  51   2                              //close_volume();
  52   2      #ifdef dynamic_load
  53   2                              api_vLoad(Code_USER1,1);
C51 COMPILER V7.50   COMMON                                                                08/18/2008 13:50:29 PAGE 2   

  54   2      #else
                                      Print("Load Function\n");
              #endif                                                  
  57   2                              break;
  58   2              
  59   2                      case KEY_LONG_PLAY:
  60   2                              api_bRecordStop();
  61   2                              api_vSetFMOnOFF(FM_TURN_OFF);
  62   2                              bRadioStop();   
  63   2                              if(record_start) 
  64   2                                      ui_show_message(RSAVING);
  65   2                              api_bSavePreferenceData(&tUserPreference,sizeof(USER_PREFERENCE_T));   
  66   2                              vShutDown();
  67   2                              break;                                  
  68   2                      
  69   2                      default:
  70   2                              return FALSE;
  71   2              
  72   2              }
  73   1      }
  74          
  75          void key_process(UINT8 key)
  76          {
  77   1              u16TimerCount=0;
  78   1              
  79   1              //vOpenBackLight();
  80   1              if(bLCD_PIN_BACKLIGHT)
  81   1                      return;
  82   1              //now handle hot key
  83   1              bHotKeyHandle(key);
  84   1              
  85   1              //deal other key now.
  86   1              if(curr_screen->main)
  87   1                      curr_screen->main(key);
  88   1      }
  89          
  90          #if 0
              
              void get_short_name(FILE_INFORMATION *pfinfo, UINT8 xdata *buf)
              {
                      UINT8 xdata *name = pfinfo->pu8FileName;
                      UINT8 xdata *ext = pfinfo->pu8FileExt;
                      BOOLEAN flags = false;
                      
                      while(1) {
                              if(*name == '\0' || *name == ' ')
                                      break;
                              *buf++ = *name++;
                      }
                      
                      *buf++ = '.';
                      
                      while(1) {
                              if(*ext == '\0' || *ext == ' ')
                                      break;
                              *buf++ = *ext++;
                              flags = true;
                      }
                      
                      if(!flags)
                              buf--;
                              
C51 COMPILER V7.50   COMMON                                                                08/18/2008 13:50:29 PAGE 3   

                      *buf = '\0';
              }
              
              void get_long_name(FILE_INFORMATION *pfinfo, UINT8 xdata *buf)
              {
                      UINT16 xdata *name = (UINT16 xdata *)pfinfo->pu8LongFileName;
                      
                      while(*name != 0) {
                              buf[0] = ((UNION16 *)name)->v8[1];
                              buf[1] = ((UNION16 *)name)->v8[0];
                              
                              if(*(UINT16 *)buf >= 'a' && *(UINT16 *)buf <= 'z')
                                      *(UINT16 *)buf = *(UINT16 *)buf - 'a' + 'A';
                                      
                              name++;
                              buf += 2;
                      }
              
                      *(UINT16 *)buf = 0;
              }
              
              
              BOOLEAN change_dir(FILE_INFORMATION *pDir)
              {
                      if(pDir)
                              memcpy(&curr_dir, pDir, sizeof(FILE_INFORMATION));
                      else
                              curr_dir.u32startclus = 0;      // ROOT dir
                      
                      return api_bChangeDir(pDir);
              }
              
              void scan_dir_file(UINT8 search_mode, UINT8 *extstr, BOOLEAN select_dir)
              {
                      select = totitem = totdir = totfile = 0;
                      
                      if(api_bSearchDirInDir(search_mode))
                              totdir = api_u16GetTotalFile();
                      
                      if(api_bSearchFileInDir(search_mode, extstr))
                              totfile = api_u16GetTotalFile();
                      
                      if(select_dir && totdir)
                              if(!api_bSearchDirInDir(SEARCH_MODE_CURRDIR))
                                      return;
                      
                      totitem = totdir + totfile;
                      search_extstr = extstr;
              }
              
              BOOLEAN playdir_valid()
              {
                      if(curr_dir.u32startclus != play_dir.u32startclus)
                              return false;
                      else
                              return true;
              }
              
              #endif
 175          
 176          BOOLEAN init_volume(void)
 177          {       
C51 COMPILER V7.50   COMMON                                                                08/18/2008 13:50:29 PAGE 4   

 178   1              //*(INT8U xdata*)(0xF96E) = 0x00;       
 179   1              api_bSetVolume(tUserPreference.u8Volume);       
 180   1              return 1;
 181   1      }
 182          
 183          BOOLEAN close_volume(void)
 184          {       
 185   1              api_bSetVolume(0-api_s8GetVolume()); 
 186   1              //*(INT8U xdata*)(0xF96E) = 0x03;       
 187   1              return 1;       
 188   1      }
 189          
 190          
 191          //--------------------------------------------------------------------------
 192          void vKeyTimeOut(void)
 193          {
 194   1              if (u16TimerCount == 0) 
 195   1              {
 196   2                  if (tUserPreference.u8BackLightTime!=0) 
 197   2                      vOpenBackLight();
 198   2              }
 199   1              u16TimerCount++;
 200   1              if((u16TimerCount>=tUserPreference.u8BackLightTime*4) && (tUserPreference.u8BackLightTime>0))
 201   1                      vCloseBackLight();
 202   1              
 203   1              if((u16TimerCount>=tUserPreference.u8ShutDownTime*240) && (tUserPreference.u8ShutDownTime>0))
 204   1                      vShutDown();
 205   1      
 206   1      }
 207          
 208          void vShutDown()
 209          {
 210   1              INT16U i;       
 211   1      
 212   1          api_bSetVolume(0-api_s8GetVolume());
 213   1              for(i=0;i<9;i++)
 214   1              {
 215   2                      delay(20);
 216   2                      bResShowPic(GJI01+i,0,0);                       
 217   2              }
 218   1      
 219   1              delay(20);
 220   1          vCloseBackLight();
 221   1          lcd_clear();
 222   1              delay(20);
 223   1      
 224   1              api_bSetPowerDownMode(POWER_DOWN_ADDA_OFF);
 225   1              delay(200);
 226   1              b_PIN_POWEROFF = 0;
 227   1          while(1){;}
 228   1      }
 229          
 230          void vOpenBackLight(void)
 231          {
 232   1               bLCD_PIN_BACKLIGHT = 0;
 233   1      }
 234          
 235          void vCloseBackLight(void)
 236          {
 237   1               bLCD_PIN_BACKLIGHT = 1;
 238   1      }
 239          
C51 COMPILER V7.50   COMMON                                                                08/18/2008 13:50:29 PAGE 5   



MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    431    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =    344       3
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   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 + -