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

📄 mcu.lst

📁 NT68521源代码
💻 LST
📖 第 1 页 / 共 4 页
字号:
 503   3                      }
 504   2                  else{
 505   3                              OSD_OFF();
 506   3                              PowerStatus &= ~BIT_7;  //power off
 507   3                              Write24C16(0xcc,PowerStatus);
 508   3                              if((flag3 & BIT_0) != 0)
 509   3                              {
 510   4                                      Write24C16(0xcd,0x00);  //disable burn in mode
 511   4                                      flag3 &= ~BIT_0;
 512   4                              }
 513   3                              PowerSaving();
 514   3                              DIG_Off();
 515   3                              DIV_PWND();
 516   3                              LED_RedOn();
 517   3                              LED_GrnOff();
 518   3                      }
 519   2                      break;
 520   2              case UpKey:  //UpKey
 521   2                      if(OSD_Type==1)
 522   2                      {
 523   3                              if(PowerStatus == 0x80)
 524   3                              {
 525   4                                      UnselectIcon();
 526   4                                      if(OSD_Point1 == 0)
 527   4                                      {
 528   5                                              if(++OSD_Point2 > 12)
 529   5                                                      OSD_Point2 = 0;
 530   5                                              if(SyncMode == 3)
 531   5                                                      if((OSD_Point2 > 1)&&(OSD_Point2 < 6))
 532   5                                                              OSD_Point2 = 6;
 533   5                                              if((flag2 & BIT_5) != 0)
 534   5                                                      if((OSD_Point2 > 7)&&(OSD_Point2 < 11))
 535   5                                                              OSD_Point2 = 11;
 536   5                                      }
 537   4                                      else
 538   4                                      {
 539   5                                              if(++OSD_Point2 > 22)
 540   5                                                      OSD_Point2 = 13;
 541   5                                      }
 542   4                                      ShowSubMenu();
 543   4                              }
 544   3                              else
 545   3                              {
 546   4                                      VideoUnSelectIcon();
C51 COMPILER V7.50   MCU                                                                   03/18/2008 22:04:55 PAGE 10  

 547   4                                      if(OSD_Point1 == 0)
 548   4                                      {       if(++OSD_Point2 > 10)
 549   5                                                      OSD_Point2 = 0;
 550   5                                      }
 551   4                                      ShowVideoSubMenu();
 552   4                              }
 553   3                      }
 554   2                      else
 555   2                              ChannelPlus();
 556   2      
 557   2                      Timer2 = (unsigned short)OSD_Timer * 100;
 558   2                      KeyBuffer = 0xff;
 559   2                      break;
 560   2              case DownKey:  //DownKey
 561   2      //*/
 562   2                      if(OSD_Type==1)
 563   2                      {
 564   3                              if(PowerStatus == 0x80)
 565   3                              {
 566   4                                      UnselectIcon();
 567   4                                      if(OSD_Point1 == 0)
 568   4                                      {
 569   5                                              if(--OSD_Point2 == 0xff)
 570   5                                                      OSD_Point2 = 12;
 571   5                                              if(SyncMode == 3)
 572   5                                                      if((OSD_Point2 > 1)&&(OSD_Point2 < 6))
 573   5                                                              OSD_Point2 = 6;
 574   5                                              if((flag2 & BIT_5) != 0)
 575   5                                                      if((OSD_Point2 > 7)&&(OSD_Point2 < 11))
 576   5                                                              OSD_Point2 = 7;
 577   5                                      }
 578   4                                      else
 579   4                                      {
 580   5                                              if(--OSD_Point2 <13)
 581   5                                                      OSD_Point2 = 22;
 582   5                                      }
 583   4                                      ShowSubMenu();
 584   4                              }
 585   3                              else
 586   3                              {
 587   4                                      VideoUnSelectIcon();
 588   4                                      if(OSD_Point1 == 0)
 589   4                                      {       if(--OSD_Point2 == 0xff)
 590   5                                                      OSD_Point2 = 10;
 591   5                                      }
 592   4                                      ShowVideoSubMenu();
 593   4                              }
 594   3                      }
 595   2                      else
 596   2                              ChannelMinus();
 597   2      //*/
 598   2      //              IRCode = 0x0d;
 599   2                      Timer2 = (unsigned short)OSD_Timer * 100;
 600   2                      KeyBuffer = 0xff;
 601   2                      break;
 602   2              case MenuKey:           //MENU
 603   2                      MenuFlag = ~MenuFlag;
 604   2                      if(MenuFlag)
 605   2                      {
 606   3                              if(PowerStatus == 0x80)
 607   3                                      MainMenu();     
 608   3                              else
C51 COMPILER V7.50   MCU                                                                   03/18/2008 22:04:55 PAGE 11  

 609   3                                      VideoMenu();
 610   3                      }
 611   2                      else
 612   2                              OSD_OFF();
 613   2                              
 614   2                      KeyBuffer = 0xff;
 615   2                      Timer2 = (unsigned short)OSD_Timer * 100;
 616   2                      break;
 617   2              case LeftKey:   //LeftKey
 618   2                      if(PowerStatus == 0x80)
 619   2                              ValueDown();
 620   2                      else
 621   2                              VideoValueDown();
 622   2                      Timer2 = (unsigned short)OSD_Timer * 100;
 623   2                      break;
 624   2              case RightKey:  //RightKey
 625   2                      if(PowerStatus == 0x80)
 626   2                              ValueUp();
 627   2                      else
 628   2                              VideoValueUp();
 629   2                      Timer2 = (unsigned short)OSD_Timer * 100;
 630   2                      break;
 631   2              case SourceKey:                 //Select
 632   2                      if((DeviceFlag & BIT_0) != 0)
 633   2                      {               // video version
 634   3                              if(++PowerStatus > 0x83){
 635   4                                      PowerStatus = 0x80;
 636   4                              }
 637   3                              Write24C16(0xcc,PowerStatus);
 638   3                              SourceSelect();
 639   3                      }
 640   2                      KeyBuffer = 0xff;
 641   2                      break;
 642   2              }
 643   1      }
 644          
 645          void LED_RedOn(void)
 646          {
 647   1      unsigned char port;
 648   1              port = PortA;
 649   1              port |= RDPA_REG;
 650   1              port |= BIT_1;
 651   1              PortA = port;
 652   1      }
 653          
 654          void LED_RedOff(void)
 655          {
 656   1      unsigned char port;
 657   1              port = PortA;
 658   1              port |= RDPA_REG;
 659   1              port &= ~BIT_1;
 660   1              PortA = port;
 661   1      }
 662          
 663          void LED_GrnOn(void)
 664          {
 665   1      unsigned char port;
 666   1              port = PortA;
 667   1              port |= RDPA_REG;
 668   1              port |= BIT_2;
 669   1              PortA = port;
 670   1      }
C51 COMPILER V7.50   MCU                                                                   03/18/2008 22:04:55 PAGE 12  

 671          
 672          void LED_GrnOff(void)
 673          {
 674   1      unsigned char port;
 675   1              port = PortA;
 676   1              port |= RDPA_REG;
 677   1              port &= ~BIT_2;
 678   1              PortA = port;
 679   1      }
 680          /*
 681          void MirrorPanel(bit fz)
 682          {
 683          unsigned char port;
 684                  port = PortD;
 685                  port |= RDPD_REG;
 686                  if(fz)
 687                          port |= BIT_3;
 688                  else
 689                          port &= ~BIT_3;
 690                  PortD = port;
 691          }
 692          
 693          void FlipPanel(bit fz)
 694          {
 695          unsigned char port;
 696                  port = PortD;
 697                  port |= RDPD_REG;
 698                  if(fz)
 699                          port |= BIT_4;
 700                  else
 701                          port &= ~BIT_4;
 702                  PortD = port;
 703          }
 704          */
 705          void VolumeSwitch(unsigned char ss)
 706          {
 707   1      unsigned char port;
 708   1              port = PortA;
 709   1              port |= RDPA_REG;
 710   1              if(ss==1)
 711   1                      port |= BIT_0;
 712   1              else if(ss==0)
 713   1                      port &= ~BIT_0;
 714   1              PortA = port;
 715   1      }
 716          
 717          void BackLightOn(void)
 718          {
 719   1      unsigned char port;
 720   1              port = PortC;
 721   1              port |= RDPC_REG;
 722   1              port |= BIT_0;
 723   1              PortC = port;
 724   1      }
 725          
 726          void BackLightOff(void)
 727          {
 728   1      unsigned char port;
 729   1              port = PortC;
 730   1              port |= RDPC_REG;
 731   1              port &= ~BIT_0;
 732   1              PortC = port;
C51 COMPILER V7.50   MCU                                                                   03/18/2008 22:04:55 PAGE 13  

 733   1              MuteTimer = 0;
 734   1      }
 735          
 736          #if PanelPowerActive == High
 737          void PanelPowerOff(void)
 738          {
 739   1      unsigned char port;
 740   1      //+3V3
 741   1              port = PortC;
 742   1              port |= RDPC_REG;
 743   1              port |= BIT_1;
 744   1              PortC = port;
 745   1              Sleep(5);
 746   1      //+12V
 747   1              port |= BIT_7;
 748   1              PortC = port;
 749   1      }
 750          
 751          void PanelPowerOn(void)
 752          {
 753   1      unsigned char port;
 754   1      //+12V
 755   1              port = PortC;
 756   1              port |= RDPC_REG;
 757   1              port &= ~BIT_7;
 758   1              PortC = port;
 759   1      //+3V3
 760   1              port &= ~BIT_1;

⌨️ 快捷键说明

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