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

📄 text2.lst

📁 自己在keil51中用C实现了一个电子钢琴展览项目
💻 LST
📖 第 1 页 / 共 2 页
字号:
 277   4         send_buf[6] =send_check;
 278   4         send_buf[7] =0x0d;
 279   4         send_status =0;
 280   4         SBUF=send_buf[0];
 281   4         time_s_gj=0;
 282   4         CO_flag=0; 
 283   4         GJOK=0;
 284   4         EC=0;
 285   4         start_flag=1;
 286   4         enable=0;
 287   4        }
 288   3      }
 289   2      else if(CO==1||play_1==0||play_2==0)
 290   2      {sr_flag=0;}
 291   2      
 292   2      //延时10分钟关机 
 293   2      
 294   2      if(time_s_gj>=60&&CO_flag==0)
 295   2       { shutdown_s=0;
 296   3         shutdown_c=0;
 297   3         shutdown_f=0;                   
 298   3         shutdown=0; 
 299   3         CO_flag=1;
 300   3          } 
 301   2      
 302   2      //开机
 303   2       if(start==0&&start_flag1==0)
C51 COMPILER V8.02   TEXT2                                                                 03/26/2008 13:44:51 PAGE 6   

 304   2         { CO_flag=1;
 305   3           shutdown_c=1;
 306   3           time_s_kj=0;
 307   3           start_flag1=1; 
 308   3           start_flag=0;
 309   3         }
 310   2      
 311   2      if(time_s_kj>=60&&start_flag==0)
 312   2        { shutdown_s=1;
 313   3          start_flag=1;
 314   3          KJOK=0;
 315   3         }
 316   2      if(start==1)
 317   2        {start_flag1=0;
 318   3         }
 319   2      
 320   2      
 321   2      if(KJOK==0&&GJOK==1)
 322   2      {
 323   3      //自动烟雾
 324   3      if(time_s>=1200)
 325   3        { shutdown_f=1;
 326   4       
 327   4           if(time_s>=1800)
 328   4             { 
 329   5                      smog_open=1;
 330   5                       if(time_s>=1815)
 331   5                 {  smog_open=0;
 332   6                    shutdown_f=0;
 333   6                    time_s=0;
 334   6                 }
 335   5             }
 336   4        }
 337   3       //烟雾手动
 338   3      if(smog_hand==0&&sh_flag==0)    
 339   3       {delay();
 340   4       if(smog_hand==0&&sh_flag==0)
 341   4       { shutdown_f=1;
 342   5         time_s_3=0;
 343   5         sh_flag=1;
 344   5         auto_flag=0;
 345   5       }
 346   4       }
 347   3      if(time_s_3>=600&&auto_flag==0)
 348   3       {      smog_open=1;   //放烟雾
 349   4          if(time_s_3>=615)
 350   4            { smog_open=0;//停止放烟
 351   5              shutdown_f=0;//关烟雾器
 352   5              auto_flag=1;
 353   5                      sh_flag=0;
 354   5            }
 355   4       }
 356   3      
 357   3      //连续播放
 358   3      if(play_1==0&&play1_flag==0&&CO==1)
 359   3         {  delay();
 360   4            if(play_1==0&&play1_flag==0&&CO==1)
 361   4              { play1_flag=1;
 362   5                send_buf[0] =0x71;   
 363   5                send_buf[1] ='P';
 364   5                send_buf[2] ='L';
 365   5                send_buf[3] =',';
C51 COMPILER V8.02   TEXT2                                                                 03/26/2008 13:44:51 PAGE 7   

 366   5                send_buf[4]=0x0a;
 367   5                send_buf[5] =0x23;
 368   5                send_check=0xa5^((send_buf[0]+send_buf[1]+send_buf[2]+send_buf[3]+send_buf[4]+send_buf[5])%0x100
             -);
 369   5                send_buf[6] =send_check;
 370   5                send_buf[7] =0x0d;
 371   5                send_status =0;
 372   5                SBUF=send_buf[0]; 
 373   5              }
 374   4              }
 375   3      else if(play_1==1||CO==0)
 376   3         {play1_flag=0;}
 377   3      
 378   3      //单次播放
 379   3      if(play_2==0&&play2_flag==0&&CO==1)
 380   3        {delay();
 381   4         if(play_2==0&&play2_flag==0&&CO==1)
 382   4           {CCAPM1=0x11;
 383   5            CCAPM2=0x11;
 384   5            CCAPM3=0x11;
 385   5            CCAPM4=0x11;
 386   5                EC=1;
 387   5                play2_flag=1;          
 388   5                i=0;
 389   5                total=0;
 390   5                qmend=0;
 391   5               }
 392   4      } 
 393   3      else if(play_2==1||CO==0)
 394   3      {play2_flag=0;
 395   4      CCAPM1=0x00;
 396   4      CCAPM2=0x00;
 397   4      CCAPM3=0x00;
 398   4      CCAPM4=0x00;
 399   4      EC=0;}
 400   3      
 401   3      if(pp==0&&qmend==0&&play2_flag==1)
 402   3              { 
 403   4                        pp=1;
 404   4       
 405   4                qmend=1;
 406   4                send_buf[0]=0x71;   
 407   4                send_buf[1]='P';
 408   4                send_buf[2]='L';
 409   4                send_buf[3]=',';
 410   4                send_buf[4]=qunum;    //播放曲目
 411   4                send_buf[5]=0x23;
 412   4                send_check=0xa5^((send_buf[0]+send_buf[1]+send_buf[2]+send_buf[3]+send_buf[4]+send_buf[5])%0x100
             -);
 413   4                send_buf[6]=send_check;
 414   4                send_buf[7]=0x0d;
 415   4                send_status=0;
 416   4                SBUF=send_buf[0];
 417   4               }
 418   3              
 419   3           
 420   3      
 421   3       
 422   3      
 423   3      //暂停播放
 424   3      if(CO==0&&play_1==0&&pause==0)
 425   3         {delay();
C51 COMPILER V8.02   TEXT2                                                                 03/26/2008 13:44:51 PAGE 8   

 426   4          if(CO==0&&play_1==0&&pause==0)
 427   4            {pause=1;
 428   5             send_buf[0] =0x71;   
 429   5             send_buf[1] ='S';
 430   5             send_buf[2] ='T';
 431   5             send_buf[3] =',';
 432   5             send_buf[4]=0;
 433   5             send_buf[5] =0x23;
 434   5             send_check=0xa5^((send_buf[0]+send_buf[1]+send_buf[2]+send_buf[3]+send_buf[4]+send_buf[5]) %0x100);
 435   5             send_buf[6] =send_check;
 436   5             send_buf[7] =0x0d;
 437   5             send_status =0;
 438   5             SBUF=send_buf[0];
 439   5            }
 440   4         }
 441   3      else if(CO!=0||play_1!=0)
 442   3      {pause=0;}
 443   3      
 444   3      //继续播放
 445   3      if(CO==0&&play_2==0&&con==0)
 446   3         {delay();
 447   4          if(CO==0&&play_2==0&&con==0)
 448   4            { con=1;
 449   5              send_buf[0] =0x71;
 450   5              send_buf[1] ='P';
 451   5              send_buf[2] ='L';
 452   5              send_buf[3] =',';
 453   5              send_buf[4]=0;
 454   5              send_buf[5] =0x23;
 455   5              send_check=0xa5^((send_buf[0]+send_buf[1]+send_buf[2]+send_buf[3]+send_buf[4]+send_buf[5])%0x100);
 456   5              send_buf[6] =send_check;
 457   5              send_buf[7] =0x0d;
 458   5              send_status =0;
 459   5              SBUF=send_buf[0];
 460   5            }  
 461   4          }
 462   3      else if(CO!=0||play_2!=0)
 463   3           {con=0;}
 464   3      
 465   3      
 466   3      if(receive_status==1)
 467   3      {       
 468   4      // receive_check=0xa5^(( receive_buf[0]+receive_buf[1]+receive_buf[2]+receive_buf[3]+receive_buf[4]+receiv
             -e_buf[5] ) %0x100) ;
 469   4      if ((receive_buf[0]==0x73)&&(receive_buf[1]==0x44)&&(receive_buf[2]==0x55)&&(receive_buf[6]==0xfe))
 470   4      // if() 
 471   4        {     // shutdown_f=~shutdown_f;
 472   5           qmend=0;
 473   5           CCAPM1=0x11;
 474   5           CCAPM2=0x11;
 475   5           CCAPM3=0x11;
 476   5           CCAPM4=0x11;
 477   5               i=0;
 478   5               total=0;
 479   5           EC=1; 
 480   5           send_buf[0] =0x71;  
 481   5           send_buf[1] ='D';
 482   5           send_buf[2] ='U';
 483   5           send_buf[3] ='O';
 484   5           send_buf[4]='K';
 485   5           send_buf[5] =0x23;
 486   5           send_check=0xa5^((send_buf[0]+send_buf[1]+send_buf[2]+send_buf[3]+send_buf[4]+send_buf[5]) %0x100);
C51 COMPILER V8.02   TEXT2                                                                 03/26/2008 13:44:51 PAGE 9   

 487   5           send_buf[6] =send_check;
 488   5           send_buf[7] =0x0d;
 489   5               send_status =0;          
 490   5               SBUF=send_buf[0];
 491   5               
 492   5      //       send_num=1;
 493   5                       
 494   5        }
 495   4      /* else if(receive_buf[0]==0x73&&(receive_buf[1]!=0x44||receive_buf[2]!=0x55||receive_buf[3]!=0x2c||receiv
             -e_buf[4]!=0||receive_buf[5]!=0x23||receive_buf[6]!=receive_check||receive_buf[7]!=0x0d))
 496   4        {     qmend=1;
 497   4      
 498   4          send_buf[0] =0x71;   
 499   4          send_buf[1] ='D';
 500   4          send_buf[2] ='U';
 501   4          send_buf[3] ='E';
 502   4          send_buf[4]='R';
 503   4          send_buf[5] =0x23;
 504   4          send_check=0xa5^((send_buf[0]+send_buf[1]+send_buf[2]+send_buf[3]+send_buf[4]+send_buf[5])%0x100);
 505   4          send_buf[6] =send_check;
 506   4          send_buf[7] =0x0d;
 507   4              send_status =0;
 508   4          SBUF=send_buf[0];
 509   4          }
 510   4      if (receive_buf[0]==0x7a&&receive_buf[1]=='C'&&receive_buf[2]=='O'&&receive_buf[3]=='O'&&receive_buf[4]=='
             -K'&&receive_buf[5]=='#'&&receive_buf[6]==receive_check&&receive_buf[7]==0x0d)
 511   4              { time_s_gj=0;  
 512   4                CO_flag=0; 
 513   4            GJOK=0;
 514   4            EC=0;
 515   4            start_flag=1;
 516   4            enable=0;}        
 517   4      
 518   4       //              //关机信息发送不成功,再发送一遍
 519   4       if (receive_buf[0]==0x7a&&receive_buf[1]=='S'&&receive_buf[2]=='T'&&receive_buf[3]=='O'&&receive_buf[4]==
             -'K'&&receive_buf[5]=='#'&&receive_buf[6]==receive_check&&receive_buf[7]==0x0d)
 520   4          {play1_flag=1;receive_status=0; }       
 521   4       //if (receive_buf[0]==0x7a&&receive_buf[1]=='S'&&receive_buf[2]=='T'&&receive_buf[3]=='E'&&receive_buf[4]
             -=='R'&&receive_buf[5]=='#'&&receive_buf[6]==receive_check&&receive_buf[7]==0x0d)
 522   4          //  {play1_flag=0; }        //暂停信息发送不成功,再发送一次
 523   4       if(receive_buf[0]==0x7a&&receive_buf[1]=='P'&&receive_buf[2]=='L'&&receive_buf[3]=='O'&&receive_buf[4]=='
             -K'&&receive_buf[5]=='#'&&receive_buf[6]==receive_check&&receive_buf[7]==0x0d)
 524   4        {receive_status=0;}   //      单次信息发送成功,       `
 525   4       if (receive_buf[0]==0x7a&&receive_buf[1]=='P'&&receive_buf[2]=='L'&&receive_buf[3]=='E'&&receive_buf[4]==
             -'R'&&receive_buf[5]=='#'&&receive_buf[6]==receive_check&&receive_buf[7]==0x0d)
 526   4           {play2_flag=0;pp=0;qmend=0;con=0;pause=0;} //单次、继续、连续信息发送不成功,再发送一次   */
 527   4      
 528   4      receive_status=0;  
 529   4      }                
 530   3      
 531   3      }
 532   2      
 533   2      }
 534   1      
 535   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1414    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
C51 COMPILER V8.02   TEXT2                                                                 03/26/2008 13:44:51 PAGE 10  

   DATA SIZE        =     40    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =     18    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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