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

📄 sfj1.lst

📁 售饭机的源码程序,单片机开发使用,可以直接使用
💻 LST
📖 第 1 页 / 共 5 页
字号:
 497   6                                      ALARM=1;
 498   6                      
 499   6                                   for(delayl=0;delayl<25000;delayl++) ;  
 500   6                         Rst_Wdog();
 501   6                         } 
 502   5                           moneyflag=0;
 503   5                   firstnumflag=1;
 504   5                           pointbit=1;
 505   5                               behindnum=0;
 506   5                      if((totalmoney>0)&&(totalmoney<30000))
 507   5                 {countok=0;
 508   6                          receivebuf[4]=totalmoney/10000;
 509   6                  receivebuf[5]=(totalmoney-receivebuf[4]*10000)/1000;
 510   6                  receivebuf[6]=(totalmoney-receivebuf[4]*10000-receivebuf[5]*1000)/100;
 511   6                  receivebuf[7]=(totalmoney-receivebuf[4]*10000-receivebuf[5]*1000-receivebuf[6]*100)/10;
 512   6                  receivebuf[8]=totalmoney%10;
 513   6              
 514   6                             earnmoney=earnmoneytemp;
 515   6                     earnmoney=earnmoney+(ulong)(totalmoney);
 516   6                               
 517   6                  EA=0;
 518   6                  ACC=STUS;  
 519   6                  while(ACC2!=1) {ACC=STUS; }
 520   6                  TXBID0=0x80|nodeaddress;
 521   6                  TXBID1=0x08;
 522   6                  TXBDATA0=nodeaddress;  
 523   6                 
 524   6                              TXBDATA1=0x56;
 525   6                  TXBDATA2=receivebuf[4];   
 526   6                  TXBDATA3=receivebuf[5];   
 527   6                  TXBDATA4=receivebuf[6];   
 528   6                  TXBDATA5=receivebuf[7];  
 529   6                  TXBDATA6=receivebuf[8];   
 530   6                 
 531   6                              TXBDATA7=0;   
 532   6                  
 533   6                  COMD=0x01;    
 534   6                  EA=1;
 535   6                              receiveflag=2;
 536   6                              keydoflag=0;
 537   6                              havemoney=0;
 538   6                              cancelstatus=0;
 539   6                  for(i=0;i<13;i++) 
 540   6                                inputdata[i]=0;
 541   6                  write728x(0x14,0x3f);
 542   6                      write728x(0x14,0xbf);
 543   6                         }
 544   5                 }
 545   4                      else if(receiveflag!=3)
 546   4                        {
C51 COMPILER V7.50   SFJ1                                                                  04/01/2007 13:44:18 PAGE 10  

 547   5                          if(firstnumflag==0)
 548   5                                 {inputmoney();
 549   6                                  receivebuf[0]=setmoney/256;
 550   6                      receivebuf[1]=setmoney-(receivebuf[0]*256);
 551   6                       if(machinestatus==5)  
 552   6                    {pointoff(); 
 553   7                                 ISendStr(0xa0,2,&receivebuf,2);
 554   7                         spendmoney=setmoney;  
 555   7                    dispmoney();
 556   7                            pointbit=1;
 557   7                                behindnum=0;  
 558   7                            firstnumflag=1;
 559   7                    for(i=4;i<9;i++)
 560   7                       receivebuf[i]=0;
 561   7                    
 562   7                            }
 563   6                       else if(machinestatus==3)  
 564   6                    {ramaddress=10+(currentkind*2);
 565   7                     ISendStr(0xa0,ramaddress,&receivebuf,2);
 566   7                     displaybuf[0]=0x0d;  displaybuf[1]=0x13; displaybuf[2]=0x2f;  displaybuf[3]=0x3f; 
 567   7                     repeatdisplay();
 568   7                     for(i=0;i<16;i++)
 569   7                       write728x(0x14,displaybuf[i]);
 570   7                     flashflag=1;
 571   7                                 pointon();
 572   7                                 enableauto=0;              
 573   7                    }
 574   6                               }  
 575   5                 }
 576   4                 if(receiveflag==3 && kindmoney>0)
 577   4                  {
 578   5                
 579   5                               earnmoney=earnmoneytemp;
 580   5                               earnmoney=earnmoney+kindmoney;
 581   5                      
 582   5                              receivebuf[4]=kindmoney/10000;
 583   5                  receivebuf[5]=(kindmoney-receivebuf[4]*10000)/1000;
 584   5                  receivebuf[6]=(uchar)((kindmoney-receivebuf[4]*10000-receivebuf[5]*1000)/100);
 585   5                  receivebuf[7]=(uchar)((kindmoney-receivebuf[4]*10000-receivebuf[5]*1000-receivebuf[6]*100)/10)
             -;
 586   5                  receivebuf[8]=(uchar)(kindmoney%10);
 587   5              
 588   5                  EA=0;
 589   5                  ACC=STUS;    
 590   5                  while(ACC2!=1) {ACC=STUS; }
 591   5                  TXBID0=0x80|nodeaddress;
 592   5                  TXBID1=0x08;
 593   5                  TXBDATA0=nodeaddress;   
 594   5                  TXBDATA1=0x56;  
 595   5                  TXBDATA2=receivebuf[4];   
 596   5                  TXBDATA3=receivebuf[5];   
 597   5                  TXBDATA4=receivebuf[6];   
 598   5                  TXBDATA5=receivebuf[7];   
 599   5                  TXBDATA6=receivebuf[8];   
 600   5                  TXBDATA7=0x00;  
 601   5                  COMD=0x01;  
 602   5                  EA=1;
 603   5                              receiveflag=2;
 604   5                      
 605   5                  kindmoney=0;
 606   5                              cancelstatus=0;
 607   5                              havemoney=0;
C51 COMPILER V7.50   SFJ1                                                                  04/01/2007 13:44:18 PAGE 11  

 608   5                              }
 609   4                       if((searchflag==1)&&(clearflag==1))  
 610   4                      {searchflag=0;
 611   5              
 612   5               pointoff();
 613   5                       receivebuf[0]=0;
 614   5               receivebuf[1]=0;
 615   5               receivebuf[2]=0;
 616   5                       ramaddress=0xd0;
 617   5               ISendStr(0xa0,ramaddress,&receivebuf,3);
 618   5               displaybuf[0]=0x0d;
 619   5               displaybuf[1]=0x1a;
 620   5               displaybuf[2]=0x2f;
 621   5               displaybuf[3]=0x3f;
 622   5               displaybuf[4]=0x4f;
 623   5               displaybuf[5]=0x50;
 624   5               displaybuf[6]=0x60;
 625   5               displaybuf[7]=0x70;
 626   5               repeatdisplay();
 627   5               for(i=0;i<16;i++)
 628   5                   write728x(0x14,displaybuf[i]);
 629   5                       earnmoney=0;
 630   5                       earnmoneytemp=0;
 631   5                       ALARM=1;
 632   5                       flashflag=0;
 633   5               Rst_Wdog();
 634   5               for(i=0;i<3;i++)
 635   5                 {for(delayl=0;delayl<25000;delayl++) ;
 636   6                  Rst_Wdog();
 637   6                         }
 638   5             }
 639   4                      }
 640   3             else if(keyvalue==33)  
 641   3                  {
 642   4                 if((pointbit==1)&&(flashflag==0)) 
 643   4                    {pointbit=0;
 644   5                                 behindnum=0;
 645   5                                 pointnum3=0;
 646   5                                 pointoff();
 647   5                     if((receivebuf[3]==0x0a)&&(machinestatus==4))
 648   5                                   {receivebuf[8]=receivebuf[8]|0x80;  
 649   6                                                               
 650   6                                       } 
 651   5                     else if(receivebuf[4]==0x0a)
 652   5                                   {receivebuf[8]=receivebuf[8]|0x80;  
 653   6                                                       
 654   6                                       } 
 655   5                     else 
 656   5                                   {firstnumflag=0;
 657   6                        for(dispshift=4;dispshift<9;dispshift++)  receivebuf[dispshift]=0x0f;
 658   6                                        write728x(0x14,0x2a);
 659   6                                        write728x(0x14,0xaa);
 660   6                                        write728x(0x14,0x30+receivebuf[4]);
 661   6                                        write728x(0x14,0x40+receivebuf[5]);
 662   6                                        write728x(0x14,0x50+receivebuf[6]);
 663   6                                        write728x(0x14,0x60+receivebuf[7]);
 664   6                                        write728x(0x14,0xb0+receivebuf[4]);
 665   6                                        write728x(0x14,0xc0+receivebuf[5]);
 666   6                                        write728x(0x14,0xd0+receivebuf[6]);
 667   6                                        write728x(0x14,0xe0+receivebuf[7]);
 668   6                                        receivebuf[8]=0x80;
 669   6                                        write728x(0x14,0x70);
C51 COMPILER V7.50   SFJ1                                                                  04/01/2007 13:44:18 PAGE 12  

 670   6                                        write728x(0x14,0xf0);
 671   6                                        cancelstatus=1;
 672   6                       } 
 673   5                                       if(machinestatus==4)
 674   5                           moneyflag=1;
 675   5                                       
 676   5                        write728x(0x18,0x3f);
 677   5                                        write728x(0x18,0x7f);                                  
 678   5                    } 
 679   4                         
 680   4              }
 681   3             else if(flashflag==0)
 682   3              {numkey();
 683   4              
 684   4                      }
 685   3              ALARM=1;  
 686   3                      EA=1;
 687   3                      TR0=1; 
 688   3              
 689   3            }   
 690   2      
 691   2           if((SYS_STATE==0x11)&&(enablesend==1))  
 692   2            {EA=0;
 693   3              
 694   3                  ALARM=1;
 695   3             X_Sum=Rec_xorsum(Serial_Buf,Serial_Buf_NumSum);
 696   3             if(Serial_Buf[Serial_Buf_NumSum]==X_Sum)            
 697   3               {      Sendbuf[0]=0xf0;
 698   4                  Sendbuf[1]=0x02;
 699   4                              Sendbuf[2]=0x02;
 700   4                              Sendbuf[3]=0xf9;
 701   4                              send(Sendbuf,4);                                      
 702   4                       ALARM=1;
 703   4                 pointoff();
 704   4                 flashflag=0;
 705   4                 T_Cnt=0;
 706   4                 enablesend=0;
 707   4                       
 708   4                         ES=0;
 709   4                 TR1=0;
 710   4      
 711   4                
 712   4                 timeflag=0;  
 713   4             for(j=0;j<5;j++)
 714   4               Num_Buf[j]=(Serial_Buf[2*j]<<4)|Serial_Buf[2*j+1];
 715   4      
 716   4                 sendorder=0x53;
 717   4                        cansend();
 718   4                                         for(delayl=0;delayl<5000;delayl++) ;  
 719   4                          Rst_Wdog();
 720   4                         receiveflag=1;
 721   4            
 722   4                 }
 723   3                 SYS_STATE=0;
 724   3             enablesend=0;
 725   3                 EX0=1;
 726   3             EA=1;
 727   3            }
 728   2            if(receiveflag==1)
 729   2               {EA=0;
 730   3                ACC=STUS;
 731   3                if(ACC0==1)
C51 COMPILER V7.50   SFJ1                                                                  04/01/2007 13:44:18 PAGE 13  

 732   3                  {
 733   4                              canreceive();
 734   4                 
 735   4                   COMD=0x0c;  
 736   4                   ACC=STUS;
 737   4                               receiveflag=0;
 738   4                   if(ACC1==1)
 739   4                      {ACC=ACC&0xfd;
 740   5                    
 741   5                      }
 742   4                  EA=1;
 743   4                      
 744   4                    if(receivebuf[3]==0x55)
 745   4                      { if(receivebuf[4]==0x0a){receivebuf[4]=0;}  
 746   5                      if(receivebuf[5]==0x0a){receivebuf[5]=0;}  
 747   5                      if(receivebuf[6]==0x0a){receivebuf[6]=0;}  
 748   5                      if(receivebuf[7]==0x0a){receivebuf[7]=0;}  
 749   5                      if(receivebuf[8]==0x0a){receivebuf[8]=0;} 
 750   5      havemoney=receivebuf[4]*10000+receivebuf[5]*1000+receivebuf[6]*100+receivebuf[7]*10+receivebuf[8];

⌨️ 快捷键说明

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