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

📄 overhead.lst

📁 单片机程序代码,经过很详细的测试.呵呵,硬件相关.
💻 LST
📖 第 1 页 / 共 5 页
字号:
 324   3              case 0x5635:switch (portid){                                //V5字节 得出Mapper中的支路号
 325   4                                              case 1: outporth=0;
 326   4                                                      outportl=0x35;
 327   4                                                              break;
 328   4                                              case 2: outporth=0;
 329   4                                                      outportl=0x65;
 330   4                                                              break;
 331   4                                              case 3: outporth=0;
 332   4                                                      outportl=0x95;
 333   4                                                              break;
 334   4                                              case 4: outporth=0;
 335   4                                                      outportl=0xC5;
 336   4                                                              break;
 337   4                                              case 5: outporth=0x08;
 338   4                                                      outportl=0x35;
 339   4                                                              break;
 340   4                                              case 6: outporth=0x08;
 341   4                                                      outportl=0x65;
 342   4                                                              break;
 343   4                                              case 7: outporth=0x08;
 344   4                                                      outportl=0x95;
 345   4                                                              break;
 346   4                                              case 8: outporth=0x08;
 347   4                                                      outportl=0xC5;
 348   4                                                              break;
 349   4                                              case 9: outporth=0x10;
 350   4                                                      outportl=0x35;
 351   4                                                              break;
 352   4                                              case 10: outporth=0x10;
 353   4                                                       outportl=0x65;
 354   4                                                               break;
 355   4                                              case 11: outporth=0x10;
 356   4                                                       outportl=0x95;
 357   4                                                               break;
 358   4                                              case 12: outporth=0x10;
 359   4                                                       outportl=0xC5;
 360   4                                                               break;
 361   4                                              case 13: outporth=0x18;
 362   4                                                           outportl=0x35;
 363   4                                                               break;
 364   4                                              case 14: outporth=0x18;
 365   4                                                      outportl=0x65;
C51 COMPILER V7.50   OVERHEAD                                                              03/10/2006 16:35:47 PAGE 7   

 366   4                                                              break;
 367   4                                              case 15: outporth=0x18;
 368   4                                                      outportl=0x95;
 369   4                                                              break;
 370   4                                              case 16: outporth=0x18;
 371   4                                                      outportl=0xC5;
 372   4                                                              break;
 373   4                                              case 17: outporth=0x20;
 374   4                                                      outportl=0x35;
 375   4                                                              break;
 376   4                                              case 18: outporth=0x20;
 377   4                                                      outportl=0x65;
 378   4                                                              break;
 379   4                                              case 19: outporth=0x20;
 380   4                                                      outportl=0x95;
 381   4                                                              break;
 382   4                                              case 20: outporth=0x20;
 383   4                                                      outportl=0xC5;
 384   4                                                              break;
 385   4                                              case 21: outporth=0x28;
 386   4                                                       outportl=0x35;
 387   4                                                               break;
 388   4                                          default: break;
 389   4                                      }
 390   3                                      switch (boardid){
 391   4                                              case 1: if (start_flg[1] == 0){
 392   5                                                                      overhead_value = se0111_reg_rd(outporth,outportl,1);  //2M盘1得到V5中的bit7-5
 393   5                                              temp_value = se0111_reg_rd(outporth,outportl-4,1);
 394   5                                                                      temp_value = (temp_value << 1) & 0x08;                //得到V5中的bit4 RFI
 395   5                                                                      overhead_value = (overhead_value <<4) | temp_value;
 396   5                                                                  return_value = 0;
 397   5                                                              }
 398   4                                                              else return_value = 2;
 399   4                                                              break;
 400   4                                              case 2: if (start_flg[2] == 0){
 401   5                                                                      overhead_value = se0111_reg_rd(outporth,outportl,2);  //2M盘2得到V5中的bit7-5
 402   5                                              temp_value = se0111_reg_rd(outporth,outportl-4,2);
 403   5                                                                      temp_value = (temp_value << 1) & 0x08;                //得到V5中的bit4 RFI
 404   5                                                                      overhead_value = (overhead_value <<4) | temp_value;
 405   5                                                              return_value = 0;
 406   5                                                              }
 407   4                                                              else return_value = 2;
 408   4                                                              break;
 409   4                                              case 3: if (start_flg[3] == 0){
 410   5                                                                      overhead_value = se0111_reg_rd(outporth,outportl,3);  //2M盘3得到V5中的bit7-5
 411   5                                              temp_value = se0111_reg_rd(outporth,outportl-4,3);
 412   5                                                                      temp_value = (temp_value << 1) & 0x08;                //得到V5中的bit4 RFI
 413   5                                                                      overhead_value = (overhead_value <<4) | temp_value;
 414   5                                                              return_value = 0;
 415   5                                                              }
 416   4                                                              else return_value = 2;
 417   4                                                              break;
 418   4                                              default: return_value = 2;
 419   4                                                               break;  
 420   4                                      }
 421   3                                      break;
 422   3              default: return_value = 2;
 423   3                               break;
 424   3              }
 425   2              }
 426   1              else return_value = 2;
 427   1              if (!GetResRdyTbl(12))
