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

📄 keyremo.lst

📁 此程序为twell8806驱动程序
💻 LST
📖 第 1 页 / 共 3 页
字号:
 456   3      
 457   3                              //------------------------------------------------------------------------              
 458   3                              #ifdef SUPPORT_SELECTKEY
                                      case UPKEY:
                                              if(  GetDisplayedOSD() & MENU  ) 
                                                      if( OnChangingValue )                           OSDValueUpDn(UP );
                                                      else                                                            OSDCursorMove( UP );
              
                                              #ifdef SUPPORT_TV
                                              else if( GetInputSelection() == TV )    UpTVChannel();
                                              #endif
                                              else    
                                                      return 1;
                                              break;
                                      case DOWNKEY:
                                              if(  GetDisplayedOSD() & MENU  ) 
                                                      if( OnChangingValue )                           OSDValueUpDn(DN );
                                                      else                                                            OSDCursorMove( DN );
              
                                              #ifdef SUPPORT_TV
                                              else if( GetInputSelection() == TV )    DownTVChannel();
                                              #endif
                                              else    
                                                      return 1;
                                              break;
              
                                      case SELECTKEY:
                                              if(  GetDisplayedOSD() & MENU  ) {
                                                      if( OnChangingValue )                   SaveValue1();
                                                      else                                                            OSDSelect();                    
                                              }
                                              break;
                                      #else
 489   3                              //------------------------------------------------------------------------              
