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

📄 40w.lst

📁 汽车彩铃程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
 238   4                                   }
 239   3                            }
 240   2      
 241   2               highkeycount_B = 0;        //计数清零
C51 COMPILER V7.08   40W                                                                   09/30/2006 21:14:41 PAGE 5   

 242   2      
 243   2                }
 244   1      
 245   1      /*************************in_key_C********************************/
 246   1      
 247   1         if (in_key_C)
 248   1            { highkeycount_C++;}
 249   1         else
 250   1            { 
 251   2                  /*if ( highkeycount_C < highfiltertime )    //无效输入
 252   2                     
 253   2                               {
 254   2                                highkeyflglong_C = 0;  
 255   2                                highkeyflgshort_C = 0; 
 256   2                               }
 257   2                      else
 258   2                           { */
 259   2                               if(highkeycount_C>1)
 260   2                               {
 261   3                               
 262   3                               
 263   3                               if ( highkeycount_C > highlongtime )//长信号
 264   3                               
 265   3                       { highkeyflglong_C = 1;
 266   4                                     highkeyflgshort_C = 0; 
 267   4                                   }
 268   3                                 else
 269   3                                   {/*if ( (highkeycount_C < highshorttime) && (highkeycount_C > highfiltertime)) //短信号
 270   4                                              {*/
 271   4                                                        highkeyflgshort_C = 1;
 272   4                                            highkeyflglong_C = 0; 
 273   4                                              //      }
 274   4                                   }
 275   3                            }
 276   2      
 277   2               highkeycount_C = 0;        //计数清零
 278   2                }
 279   1      /***********************in_key_D**********************************/
 280   1         if (in_key_D)
 281   1            { highkeycount_D++;}
 282   1         else
 283   1            { /*
 284   2                   if ( highkeycount_D < highfiltertime )    //无效输入
 285   2                     
 286   2                               {
 287   2                                highkeyflglong_D = 0;  
 288   2                                highkeyflgshort_D = 0; 
 289   2                               }
 290   2                      else
 291   2                           { */
 292   2                               if(highkeycount_D>1)
 293   2                               {
 294   3                               
 295   3                               
 296   3                               if ( highkeycount_D > highlongtime )//长信号
 297   3                               
 298   3                       { highkeyflglong_D = 1;
 299   4                                     highkeyflgshort_D = 0; 
 300   4                                   }
 301   3                                 else
 302   3                                   { /*if ( (highkeycount_D < highshorttime) && (highkeycount_D > highfiltertime)) //短信号
 303   4                                              {*/
C51 COMPILER V7.08   40W                                                                   09/30/2006 21:14:41 PAGE 6   

 304   4                                                        highkeyflgshort_D = 1;
 305   4                                            highkeyflglong_D = 0; 
 306   4                                                      }
 307   3                                 //  }
 308   3                            }
 309   2      
 310   2               highkeycount_D = 0;        //计数清零
 311   2                }
 312   1      
 313   1      }
 314          /************************************************************/
 315          void delayNms (unsigned long partnumx)
 316          {
 317   1          unsigned long i;
 318   1              do{
 319   2                  for (i=0;i<10;i++);          //实际测试设定
 320   2                  partnumx--;
 321   2               } while (partnumx != 0);
 322   1      
 323   1      }
 324          
 325          /************************************************************/
 326          
 327          void o1 (void)
 328          {  
 329   1              k1=1;
 330   1              delayNms(100);
 331   1              k1=0;
 332   1      }
 333          
 334          void o2 (void)
 335          {  
 336   1              k2=1;
 337   1              delayNms(100);
 338   1              k2=0;
 339   1      }
 340          
 341          void o3 (void)
 342          {  
 343   1              k3=1;
 344   1              delayNms(100);
 345   1              k3=0;
 346   1      }
 347          
 348          void o4 (void)
 349          {  
 350   1              k4=1;
 351   1              delayNms(100);
 352   1              k4=0;
 353   1      }
 354          
 355          void o5 (void)
 356          {  
 357   1              k5=1;
 358   1              delayNms(100);
 359   1              k5=0;
 360   1      }
 361          
 362          void o6 (void)
 363          {  
 364   1              k6=1;
 365   1              delayNms(100);
C51 COMPILER V7.08   40W                                                                   09/30/2006 21:14:41 PAGE 7   

 366   1              k6=0;
 367   1      }
 368          
 369          void o7 (void)
 370          {  
 371   1              k7=1;
 372   1              delayNms(100);
 373   1              k7=0;
 374   1      }
 375          
 376          void o8 (void)
 377          {  
 378   1              k8=1;
 379   1              delayNms(100);
 380   1              k8=0;
 381   1      }
 382          /*void outkey (unsigned char partnum)
 383          {
 384                  partnum=1;
 385                  delayNms(40);
 386                  partnum=0;
 387          }*/
 388          
 389          /*void outspk_ctr (unsigned char partnum)//占用较长时间
 390          {
 391                  
 392              unsigned char scount = 0;
 393                  unsigned long wcount = 0;
 394                  //out_power_12v = 0;//开工放
 395                  //delayNms(1200);
 396                  
 397                  partnum = partnum|0x80;
 398                  //out_power_12v = 0;//开工放
 399                  //delayNms(20);
 400              out_spk_k1 = 0;
 401                  delayNms(70);                     //60ms
 402                  out_spk_k1 = 1;
 403                  out_spk_k1 = 0;
 404                  out_spk_k1 = 1;
 405          
 406                  for (scount = 0;scount<8;scount++)//160ms
 407                  {
 408          
 409                  delayNms(10);
 410                  out_spk_k2 = 0;
 411          
 412                  if ((partnum&0x01) == 0x01)
 413                  out_spk_k1 = 1;
 414                  else
 415                  out_spk_k1 = 0;
 416                  partnum=partnum>>1;
 417                  delayNms(5);
 418                  out_spk_k2 = 1;
 419                  
 420                  //if (in_spk_01== 0) out_power_12v =1;
 421                  //if((out_spk_k2||in_spk_01)== 1) out_power_12v =1;
 422          
 423              }
 424          
 425                  delayNms(5);
 426             // out_spk_k2 = 0
 427                  //out_led_D1 =0;//方音开始
C51 COMPILER V7.08   40W                                                                   09/30/2006 21:14:41 PAGE 8   

 428              //play_busy = 1;
 429                  //delayNms(10);//开10秒计时
 430              //等待播放
 431                  
 432                  /*do
 433                  { //*wcount++;
 434                    delayNms(1);/*
 435                  }while((in_spk_01==1)||(wcount>60000)));//时间有多长会影响系统时钟?
 436              if (wcount>60000) 
 437                  busy_01 = 1;
 438                  else
 439                  busy_01 = 0;
 440                  //播放时间10S*/
 441              //out_power_12v = 1;//关工放
 442                  
 443          
 444          //}
 445          /**********************************************************/
 446          void Count_S(void)
 447          {  s_count++;
 448   1         if (s_count > 6)
 449   1         {    out_led_D2 =0;//1秒
 450   2              delayNms(5);
 451   2                      out_led_D2 =1;//1秒
 452   2                      s_count =0;
 453   2                      /*if (play_busy)
 454   2                      {
 455   2                      s10_count++;
 456   2                              if (s10_count>10)
 457   2                      {       out_power_12v = 1;//关工放
 458   2                      s10_count = 0;
 459   2                                      play_busy = 0;//关10秒计时
 460   2                                      out_led_D1 =1;//方音结束
 461   2             
 462   2                              }
 463   2                      }*/
 464   2         }
 465   1      
 466   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    676    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     26       8
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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