C51 COMPILER V7.50   OVERHEAD                                                              03/10/2006 16:35:47 PAGE 8   

 428   1                      SetResRdyTbl(12); 
 429   1              return (return_value);
 430   1      }
 431          
 432          
 433          void report_overhead_value(unsigned char value,unsigned char overhead_value){
 434   1      //C20取开销字节回应函数
 435   1      unsigned char xdata temp_value;
 436   1      
 437   1              tx_buf[0] = '$';
 438   1              tx_buf[1] = '2';
 439   1              tx_buf[2] = '1';
 440   1              tx_buf[3] = 0x43;
 441   1              tx_buf[4] = 0x32;
 442   1              tx_buf[5] = 0x30;
 443   1              tx_buf[6] = '0';
 444   1              tx_buf[7] = '0';
 445   1              tx_buf[8] = '0';
 446   1              tx_buf[9] = '3';
 447   1              tx_buf[10] = value+0x30;
 448   1              temp_value = (overhead_value >> 4) & 0x0F;
 449   1              if (temp_value > 9){
 450   2                      temp_value = temp_value + 0x37;
 451   2              }
 452   1              else temp_value = temp_value + 0x30;
 453   1              tx_buf[11] = temp_value;
 454   1              temp_value = overhead_value & 0x0F;
 455   1              if (temp_value > 9){
 456   2                      temp_value = temp_value + 0x37;
 457   2              }
 458   1              else temp_value = temp_value + 0x30;
 459   1              tx_buf[12] = temp_value;
 460   1              tx_buf[13] = '*';
 461   1              tx_buf_pointer = 0;     
 462   1              while(tx_buf[tx_buf_pointer] != '*'){
 463   2                      SBUF = tx_buf[tx_buf_pointer];
 464   2                      while(tx_done == 0);
 465   2                      tx_done = 0;
 466   2                      tx_buf_pointer++;
 467   2              }
 468   1              SBUF = tx_buf[tx_buf_pointer];          //发送最后一个字符'*'
 469   1              while(tx_done == 0);
 470   1              tx_done = 0;
 471   1      
 472   1      }
 473          
 474          
 475          
 476          unsigned char set_overhead_value(struct cmd_para_save *set_overhead){
 477   1      //C21配置开销字节值
 478   1      unsigned char xdata boardid;
 479   1      unsigned char xdata portid;
 480   1      unsigned char xdata timeid;
 481   1      unsigned char xdata outporth;
 482   1      unsigned char xdata outportl;
 483   1      unsigned int  xdata overhead_name;
 484   1      unsigned char xdata set_value;
 485   1      unsigned char xdata return_value;
 486   1      unsigned char xdata temp_value;
 487   1      unsigned char xdata temp;
 488   1      
 489   1              commandid = 0x00433231;
C51 COMPILER V7.50   OVERHEAD                                                              03/10/2006 16:35:47 PAGE 9   

⌨️ 快捷键说明

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