C51 COMPILER V7.50   KEYREMO                                                               08/20/2007 10:23:30 PAGE 9   

 490   3                              case UPKEY:             ret = ActionRemo( REMO_CHNUP, RepeatKey );      break;
 491   3                              case DOWNKEY:   ret = ActionRemo( REMO_CHNDN, RepeatKey );      break;
 492   3                              case LEFTKEY:   ret = ActionRemo( REMO_VOLDN, RepeatKey );      break;
 493   3                              case RIGHTKEY:  ret = ActionRemo( REMO_VOLUP, RepeatKey );      break;
 494   3                              #endif
 495   3                              //------------------------------------------------------------------------              
 496   3      
 497   3                              case INPUTSOURCEKEY:
 498   3                                      ret = ActionRemo( REMO_INPUT, RepeatKey );                                      break;
 499   3                      }
 500   2      //              WaitKeyClear(ikey);
 501   2              }
 502   1              return ret;
 503   1      }
 504          
 505          //=============================================================================
 506          //              Get Key 
 507          //=============================================================================
 508          BYTE GetKey(BYTE repeat)
 509          {
 510   1              bit ready;
 511   1      
 512   1              ready = KeyReady;
 513   1              KeyReady = 0;
 514   1      
 515   1              if( !ready ) return 0;
 516   1              if( repeat ) return Key;
 517   1              if( !RepeatKey ) return Key;
 518   1      
 519   1              return 0;
 520   1      }
 521          
 522          
 523          //=============================================================================
 524          //              CheckRemo
 525          //=============================================================================
 526          #ifdef REMO_RC5
 527          
 528          BYTE IsRemoDataReady(BYTE *DataCode, BYTE *AutoKey)
 529          {
 530   1              bit togglebit;
 531   1              static bit      LastToggle=0;
 532   1              static BYTE AutoWait=0;
 533   1      
 534   1              BYTE _RemoSystemCode, _RemoDataCode, _RemoDataReady;
 535   1      
 536   1              if( !RemoDataReady ) return 0;
 537   1      
 538   1              _RemoDataReady = RemoDataReady;
 539   1              _RemoDataCode = RemoDataCode;
 540   1              _RemoSystemCode = RemoSystemCode;
 541   1      
 542   1              *AutoKey = 0;
 543   1      
 544   1              EnableRemoconInt();
 545   1      
 546   1              #ifdef DEBUG_KEYREMO
                      Printf("\r\n(CheckRemo)R-S:%02x, R-D:%02x", (WORD)_RemoSystemCode, (WORD)_RemoDataCode);
                      #endif
 549   1      
 550   1              if( (_RemoSystemCode & 0xc0) != 0xc0 ) return 0;
 551   1              if( (_RemoSystemCode & 0x1f) != REMO_CUSTOM ) return 0;
C51 COMPILER V7.50   KEYREMO                                                               08/20/2007 10:23:30 PAGE 10  

 552   1      
 553   1              togglebit = LastToggle;
 554   1              if( _RemoSystemCode & 0x20 ) LastToggle = 1;
 555   1              else LastToggle = 0;
 556   1      
 557   1              #ifdef DEBUG_KEYREMO
                      dPrintf("**** %d  %d ", (WORD)LastToggle, (WORD)_RemoDataReady);
                      #endif
 560   1      
 561   1              if( LastToggle != togglebit ) {                 // new key
 562   2                      AutoWait =  0;
 563   2              }
 564   1              else if( AutoWait>=4 ) {                                // auto key
 565   2                      AutoWait++;
 566   2                      if( AutoWait>=6 ) {
 567   3                              AutoWait = 4;
 568   3                              *AutoKey = 1;
 569   3                      }
 570   2                      else return 0;
 571   2              }
 572   1              else {                                                                  // wait auto key
 573   2                      AutoWait++;
 574   2                      return 0;
 575   2              }
 576   1              
 577   1              #ifdef DEBUG_KEYREMO
                      if( *AutoKey ) {
                              dPuts(" ---> AutoKey ");
                      }
                      else {
                              dPuts(" ---> New Key ");
                      }
                      #endif
 585   1      
 586   1              *DataCode = _RemoDataCode;
 587   1              return 1;
 588   1      }
 589          
 590          #elif defined REMO_NEC
              extern          BYTE     RemoData[4];
              
              BYTE IsRemoDataReady(BYTE *DataCode, BYTE *AutoKey)
              {
                      static BYTE AutoWait=0;
                      static IDATA BYTE LastDataCode=0xff;
                      static IDATA BYTE repeatcnt=0;
                      BYTE ret =0 ;
              
                      *AutoKey = 0;
                      switch ( RemoDataReady ) {
              
                      case 0: return 0;
              
                      case 1:
                              #ifdef DEBUG_KEYREMO
                              Printf("\r\nNEC RemoData = %02x %02x %02x %02x", (WORD)RemoData[0], (WORD)RemoData[1], (WORD)RemoData[2]
             -, (WORD)RemoData[3] );
                              #endif
                              if( (RemoData[0]==REMO_CUSTOM1) && (RemoData[1]==REMO_CUSTOM2 ) && (RemoData[2]+RemoData[3])==0xff ) {
                                      RemoDataCode = RemoData[2];
                                      LastDataCode = RemoDataCode;
                                      AutoWait = 0;
C51 COMPILER V7.50   KEYREMO                                                               08/20/2007 10:23:30 PAGE 11  

                                      *AutoKey = 0;
                                      repeatcnt = 0;
                              }
                              else {
                                      RemoDataCode = 0xff;
                                      LastDataCode = 0xff;
              
                                      EnableRemoconInt();             //
                                      return 0;
                              }
                              break;
              
                      case 2:
                              AutoWait++;
                              if( AutoWait>=6 ) {
                                      RemoDataCode = LastDataCode;
                                      repeatcnt++;
                                      if( repeatcnt>=5 ) {
                                              AutoWait = 5;
                                      }
                                      else
                                              AutoWait = 4;
              
                                      *AutoKey = 1;
                              }
                              else {
                                      EnableRemoconInt();             //
                                      return 0;
                              }
                              break;
              
                      }
              
                      EnableRemoconInt();             ////LJY052902
                      if( RemoDataCode==0xff )        return 0;
              
                      #ifdef DEBUG_KEYREMO
                      dPrintf("(R-D:%02x)  ", (WORD)RemoDataCode);
                      #endif
              
                      *DataCode = RemoDataCode;
                      return 1;
              }
              
              #endif  // REMO_NEC
 658          
 659          BYTE CheckRemo(void)
 660          {
 661   1              BYTE AutoKey, ret=1, _RemoDataCode;
 662   1      
 663   1              if( IsRemoDataReady(&_RemoDataCode, &AutoKey) ) {
 664   2                      ret = ActionRemo( _RemoDataCode, (BYTE)AutoKey) ;
 665   2              }
 666   1      
 667   1              return ret;
 668   1      }
 669          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    800    ----
   CONSTANT SIZE    =   ----    ----
C51 COMPILER V7.50   KEYREMO                                                               08/20/2007 10:23:30 PAGE 12  

   XDATA SIZE       =   ----    ----
   PDATA SIZE       =      1      16
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      1       2
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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