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

📄 sfj1.lst

📁 售饭机的源码程序,单片机开发使用,可以直接使用
💻 LST
📖 第 1 页 / 共 5 页
字号:
 751   5                                 
 752   5       
 753   5                       if((receivebuf[5]==0)&&(receivebuf[4]==0))  receivebuf[5]=0x0f;  
 754   5                       if(receivebuf[4]==0)   receivebuf[4]=0x0f;
 755   5                       displaybuf[3]=0x30+receivebuf[4]; displaybuf[4]=0x40+receivebuf[5]; displaybuf[5]=0x50+re
             -ceivebuf[6];
 756   5                       displaybuf[6]=0x60+receivebuf[7]; displaybuf[7]=0x70+receivebuf[8]; 
 757   5                       repeatdisplay();
 758   5                       for(i=0;i<16;i++)
 759   5                             write728x(0x14,displaybuf[i]);
 760   5                                       write728x(0x18,0x2f);write728x(0x18,0x6f);
 761   5                                       keydoflag=1;
 762   5                                       workflag=1;
 763   5                       for(i=4;i<9;i++)   
 764   5                          receivebuf[i]=0;
 765   5                       if(machinestatus==3) 
 766   5                                         {firstnumflag=1;
 767   6                                          kindmoney=0;
 768   6                                              receiveflag=3;
 769   6                                              cancelstatus=0;
 770   6                                         }
 771   5                       else if(machinestatus==4) 
 772   5                                         {firstnumflag=1;
 773   6                                          totalmoney=0;
 774   6                                              inputpoint=0;
 775   6                                              cancelstatus=0;
 776   6                          for(i=0;i<13;i++)
 777   6                                        inputdata[i]=0;
 778   6      
 779   6                          countok=1;
 780   6                                         }
 781   5                       else if(machinestatus==5)  
 782   5                             {
 783   6                                  
 784   6                          receivebuf[4]=spendmoney/10000;
 785   6                          receivebuf[5]=(spendmoney-receivebuf[4]*10000)/1000;
 786   6                          receivebuf[6]=(spendmoney-receivebuf[4]*10000-receivebuf[5]*1000)/100;
 787   6                          receivebuf[7]=(spendmoney-receivebuf[4]*10000-receivebuf[5]*1000-receivebuf[6]*100)/10
             -;
 788   6                          receivebuf[8]=spendmoney%10;
 789   6                              
 790   6                          EA=0;
 791   6                          ACC=STUS;    
C51 COMPILER V7.50   SFJ1                                                                  04/01/2007 13:44:18 PAGE 14  

 792   6                          while(ACC2!=1) {ACC=STUS; }
 793   6                          TXBID0=0x80|nodeaddress;
 794   6                          TXBID1=0x08;
 795   6                          TXBDATA0=nodeaddress;  
 796   6                          TXBDATA1=0x56;   
 797   6                          TXBDATA2=receivebuf[4];  
 798   6                          TXBDATA3=receivebuf[5];   
 799   6                          TXBDATA4=receivebuf[6];   
 800   6                          TXBDATA5=receivebuf[7];  
 801   6                          TXBDATA6=receivebuf[8];   
 802   6                          TXBDATA7=0x00;   
 803   6                          COMD=0x01;   
 804   6                         
 805   6                          EA=1;
 806   6                                          receiveflag=2;
 807   6                                              for(i=0;i<3;i++)
 808   6                                            {for(delayl=0;delayl<20000;delayl++) ;  
 809   7                             Rst_Wdog();
 810   7                                                }
 811   6                         
 812   6                         }
 813   5                      }
 814   4                    else if(receivebuf[3]==0x54)  
 815   4                      {receivebuf[8]=receivebuf[4]&0x0f;
 816   5                       displaybuf[3]=0x3f; displaybuf[4]=0x4f; displaybuf[5]=0x5b;
 817   5                       displaybuf[6]=0x6a; displaybuf[7]=0x70+receivebuf[8]; 
 818   5                       repeatdisplay();
 819   5                       for(i=0;i<16;i++)
 820   5                             write728x(0x14,displaybuf[i]);
 821   5                               receiveflag=0;
 822   5                               flashcount=1;
 823   5                                       SYS_STATE=0;
 824   5                                   pointbit=1;
 825   5                               firstnumflag=1;
 826   5                                       ALARM=0;
 827   5                                      
 828   5                                     for(delayl=0;delayl<20000;delayl++) ;
 829   5                          Rst_Wdog();
 830   5                                       
 831   5                       ALARM=1;   
 832   5                                  if(machinestatus==5)
 833   5                                     {
 834   6                              dispmoney();
 835   6                                              enablesend=1;
 836   6                          ES=1;
 837   6                                              TR1=1;
 838   6                                         }
 839   5                                else {timeflag=1; TR0=1;}
 840   5                      } 
 841   4                                                                  
 842   4                  }          
 843   3                } 
 844   2                       else if(receiveflag==2)
 845   2                 {for(delayl=0;delayl<25000;delayl++) ;
 846   3                  Rst_Wdog();
 847   3                 
 848   3                  EA=0;
 849   3                          ACC=STUS;
 850   3                 if(ACC0==1)
 851   3                  {canreceive();
 852   4                   COMD=0x04;
 853   4                   ACC=STUS;
C51 COMPILER V7.50   SFJ1                                                                  04/01/2007 13:44:18 PAGE 15  

 854   4                               receiveflag=0;
 855   4                               workflag=0;
 856   4                   if(ACC1==1)
 857   4                      {ACC=ACC&0xfd;
 858   5                    
 859   5                      }
 860   4                      
 861   4                    EA=1;
 862   4                    if(receivebuf[3]==0x57)              
 863   4                      { if(receivebuf[4]==0x0a){receivebuf[4]=0;}  
 864   5                      if(receivebuf[5]==0x0a){receivebuf[5]=0;}  
 865   5                      if(receivebuf[6]==0x0a){receivebuf[6]=0;}  
 866   5                      if(receivebuf[7]==0x0a){receivebuf[7]=0;}  
 867   5                      if(receivebuf[8]==0x0a){receivebuf[8]=0;} 
 868   5                                       pointoff();
 869   5                      
 870   5                       if(receivebuf[9]!=0x30)  
 871   5                        {receivebuf[8]=receivebuf[9]&0x0f;
 872   6                         displaybuf[3]=0x3f; displaybuf[4]=0x4f; displaybuf[5]=0x5b;
 873   6                       displaybuf[6]=0x6a; displaybuf[7]=0x70+receivebuf[8]; 
 874   6                       repeatdisplay();
 875   6                       for(i=0;i<16;i++)
 876   6                             write728x(0x14,displaybuf[i]);
 877   6                        
 878   6                        
 879   6                                 ALARM=0;
 880   6                        }
 881   5                                       else
 882   5                                        {if((receivebuf[5]==0)&&(receivebuf[4]==0))  receivebuf[5]=0x0f;  
 883   6                         if(receivebuf[4]==0)   receivebuf[4]=0x0f;
 884   6                         displaybuf[3]=0x30+receivebuf[4]; displaybuf[4]=0x40+receivebuf[5]; displaybuf[5]=0x50+
             -receivebuf[6];
 885   6                         displaybuf[6]=0x60+receivebuf[7]; displaybuf[7]=0x70+receivebuf[8]; 
 886   6                         repeatdisplay();
 887   6                         for(i=0;i<16;i++)
 888   6                              write728x(0x14,displaybuf[i]);
 889   6                                     write728x(0x18,0x2f);write728x(0x18,0x6f);
 890   6                         if(machinestatus==5)
 891   6                                          {earnmoney=earnmoneytemp;
 892   7                           earnmoney=earnmoney+(ulong)(spendmoney);
 893   7                                              }
 894   6                                          earnmoneytemp=earnmoney;
 895   6                                      receivebuf[0]=(uchar)(earnmoneytemp/65536);
 896   6                          earnmoneytemp1=(uint)(earnmoneytemp-receivebuf[0]*65536);
 897   6                          receivebuf[1]=(uchar)(earnmoneytemp1/256);
 898   6                          receivebuf[2]=(uchar)(earnmoneytemp1-receivebuf[1]*256);
 899   6                          ramaddress=0xd0;
 900   6                          ISendStr(0xa0,ramaddress,&receivebuf,3);
 901   6      
 902   6                                        }
 903   5                                      
 904   5                                         for(delayl=0;delayl<25000;delayl++) ;  
 905   5                          Rst_Wdog();
 906   5                                      
 907   5                         ALARM=1;
 908   5                      }
 909   4                                receiveflag=0;
 910   4                              
 911   4                                flashcount=1;
 912   4                    if(machinestatus==5)
 913   4                                  {pointbit=1;
 914   5                               firstnumflag=1;
C51 COMPILER V7.50   SFJ1                                                                  04/01/2007 13:44:18 PAGE 16  

 915   5                      
 916   5                                   for(delayl=0;delayl<25000;delayl++) ;  for(delayl=0;delayl<20000;delayl++) ;
 917   5                          Rst_Wdog();
 918   5                        
 919   5                       
 920   5                       write728x(0x14,0x3f);
 921   5                                   write728x(0x14,0xbf);
 922   5                       write728x(0x18,0xaf);write728x(0x18,0xef);
 923   5                       dispmoney();
 924   5                                        enablesend=1;
 925   5                                ES=1;
 926   5                                TR1=1;
 927   5                       for(delayl=0;delayl<15000;delayl++) ;
 928   5                                      }
 929   4                                else 
 930   4                                  {timeflag=1;
 931   5                        TR0=1;
 932   5                                      }
 933   4                                                           
 934   4                  }  
 935   3                         }
 936   2           } 
 937   1         } 
 938          void dispmoney(void)
 939          { lightflag=0;
 940   1        displaybuf[3]=(uchar)(spendmoney/10000);
 941   1        displaybuf[4]=(uchar)((spendmoney-displaybuf[3]*10000)/1000);
 942   1        displaybuf[5]=(uchar)((spendmoney-displaybuf[3]*10000-displaybuf[4]*1000)/100);
 943   1        displaybuf[6]=(uchar)((spendmoney-displaybuf[3]*10000-displaybuf[4]*1000-displaybuf[5]*100)/10);
 944   1        displaybuf[7]=(uchar)(spendmoney%10);
 945   1        if((displaybuf[3]==0)&&(displaybuf[4]==0))  displaybuf[4]=0x0f;  
 946   1        if(displaybuf[3]==0)   displaybuf[3]=0x0f;
 947   1       
 948   1       if((displaybuf[6]==0)&&(displaybuf[7]==0))
 949   1          {for(dispshift=7;dispshift>5;dispshift--)
 950   2                {displaybuf[dispshift]=displaybuf[dispshift-2];
 951   3                }
 952   2           displaybuf[4]=0x0f;displaybuf[5]=0x0f;
 953   2         write728x(0x18,0x3f);   write728x(0x18,0x7f);
 954   2          lightflag=1;
 955   2          }    
 956   1        if((displaybuf[7]==0)&&(lightflag==0))
 957   1          {for(dispshift=7;dispshift>3;dispshift--)
 958   2                {displaybuf[dispshift]=displaybuf[dispshift-1];
 959   3                }
 960   2          if (lightflag==0)
 961   2           {write728x(0x18,0x37);   write728x(0x18,0x77);     
 962   3                lightflag=1;
 963   3           }
 964   2              }
 965   1        if (lightflag==0)  { write728x(0x18,0x2f);   write728x(0x18,0x6f);}
 966   1        displaybuf[3]=0x30+displaybuf[3]; displaybuf[4]=0x40+displaybuf[4]; displaybuf[5]=0x50+displaybuf[5];
 967   1        displaybuf[6]=0x60+displaybuf[6]; displaybuf[7]=0x70+displaybuf[7]; 
 968   1        repeatdisplay();
 969   1        for(i=0;i<16;i++)
 970   1           write728x(0x14,displaybuf[i]);
 971   1      }
 972          
 973          void numkey(void)
 974          {if((machinestatus==5)||(flagkeyd==1))
 975   1        {
 976   2        if(numkeyvalue<10)
C51 COMPILER V7.50   SFJ1                                                                  04/01/2007 13:44:18 PAGE 17  

 977   2         {for(j=0;j<8;j++)
 978   3            {write728x(0x18,pointoffvalue[j]);
 979   4            }
 980   3          receivebuf[4]=0x0a;
 981   3          if(firstnumflag==1)
 982   3            {firstnumflag=0;
 983   4             for(dispshift=5;dispshift<9;dispshift++)  receivebuf[dispshift]=0x0f;
 984   4            }
 985   3          else
 986   3        
 987   3           {if(pointbit==0) behindnum=behindnum+1;
 988   4                if((behindnum<3)||(pointbit==1))
 989   4                 {for(dispshift=5;dispshift<9;dispshift++) 
 990   5                  receivebuf[dispshift-1]=receivebuf[dispshift];
 991   5             } 
 992   4               }
 993   3      
 994   3          receivebuf[8]=numkeyvalue;
 995   3                          for(i=5;i<9;i++)
 996   3                                {if((receivebuf[i]&0x80)!=0x00)   
 997   4                               {write728x(0x18,pointonvalue[i-5]);
 998   5                                        write728x(0x18,pointonvalue[i-1]); 
 999   5                                       }
1000   4                    }  
1001   3         displaybuf[3]=0x30+(receivebuf[4]&0x0f); displaybuf[4]=0x40+(receivebuf[5]&0x0f); displaybuf[5]=0x50+(r
             -eceivebuf[6]&0x0f);

⌨️ 快捷键说明

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