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

📄 interrupt.lst

📁 凌阳SPDA1000 MP3开发资料
💻 LST
字号:
C51 COMPILER V8.05a   INTERRUPT                                                            07/11/2007 20:43:06 PAGE 1   


C51 COMPILER V8.05a, COMPILATION OF MODULE INTERRUPT
OBJECT MODULE PLACED IN .\obj\interrupt.obj
COMPILER INVOKED BY: D:\Program Files\Keil\C51\BIN\C51.EXE USER\interrupt.c LARGE OPTIMIZE(9,SIZE) BROWSE NOAREGS DEFINE
                    -(K_CARD_TYPE=0x01,K_CARD_TOTAL=0x01) DEBUG OBJECTEXTEND PRINT(.\lst\interrupt.lst) OBJECT(.\obj\interrupt.obj)

line level    source

   1          //===========================================================
   2          //   Project Name(项目名称):  SPCA755 rebuild
   3          //   File Name(模块名称): interrupt.c
   4          //   Built Date(创建日期):2004-09-14
   5          //   Abstract(模块描述): 中断功能函数模块
   6          //   Revision History(版本信息):
   7          //   Rev      Date           Author       Comment(修改说明)
   8          //   1.0      2004-09-14      XYQ         created
   9          //================================================================================================
  10          #include "..\userdefine.h"
  11          #include "interrupt.h"
  12          #include "userinit.h"
  13          #include "user.h"
  14          #include "main.h"
  15          //================================================================================================
  16          data U8 gc_KeyValue=0;
  17          data U8 gc_BatteryValue=0xff;
  18          data U8 gc_ADCOldKey=0;
  19          data U8 gc_LongKeyDelay=0;
  20          data U8 gc_LongKeyTimer=0;
  21          data U8 gc_QuarterTimer=0;
  22          data U8 gc_BlinkTimer;
  23          data U8 gc_SysSecondTimer;
  24          //================================================================================================
  25          data U8 gc_SecondTimer;
  26          data U8 gc_minuteTimer;
  27          data U8 gc_basetimerx4;//lyh add
  28          //================================================================================================
  29          #define K_USE_SPCA759_KEYB
  30          
  31          //================================================================================================
  32          void UserExtInterrupt() interrupt 0 using 1
  33          {
  34   1      
  35   1              INTR_Int0();    
  36   1              
  37   1      }
  38          
  39          void User_Timer() interrupt 1 using 2
  40          {//每7.8ms会进行中断一次(into this intterrupt per 7.8ms)
  41   1              //该函数用户不能删除,否则定时器会不准确
  42   1              
  43   1      
  44   1              TIMER0_Routine();//the function must call here(该函数在此必须调用,该函数为设置定时器初值)
  45   1      
  46   1              gc_QuarterTimer = (gc_QuarterTimer >= 3)?0:gc_QuarterTimer+1;
  47   1      
  48   1              switch(gc_QuarterTimer)
  49   1              {
  50   2                      case 0:
  51   2                              if (gc_SysSecondTimer)
  52   2                              {
  53   3                                      gc_SysSecondTimer--;
  54   3                              }else{
C51 COMPILER V8.05a   INTERRUPT                                                            07/11/2007 20:43:06 PAGE 2   

  55   3                                      gc_SysSecondTimer = SECONDTIMER_VALUE;
  56   3                              }
  57   2                              break;
  58   2                      case 1:                 
  59   2              
  60   2                              gc_BatteryValue = USER_READSAR(2);  //read SAR output
  61   2                              
  62   2                              if (USB_PlugDetect())
  63   2                      {
  64   3                              gc_BatteryValue = 0xff;
  65   3                      }
  66   2      
  67   2                              if (gc_BlinkTimer)gc_BlinkTimer--;
  68   2      
  69   2                              if (gc_LongKeyTimer) gc_LongKeyTimer++;                 
  70   2                              break; 
  71   2                      case 2:
  72   2                              if (!gc_KeyValue)
  73   2                              {//if oldevent haven't been deal with, not to get new keyValue
  74   3                               
  75   3                                      if (1)
  76   3                                      {
  77   4                                              data U8 tc_ADCCurrentKey;
  78   4              
  79   4                                              tc_ADCCurrentKey = USER_READSAR(0);  //read SAR output
  80   4                                              
  81   4                              #if 0
                                              #ifdef K_USE_SPCA759_KEYB
                                                      if (tc_ADCCurrentKey>240) tc_ADCCurrentKey=0;
                                                      else if(tc_ADCCurrentKey>171) tc_ADCCurrentKey=1;
                                                      else if(tc_ADCCurrentKey>149) tc_ADCCurrentKey=2;
                                                      else if(tc_ADCCurrentKey>124) tc_ADCCurrentKey=3;
                                                      else if(tc_ADCCurrentKey>96) tc_ADCCurrentKey=4;
                                                      else if(tc_ADCCurrentKey>66) tc_ADCCurrentKey=5;
                                                      else if(tc_ADCCurrentKey>36) tc_ADCCurrentKey=6;
                                                      else if(tc_ADCCurrentKey>11) tc_ADCCurrentKey=7;
                                                      else tc_ADCCurrentKey = 8;
                                              /*      if (tc_ADCCurrentKey>240) tc_ADCCurrentKey=0;
                                                      else if(tc_ADCCurrentKey>217) tc_ADCCurrentKey=1;
                                                      else if(tc_ADCCurrentKey>182) tc_ADCCurrentKey=2;
                                                      else if(tc_ADCCurrentKey>139) tc_ADCCurrentKey=3;
                                                      else if(tc_ADCCurrentKey>104) tc_ADCCurrentKey=4;
                                                      else if(tc_ADCCurrentKey>75) tc_ADCCurrentKey=5;
                                                      else if(tc_ADCCurrentKey>41) tc_ADCCurrentKey=6;
                                                      else if(tc_ADCCurrentKey>14) tc_ADCCurrentKey=7;
                                                      else tc_ADCCurrentKey = 8;*/
                                              #else
                                                      if (tc_ADCCurrentKey>240) tc_ADCCurrentKey=0;
                                                      else if(tc_ADCCurrentKey>220) tc_ADCCurrentKey=1;
                                                      else if(tc_ADCCurrentKey>202) tc_ADCCurrentKey=2;
                                                      else if(tc_ADCCurrentKey>181) tc_ADCCurrentKey=3;
                                                      else if(tc_ADCCurrentKey>147) tc_ADCCurrentKey=4;
                                                      else if(tc_ADCCurrentKey>105) tc_ADCCurrentKey=5;
                                                      else if(tc_ADCCurrentKey>61) tc_ADCCurrentKey=6;
                                                      else if(tc_ADCCurrentKey>20) tc_ADCCurrentKey=7;
                                                      else tc_ADCCurrentKey = 8;
                                              #endif
                                      #else//MoonBox key value V2.0
 113   4      
 114   4                                              if (tc_ADCCurrentKey>240) tc_ADCCurrentKey=0;
 115   4                                              else if(tc_ADCCurrentKey>217) tc_ADCCurrentKey=7;
 116   4                                              else if(tc_ADCCurrentKey>182) tc_ADCCurrentKey=8;
C51 COMPILER V8.05a   INTERRUPT                                                            07/11/2007 20:43:06 PAGE 3   

 117   4                                              else if(tc_ADCCurrentKey>139) tc_ADCCurrentKey=5; 
 118   4                                              else if(tc_ADCCurrentKey>104) tc_ADCCurrentKey=4; //VOL+
 119   4                                              else if(tc_ADCCurrentKey>75) tc_ADCCurrentKey=6;  //MODE
 120   4                                              else if(tc_ADCCurrentKey>41) tc_ADCCurrentKey=2;  //LAST
 121   4                                              else if(tc_ADCCurrentKey>14) tc_ADCCurrentKey=1;  //NEXT
 122   4                                              else tc_ADCCurrentKey = 3;                        //PLAY
 123   4      /*
 124   4                                              if (tc_ADCCurrentKey>240) tc_ADCCurrentKey=0;                                   
 125   4                                              else if(tc_ADCCurrentKey>210) tc_ADCCurrentKey=1;
 126   4                                              else if(tc_ADCCurrentKey>180) tc_ADCCurrentKey=2;
 127   4                                              else if(tc_ADCCurrentKey>140) tc_ADCCurrentKey=3;
 128   4                                              else if(tc_ADCCurrentKey>96) tc_ADCCurrentKey=4;
 129   4                                              else if(tc_ADCCurrentKey>66) tc_ADCCurrentKey=5;
 130   4                                              else if(tc_ADCCurrentKey>36) tc_ADCCurrentKey=6;
 131   4                                              else if(tc_ADCCurrentKey>11) tc_ADCCurrentKey=7;
 132   4                                              else tc_ADCCurrentKey = 8;*/
 133   4                              #endif
 134   4                                      
 135   4                                      
 136   4                                              if ((gc_ADCOldKey & 0x0f) == tc_ADCCurrentKey)
 137   4                                              {//按键未释放
 138   5                                                      if (tc_ADCCurrentKey != KEY_NONEKEY)
 139   5                                                      {
 140   6                                                              if (gc_LongKeyTimer > gc_LongKeyDelay)
 141   6                                                              {
 142   7                                                                      gc_ADCOldKey = gc_ADCOldKey | 0x10;             //长按键
 143   7                                                                      gc_KeyValue = gc_ADCOldKey & 0x7f;
 144   7                                                                      gc_LongKeyTimer = REPEATKEY_DELAYVALUE; //设置重复按键延时起始值
 145   7                                                                      gc_LongKeyDelay = (gc_LongKeyDelay < MIN_REPEATKEYDELAY)?MIN_REPEATKEYDELAY:gc_LongKeyDelay-3;  //

⌨️ 快捷键说明

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