📄 overhead.c
字号:
break;
case 8: outporth=0x05;
outportl=0x24;
break;
case 9: outporth=0x05;
outportl=0x44;
break;
case 10: outporth=0x05;
outportl=0x64;
break;
case 11: outporth=0x05;
outportl=0x84;
break;
case 12: outporth=0x05;
outportl=0xA4;
break;
case 13: outporth=0x05;
outportl=0xC4;
break;
case 14: outporth=0x05;
outportl=0xE4;
break;
case 15: outporth=0x06;
outportl=0x24;
break;
case 16: outporth=0x06;
outportl=0x44;
break;
case 17: outporth=0x06;
outportl=0x64;
break;
case 18: outporth=0x06;
outportl=0x84;
break;
case 19: outporth=0x06;
outportl=0xA4;
break;
case 20: outporth=0x06;
outportl=0xC4;
break;
case 21: outporth=0x06;
outportl=0xE4;
break;
default: break;
}
set_value = (set_value << 4) &0xF0;
switch (boardid){
case 1: if (start_flg[1] == 0){
se0111_reg_wr(outporth,outportl,set_value,1);//A路B路错误 //2M盘1
return_value = 0;
}
else return_value = 2;
break;
case 2: if (start_flg[2] == 0){
se0111_reg_wr(outporth,outportl,set_value,2); //2M盘2
return_value = 0;
}
else return_value = 2;
break;
case 3: if (start_flg[3] == 0){
se0111_reg_wr(outporth,outportl,set_value,3); //2M盘3
return_value = 0;
}
else return_value = 2;
break;
default:return_value = 2;
break;
}
break;
case 0x5635:switch (portid){ //V5字节 得出Mapper中的支路号
case 1: outporth=0x04;//??对应原0055,可能导致错误
outportl=0x23;
break;
case 2: outporth=0x04;
outportl=0x43;
break;
case 3: outporth=0x04;
outportl=0x63;
break;
case 4: outporth=0x04;
outportl=0x83;
break;
case 5: outporth=0x04;
outportl=0xA3;
break;
case 6: outporth=0x04;
outportl=0xC3;
break;
case 7: outporth=0x04;
outportl=0xE3;
break;
case 8: outporth=0x05;
outportl=0x23;
break;
case 9: outporth=0x05;
outportl=0x43;
break;
case 10: outporth=0x05;
outportl=0x63;
break;
case 11: outporth=0x05;
outportl=0x83;
break;
case 12: outporth=0x05;
outportl=0xA3;
break;
case 13: outporth=0x05;
outportl=0xC3;
break;
case 14: outporth=0x05;
outportl=0xE3;
break;
case 15: outporth=0x06;
outportl=0x23;
break;
case 16: outporth=0x06;
outportl=0x43;
break;
case 17: outporth=0x06;
outportl=0x63;
break;
case 18: outporth=0x06;
outportl=0x83;
break;
case 19: outporth=0x06;
outportl=0xA3;
break;
case 20: outporth=0x06;
outportl=0xC3;
break;
case 21: outporth=0x06;
outportl=0xE3;
break;
default: break;
}
temp = (set_value << 7) & 0x80; //将V5字节的高低位对调,满足仪表显示值与设置值相同
temp |= (set_value << 5) & 0x40;
temp |= (set_value << 3) & 0x20;
temp |= (set_value << 1) & 0x10;
temp |= (set_value >> 7) & 0x01;
temp |= (set_value >> 5) & 0x02;
temp |= (set_value >> 3) & 0x04;
temp |= (set_value >> 1) & 0x08;
set_value = temp;
switch (boardid){
case 1: if (start_flg[1] == 0){
temp_value = (set_value >> 4) & 0x07; //取出V5中bit7-5
se0111_reg_wr(outporth,outportl,temp_value,1);//??A路B路错误,原0055含义单一而0423比特位含义丰富,可能导致错误
temp_value = (set_value >> 2) & 0x01; //取出V5中bit3
temp_value |= se0111_reg_rd(outporth,outportl-2,1) & 0xFE;
se0111_reg_wr(outporth,outportl-2,temp_value,1);
temp_value = (set_value >> 6) & 0x02; //取出V5中bit8
temp_value |= se0111_reg_rd(outporth,outportl-4,1) & 0xFD;
se0111_reg_wr(outporth,outportl-4,temp_value,1);
temp_value = (set_value >> 1) & 0x04; //取出V5中bit4
temp_value |= se0111_reg_rd(outporth,outportl-5,1) & 0xFB;
se0111_reg_wr(outporth,outportl-5,temp_value,1);
return_value = 0;
}
else return_value = 2;
break;
case 2: if (start_flg[2] == 0){
temp_value = (set_value >> 4) & 0x07; //取出V5中bit7-5
se0111_reg_wr(outporth,outportl,temp_value,2);
temp_value = (set_value >> 2) & 0x01; //取出V5中bit3
temp_value |= se0111_reg_rd(outporth,outportl-2,2) & 0xFE;
se0111_reg_wr(outporth,outportl-2,temp_value,2);
temp_value = (set_value >> 6) & 0x02; //取出V5中bit8
temp_value |= se0111_reg_rd(outporth,outportl-4,2) & 0xFD;
se0111_reg_wr(outporth,outportl-4,temp_value,2);
temp_value = (set_value >> 1) & 0x04; //取出V5中bit4
temp_value |= se0111_reg_rd(outporth,outportl-5,2) & 0xFB;
se0111_reg_wr(outporth,outportl-5,temp_value,2);
return_value = 0;
}
else return_value = 2;
break;
case 3: if (start_flg[3] == 0){
temp_value = (set_value >> 4) & 0x07; //取出V5中bit7-5
se0111_reg_wr(outporth,outportl,temp_value,3);
temp_value = (set_value >> 2) & 0x01; //取出V5中bit3
temp_value |= se0111_reg_rd(outporth,outportl-2,3) & 0xFE;
se0111_reg_wr(outporth,outportl-2,temp_value,3);
temp_value = (set_value >> 6) & 0x02; //取出V5中bit8
temp_value |= se0111_reg_rd(outporth,outportl-4,3) & 0xFD;
se0111_reg_wr(outporth,outportl-4,temp_value,3);
temp_value = (set_value >> 1) & 0x04; //取出V5中bit4
temp_value |= se0111_reg_rd(outporth,outportl-5,3) & 0xFB;
se0111_reg_wr(outporth,outportl-5,temp_value,3);
return_value = 0;
}
else return_value = 2;
break;
default: return_value = 2;
break;
}
break;
default:return_value = 2;
break;
}
}
else return_value = 2;
if (!GetResRdyTbl(1))
SetResRdyTbl(1);
return (return_value);
}
unsigned char get_overheadj_value(struct cmd_para_save *get_overheadj){
//C22取j开销字节函数
unsigned char xdata boardid; //盘号
unsigned char xdata portid; //端口号
unsigned char xdata timeid; //时隙号
unsigned char xdata outporth; //Mapper中端口高8位
unsigned char xdata outportl; //Mapper中端口低8位
unsigned int xdata overhead_name; //开销字节名
unsigned char xdata return_value; //返回值
unsigned char xdata temp;
unsigned char xdata i;
unsigned char xdata k;
commandid = 0x00433232;
boardid = get_overheadj -> ohjget_board;
portid = get_overheadj -> ohjget_port;
timeid = get_overheadj -> ohjget_slot;
overhead_name = get_overheadj -> ohjget_name;
switch (overhead_name){
case 0x4A31: if (boardid == 4 & start_flg[0] == 0){ //J1字节光分支盘OTB
if (portid == 1){ //光分支7860A口
j_rx[0] = f2rc7860_rd(F2PohJ1_rx2_a);
j_rx[1] = f2rc7860_rd(F2PohJ1_rx3_a);
j_rx[2] = f2rc7860_rd(F2PohJ1_rx4_a);
j_rx[3] = f2rc7860_rd(F2PohJ1_rx5_a);
j_rx[4] = f2rc7860_rd(F2PohJ1_rx6_a);
j_rx[5] = f2rc7860_rd(F2PohJ1_rx7_a);
j_rx[6] = f2rc7860_rd(F2PohJ1_rx8_a);
j_rx[7] = f2rc7860_rd(F2PohJ1_rx9_a);
j_rx[8] = f2rc7860_rd(F2PohJ1_rx10_a);
j_rx[9] = f2rc7860_rd(F2PohJ1_rx11_a);
j_rx[10] = f2rc7860_rd(F2PohJ1_rx12_a);
j_rx[11] = f2rc7860_rd(F2PohJ1_rx13_a);
j_rx[12] = f2rc7860_rd(F2PohJ1_rx14_a);
j_rx[13] = f2rc7860_rd(F2PohJ1_rx15_a);
j_rx[14] = f2rc7860_rd(F2PohJ1_rx16_a);
return_value = 0;
}
else if (portid == 2){ //光分支7860B口
j_rx[0] = f2rc7860_rd(F2PohJ1_rx2_b);
j_rx[1] = f2rc7860_rd(F2PohJ1_rx3_b);
j_rx[2] = f2rc7860_rd(F2PohJ1_rx4_b);
j_rx[3] = f2rc7860_rd(F2PohJ1_rx5_b);
j_rx[4] = f2rc7860_rd(F2PohJ1_rx6_b);
j_rx[5] = f2rc7860_rd(F2PohJ1_rx7_b);
j_rx[6] = f2rc7860_rd(F2PohJ1_rx8_b);
j_rx[7] = f2rc7860_rd(F2PohJ1_rx9_b);
j_rx[8] = f2rc7860_rd(F2PohJ1_rx10_b);
j_rx[9] = f2rc7860_rd(F2PohJ1_rx11_b);
j_rx[10] = f2rc7860_rd(F2PohJ1_rx12_b);
j_rx[11] = f2rc7860_rd(F2PohJ1_rx13_b);
j_rx[12] = f2rc7860_rd(F2PohJ1_rx14_b);
j_rx[13] = f2rc7860_rd(F2PohJ1_rx15_b);
j_rx[14] = f2rc7860_rd(F2PohJ1_rx16_b);
return_value = 0;
}
else return_value = 2;
}
else if (boardid == 5){ //主光盘MCB
if (portid == 1){
j_rx[0] = PohJ1_rx2_a;
j_rx[1] = PohJ1_rx3_a;
j_rx[2] = PohJ1_rx4_a;
j_rx[3] = PohJ1_rx5_a;
j_rx[4] = PohJ1_rx6_a;
j_rx[5] = PohJ1_rx7_a;
j_rx[6] = PohJ1_rx8_a;
j_rx[7] = PohJ1_rx9_a;
j_rx[8] = PohJ1_rx10_a;
j_rx[9] = PohJ1_rx11_a;
j_rx[10] = PohJ1_rx12_a;
j_rx[11] = PohJ1_rx13_a;
j_rx[12] = PohJ1_rx14_a;
j_rx[13] = PohJ1_rx15_a;
j_rx[14] = PohJ1_rx16_a;
return_value = 0;
}
else if (portid == 2){
j_rx[0] = PohJ1_rx2_b;
j_rx[1] = PohJ1_rx3_b;
j_rx[2] = PohJ1_rx4_b;
j_rx[3] = PohJ1_rx5_b;
j_rx[4] = PohJ1_rx6_b;
j_rx[5] = PohJ1_rx7_b;
j_rx[6] = PohJ1_rx8_b;
j_rx[7] = PohJ1_rx9_b;
j_rx[8] = PohJ1_rx10_b;
j_rx[9] = PohJ1_rx11_b;
j_rx[10] = PohJ1_rx12_b;
j_rx[11] = PohJ1_rx13_b;
j_rx[12] = PohJ1_rx14_b;
j_rx[13] = PohJ1_rx15_b;
j_rx[14] = PohJ1_rx16_b;
return_value = 0;
}
else return_value = 2;
}
else return_value = 2;
break;
case 0x4A32:switch (portid){ //J2字节 得出Mapper中的支路号
case 1: outporth=0x01;
outportl=0x40;
break;
case 2: outporth=0x02;
outportl=0x40;
break;
case 3: outporth=0x03;
outportl=0x40;
break;
case 4: outporth=0x04;
outportl=0x40;
break;
case 5: outporth=0x09;
outportl=0x40;
break;
case 6: outporth=0x0A;
outportl=0x40;
break;
case 7: outporth=0x0B;
outportl=0x40;
break;
case 8: outporth=0x0C;
outportl=0x40;
break;
case 9: outporth=0x11;
outportl=0x40;
break;
case 10: outporth=0x12;
outportl=0x40;
break;
case 11: outporth=0x13;
outportl=0x40;
break;
case 12: outporth=0x14;
outportl=0x40;
break;
case 13: outporth=0x19;
outportl=0x40;
break;
case 14: outporth=0x1A;
outportl=0x40;
break;
case 15: outporth=0x1B;
outportl=0x40;
break;
case 16: outporth=0x1C;
outportl=0x40;
break;
case 17: outporth=0x21;
outportl=0x40;
break;
case 18: outporth=0x22;
outportl=0x40;
break;
case 19: outporth=0x23;
outportl=0x40;
break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -