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

📄 exper.lst

📁 我使用的是MYSON的MTV412 MCU+MTV048
💻 LST
📖 第 1 页 / 共 5 页
字号:
 936           i=0;
 937           j=0;
 938           while (i<55)
 939           {
 940            while ((XRAM[HV_INTFLG]&01)!=0x01);
 941            XRAM[HV_INTFLG]=0xfe;  //clear Vsync
 942            delay(2);
 943            if ((P1&0x20)==0x20) i++;
 944            else i=0;
 945            j++;
 946            if (j>=1250) return (0x77);
 947           }
 948           return (0);
 949          }
 950          
 951          int ReadDDC1()
 952          {
 953           uchar i;
 954           int temp;
 955           i=0;
 956           temp=0;
 957           while (i<9)
 958           {
 959            while ((XRAM[HV_INTFLG]&01)!=0x01);
 960            XRAM[HV_INTFLG]=0xfe;                   //clear Vsync
 961            delay(2);
 962            if ((i==8)&&((P1&0x20)==0x00)) temp|=0x0f00;
 963            if (i<8) 
 964             {
 965              temp=(temp<<1)&0xfe;
 966              if ((P1&0x20)==0x20) temp|=0x01;
 967             }
 968            i++;
 969           }
 970           return(temp);
 971          }
 972          */
 973          void ShowVCOHORR()
 974          {
 975   1              int i;
 976   1          ClearOSD();
 977   1          OpenOSDWindow(2,5,0,21,8,3,0);
 978   1              gotoxy(6,1);
 979   1              for(i=0;i<12;i++)
 980   1               PutChar(statusVCOHORR[i],green);
 981   1          gotoxy(6,3);        
C51 COMPILER V7.06   EXPER                                                                 06/08/2006 15:01:13 PAGE 17  

 982   1              for(i=0;i<14;i++)
 983   1               PutChar(MainSW1[i],yellow);
 984   1              gotoxy(6,5);    
 985   1              for(i=0;i<15;i++)
 986   1               PutChar(MainSW2[i],yellow);
 987   1              //gotoxy(1,6);
 988   1          gotoxy(6,7);
 989   1          for(i=0;i<8;i++)
 990   1            PutChar(Exit[i],yellow);
 991   1          gotoxy(11,1);
 992   1              PrintHex(VCOAddDec,red);
 993   1              gotoxy(18,1);
 994   1              PrintDecCode(HORRAddDec,red);
 995   1          ResetKey();        
 996   1      }
 997          void ShowVertHorr()
 998          {
 999   1              int i;
1000   1              ClearOSD();
1001   1              OpenOSDWindow(2,5,0,22,8,3,0);
1002   1              gotoxy(6,1);
1003   1              for(i=0;i<13;i++)
1004   1               PutChar(statusVHValue[i],green);
1005   1              gotoxy(6,3);    
1006   1              for(i=0;i<16;i++)
1007   1               PutChar(SetVertSW1[i],yellow);
1008   1              gotoxy(6,5);    
1009   1              for(i=0;i<16;i++)
1010   1               PutChar(SetHorrSW2[i],yellow);
1011   1              //gotoxy(0,6);
1012   1              gotoxy(6,7);
1013   1              for(i=0;i<8;i++)
1014   1               PutChar(Exit[i],yellow);
1015   1              gotoxy(11,1);
1016   1               PrintDecCode(VertPosition,red);
1017   1              gotoxy(19,1);
1018   1               PrintDecCode(HorrPosition,red);
1019   1                           
1020   1      }
1021          void PrintHex(uchar da,uchar color)   //打出16进制的数据,此处做了修改
1022          {
1023   1              uchar buf[3];
1024   1              buf[2]=0;
1025   1              buf[1]=(da>>4)&0x0f;
1026   1              if (buf[1]>9) buf[1]=buf[1]-9+0x0a; //048n-06
1027   1                if(buf[1]==0) buf[1]=0x01;
1028   1                       else buf[1]+=0x01;
1029   1              PutChar(buf[1],color);
1030   1              buf[0]=da&0x0f;
1031   1          if (buf[0]>9) buf[0]=buf[0]-9+0x0a; //048n-06
1032   1                if(buf[0]==0) buf[0]=0x01;
1033   1                else buf[0]+=0x01;
1034   1              PutChar(buf[0],color);
1035   1      }
1036          
1037          void PrintDecCode(uchar da,uchar color)
1038          {
1039   1              uchar buf[3];
1040   1              bit CounterFlg0=0;
1041   1              bit CounterFlg1=0;
1042   1              if(da<100)
1043   1               buf[2]=0;
C51 COMPILER V7.06   EXPER                                                                 06/08/2006 15:01:13 PAGE 18  

1044   1                      
1045   1              buf[0]=(da%10);//Considering the first space
1046   1              buf[1]=(da/10);
1047   1              if(buf[1]>=10)
1048   1              {
1049   2               //buf[2]=1;
1050   2               buf[2]=0x02;  //***************
1051   2               buf[1]=(buf[1]-10);
1052   2              }
1053   1              
1054   1              PutChar(buf[2],color);
1055   1               if(buf[1]==0) buf[1]=0x01;// 048n-06
1056   1               //buf[1]+=0x30;  
1057   1              else buf[1]+=0x01;
1058   1              PutChar(buf[1],color);
1059   1               if(buf[0]==0) buf[0]=0x01;// 048n-06
1060   1              //buf[1]+=0x30;   
1061   1             else buf[0]+=0x01;
1062   1              PutChar(buf[0],color);
1063   1      }
1064          
1065          uchar PressKey(void)
1066          {
1067   1              //uchar i;
1068   1              uchar KeyPress;
1069   1              //Key=0;
1070   1              KeyPress=0;
1071   1              P1=0xF7;
1072   1              if((P1 & 0x01) == 0)
1073   1               KeyPress=sw1;
1074   1              else if((P1 & 0x02) == 0)
1075   1               KeyPress=sw2;
1076   1              else if ((P1 & 0x04) == 0)
1077   1               KeyPress = sw3;
1078   1              //DelayNs(1550);
1079   1              P1=0xef;
1080   1              if((P1 & 0x01) == 0)
1081   1               KeyPress=sw4;
1082   1              else if((P1 & 0x02) == 0)
1083   1               KeyPress=sw5;
1084   1              else if((P1 & 0x04) == 0)
1085   1               KeyPress=sw6; 
1086   1              if(KeyPress==1)
1087   1               KeySelect1=1;
1088   1              else if(KeyPress==2)
1089   1               KeySelect2=1;
1090   1              else if(KeyPress==3)
1091   1               KeySelect3=1;
1092   1              else if(KeyPress==4)
1093   1               KeySelect4=1;
1094   1              else if(KeyPress==5)
1095   1               KeySelect5=1;
1096   1              else if(KeyPress==6)
1097   1               KeySelect6=1;
1098   1                      
1099   1              return (KeyPress); 
1100   1      }
1101          
1102          void ShowVCOBoard()
1103          {
1104   1              int i;
1105   1              gotoxy(6,3);
C51 COMPILER V7.06   EXPER                                                                 06/08/2006 15:01:13 PAGE 19  

1106   1              for(i=0;i<3;i++)
1107   1               PutChar(VCOValue[i],green);
1108   1              
1109   1              gotoxy(6,5);    
1110   1              for(i=0;i<12;i++)               
1111   1               Putuserchar(VCOSW1[i],yellow);
1112   1              
1113   1              gotoxy(6,6);    
1114   1              for(i=0;i<12;i++)         
1115   1               Putuserchar(VCOSW2[i],yellow);
1116   1             
1117   1              gotoxy(6,7);
1118   1              for(i=0;i<8;i++)
1119   1               PutChar(VCOSW6[i],yellow);
1120   1      }
1121          void ShowHORRBoard()
1122          {
1123   1              int i;
1124   1              gotoxy(6,3);
1125   1              for(i=0;i<4;i++)
1126   1               PutChar(HORRValue[i],green);
1127   1              gotoxy(6,5);    
1128   1              for(i=0;i<12;i++)
1129   1               Putuserchar(HORRSW1[i],yellow);
1130   1              gotoxy(6,6);    
1131   1              for(i=0;i<12;i++)
1132   1               Putuserchar(HORRSW2[i],yellow);
1133   1              gotoxy(6,7);
1134   1              for(i=0;i<8;i++)
1135   1               PutChar(HORRSW6[i],yellow);
1136   1      }
1137          void AdjustVCO()
1138          {
1139   1              ResetKey();
1140   1              ClearOSD();
1141   1          OpenOSDWindow(2,5,2,18,8,3,0);
1142   1              ShowVCOBoard();
1143   1              WaitKeyup();//*****************************8
1144   1              while(KeyLayer3!=0)
1145   1              {
1146   2               gotoxy(11,3);
1147   2               PrintHex(VCOAddDec,red);
1148   2               if((KeySelect1==1)&&(KeyLayer3==1))
1149   2                {
1150   3                 delay(50);
1151   3                 VCOAddDec+=1;
1152   3                 if(VCOAddDec==4)
1153   3                   VCOAddDec=0;
1154   3                 SendOSDCmd(15,18,0x4c|VCOAddDec);
1155   3                 ResetKey();
1156   3                }
1157   2               if((KeySelect2==1)&&(KeyLayer3==1))
1158   2                {
1159   3                 delay(50);
1160   3                 VCOAddDec-=1;
1161   3                 //if(VCOAddDec<0)
1162   3                 if(VCOAddDec==0xff)
1163   3                   VCOAddDec=3;
1164   3                 SendOSDCmd(15,18,0x4c|VCOAddDec);
1165   3                 ResetKey();
1166   3                }
1167   2               if((KeySelect6==1)&&(KeyLayer3==1))
C51 COMPILER V7.06   EXPER                                                                 06/08/2006 15:01:13 PAGE 20  

1168   2                {
1169   3                 
1170   3                 delay(150);
1171   3                 KeyLayer3=0;
1172   3                 KeyLayer2=1;
1173   3                 WaitKeyup();//**************
1174   3                 ClearOSD();
1175   3                 //break;
1176   3                }
1177   2              }
1178   1              SecondMenuFlg=1;
1179   1      }
1180          
1181          void AdjustHORR()
1182          {
1183   1              ResetKey();
1184   1              ClearOSD();
1185   1              OpenOSDWindow(2,5,2,18,8,3,0);
1186   1              ShowHORRBoard();
1187   1              WaitKeyup();//**********************
1188   1              while(KeyLayer3!=0)
1189   1              {
1190   2               gotoxy(10,3);
1191   2               PrintDecCode(HORRAddDec,red);
1192   2               if((KeySelect1==1)&&(KeyLayer3==1))
1193   2                {
1194   3                 delay(50);
1195   3                 HORRAddDec+=1;
1196   3                 if(HORRAddDec==128)
1197   3                  HORRAddDec=32;
1198   3                 SendOSDCmd(15,15,HORRAddDec);
1199   3                 ResetKey();
1200   3                }
1201   2               if((KeySelect2==1)&&(KeyLayer3==1))
1202   2                {
1203   3                 delay(50);
1204   3                 HORRAddDec-=1;
1205   3                 if(HORRAddDec==31)
1206   3                  HORRAddDec=127;
1207   3                 SendOSDCmd(15,15,HORRAddDec);
1208   3                 ResetKey();
1209   3                }
1210   2               if((KeySelect6==1)&&(KeyLayer3==1))
1211   2                {
1212   3                 delay(150);
1213   3                 
1214   3                 KeyLayer3=0;
1215   3                 KeyLayer2=1;
1216   3                 //KeyLayer1=0;
1217   3                 WaitKeyup();//**************
1218   3                 SecondMenuFlg=1;
1219   3                 //MainMenuFlg=0;
1220   3                 ClearOSD();
1221   3                 }
1222   2              }
1223   1               SecondMenuFlg=1;
1224   1               //MainMenuFlg=0;     
1225   1      }
1226          void PrintString(uchar *string,uchar Stringlen,uchar color)
1227          {
1228   1              uchar i=0,buf[4];
1229   1              buf[0]=0x7a;
C51 COMPILER V7.06   EXPER                                                                 06/08/2006 15:01:13 PAGE 21  

1230   1              for(i=0;i<Stringlen;i++)
1231   1              {
1232   2               buf[1]=CursorY|0x80;
1233   2               buf[2]=CursorX;
1234   2               buf[3]=string[i];
1235   2               SendIIC(buf,4);
1236   2            
1237   2               buf[1]|=0xa0;
1238   2               buf[3]=color; 
1239   2               SendIIC(buf,4);
1240   2      
1241   2               CursorX++;
1242   2               if(CursorX>29)
1243   2                {
1244   3                 CursorX=0;
1245   3                 CursorY++;
1246   3                }
1247   2       
1248   2               if(CursorY>14) 
1249   2                CursorY=0; 
1250   2              }
1251   1                      

⌨️ 快捷键说明

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