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

📄 yinyue40.lst

📁 汽车彩铃程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
 199   1            { highkeycount_B++;}
 200   1         else
 201   1            { 
 202   2                  /*if ( highkeycount_B < highfiltertime )    //无效输入
 203   2                     
 204   2                               {
 205   2                                highkeyflglong_B = 0;  
 206   2                                highkeyflgshort_B = 0; 
 207   2                               }
 208   2                      else
 209   2                           { 
 210   2                               */
 211   2                               if(highkeycount_B>0)
 212   2                               {
 213   3                               
 214   3                               if ( highkeycount_B > highlongtime )//长信号
 215   3                               
 216   3                       { highkeyflglong_B = 1;
 217   4                                     highkeyflgshort_B = 0; 
 218   4                                   }
 219   3                                 else
 220   3                                   { /*if ( (highkeycount_B < highshorttime) && (highkeycount_B > highfiltertime)) //短信号
 221   4                                              {*/
 222   4                                                        highkeyflgshort_B = 1;
 223   4                                            highkeyflglong_B = 0; 
 224   4                                              //      }
 225   4                                   }
 226   3                            }
 227   2      
 228   2               highkeycount_B = 0;        //计数清零
 229   2      
 230   2                }
 231   1      
 232   1      /*************************in_key_C********************************/
 233   1      
 234   1         if (in_key_C)
 235   1            { highkeycount_C++;}
 236   1         else
 237   1            { 
 238   2                  /*if ( highkeycount_C < highfiltertime )    //无效输入
 239   2                     
 240   2                               {
 241   2                                highkeyflglong_C = 0;  
C51 COMPILER V7.08   YINYUE40                                                              09/29/2006 21:38:50 PAGE 5   

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

 304   1          unsigned long i;
 305   1              do{
 306   2                  for (i=0;i<10;i++);          //实际测试设定
 307   2                  partnumx--;
 308   2               } while (partnumx != 0);
 309   1      
 310   1      }
 311          /************************************************************/
 312          void outspk_ctr (unsigned char partnum)//占用较长时间
 313          {
 314   1              
 315   1          unsigned char scount = 0;
 316   1              unsigned long wcount = 0;
 317   1              //out_power_12v = 0;//开工放
 318   1              delayNms(800);
 319   1              
 320   1              partnum = partnum|0x80;
 321   1              //out_power_12v = 0;//开工放
 322   1              //delayNms(20);
 323   1          out_spk_k1 = 0;
 324   1              delayNms(70);                     //60ms
 325   1              out_spk_k1 = 1;
 326   1              out_spk_k1 = 0;
 327   1              out_spk_k1 = 1;
 328   1      
 329   1              for (scount = 0;scount<8;scount++)//160ms
 330   1              {
 331   2      
 332   2              delayNms(10);
 333   2              out_spk_k2 = 0;
 334   2      
 335   2              if ((partnum&0x01) == 0x01)
 336   2              out_spk_k1 = 1;
 337   2              else
 338   2              out_spk_k1 = 0;
 339   2              partnum=partnum>>1;
 340   2              delayNms(5);
 341   2              out_spk_k2 = 1;
 342   2              
 343   2              //if (in_spk_01== 0) out_power_12v =1;
 344   2              //if((out_spk_k2||in_spk_01)== 1) out_power_12v =1;
 345   2      
 346   2          }
 347   1      
 348   1              delayNms(5);
 349   1         // out_spk_k2 = 0
 350   1              //out_led_D1 =0;//方音开始
 351   1          //play_busy = 1;
 352   1              //delayNms(10);//开10秒计时
 353   1          //等待播放
 354   1              
 355   1              /*do
 356   1              { //*wcount++;
 357   1                delayNms(1);/*
 358   1              }while((in_spk_01==1)||(wcount>60000)));//时间有多长会影响系统时钟?
 359   1          if (wcount>60000) 
 360   1              busy_01 = 1;
 361   1              else
 362   1              busy_01 = 0;
 363   1              //播放时间10S*/
 364   1          //out_power_12v = 1;//关工放
 365   1              
C51 COMPILER V7.08   YINYUE40                                                              09/29/2006 21:38:50 PAGE 7   

 366   1      
 367   1      }
 368          /**********************************************************/
 369          void Count_S(void)
 370          {  s_count++;
 371   1         if (s_count > 6)
 372   1         {    out_led_D2 =0;//1秒
 373   2              delayNms(5);
 374   2                      out_led_D2 =1;//1秒
 375   2                      s_count =0;
 376   2                      /*if (play_busy)
 377   2                      {
 378   2                      s10_count++;
 379   2                              if (s10_count>10)
 380   2                      {       out_power_12v = 1;//关工放
 381   2                      s10_count = 0;
 382   2                                      play_busy = 0;//关10秒计时
 383   2                                      out_led_D1 =1;//方音结束
 384   2             
 385   2                              }
 386   2                      }*/
 387   2         }
 388   1      
 389   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    710    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     26      14
   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 + -