Commit 92c49461 authored by baizhengyuan's avatar baizhengyuan

🐞 fix:五码合一检验

parent d0ae6c86
......@@ -1717,31 +1717,19 @@ void Can_Send_0x714(void)
return;
}
case 12:
// Gen_TimeDelay(20000, 50);
Gen_TimeDelay(10000, 50);
zhenduansendStep++;
// if(CAN_MSG_Read(11,0) == 0x03 && CAN_MSG_Read(11,1) == 0x7F && CAN_MSG_Read(11,1) == 0x2E)
// {
// zhenduansendStep++;
// }
// else
// {
// return;
// }
case 13:
data20[0] = 0x07;
data20[1] = 0x2E;
data20[2] = 0xF1;
data20[3] = 0x99;
data20[4] = (barcode_Msg[20] - 0x30) >> 8 | (barcode_Msg[21] - 0x30);
data20[5] = (barcode_Msg[22] - 0x30) >> 8 | (barcode_Msg[23] - 0x30);
data20[6] = (barcode_Msg[24] - 0x30) >> 8 | (barcode_Msg[25] - 0x30);
data20[7] = (barcode_Msg[26] - 0x30) >> 8 | (barcode_Msg[27] - 0x30);
data20[4] = (barcode_Msg[20] - 0x30) >> 4 | (barcode_Msg[21] - 0x30);
data20[5] = (barcode_Msg[22] - 0x30) >> 4 | (barcode_Msg[23] - 0x30);
data20[6] = (barcode_Msg[24] - 0x30) >> 4 | (barcode_Msg[25] - 0x30);
data20[7] = (barcode_Msg[26] - 0x30) >> 4 | (barcode_Msg[27] - 0x30);
init_CAN_Frame(&m_msg20, 0x714, 8, 0, data20);
can_mid(m_msg20);
Gen_TimeDelay(10000, 50);
zhenduansendStep++;
case 14:
case 13:
Gen_TimeDelay(10000, 50);
if(CAN_MSG_Read(11,0) == 0x03 && CAN_MSG_Read(11,1) == 0x6E && CAN_MSG_Read(11,3) == 0x99)
{
......@@ -1751,7 +1739,7 @@ void Can_Send_0x714(void)
{
return;
}
case 15:
case 14:
data20[0] = 0x10;
data20[1] = 0x09;
data20[2] = 0x2E;
......@@ -1766,7 +1754,7 @@ void Can_Send_0x714(void)
zhenduansendStep++;
case 16:
case 15:
data20[0] = 0x21;
data20[1] = barcode_Msg[31] - 0x30;
data20[2] = barcode_Msg[32] - 0x30;
......@@ -1779,7 +1767,7 @@ void Can_Send_0x714(void)
can_mid(m_msg20);
Gen_TimeDelay(10000, 50);
zhenduansendStep++;
case 17:
case 16:
Gen_TimeDelay(10000, 50);
if(CAN_MSG_Read(11,0) == 0x03 && CAN_MSG_Read(11,1) == 0x6E && CAN_MSG_Read(11,3) == 0x8C)
{
......@@ -1790,7 +1778,7 @@ void Can_Send_0x714(void)
return;
}
case 18:
case 17:
LINE_OUT_NEG_01 = 0;
LINE_OUT_NEG_02 = 0;
LINE_OUT_NEG_03 = 0;
......@@ -1879,6 +1867,7 @@ void Can_Send_0x714_CHECK(void)
data20[7] = 0xAA;
init_CAN_Frame(&m_msg20, 0x714, 8, 0, data20); //诊断
can_mid(m_msg20);
Gen_TimeDelay(10000, 50);
zhenduansendStep++;
break;
case 1:
......@@ -1898,11 +1887,16 @@ void Can_Send_0x714_CHECK(void)
data20[7] = 0xAA;
init_CAN_Frame(&m_msg20, 0x714, 8, 0, data20); //诊断
can_mid(m_msg20);
//Gen_TimeDelay(10000, 50);
zhenduansendStep++;
break;
case 3:
if(CAN_MSG_Read(11,0) == 0x21)
{
// uint8_t asd = 0;
// uint8_t bzy = 0;
// asd = CAN_MSG_Read(11,0);
// bzy = CAN_MSG_Read(11,1);
// if(CAN_MSG_Read(11,0) == 0x21)
// {
get_num_buf[3] = CAN_MSG_Read(11,1);
get_num_buf[4] = CAN_MSG_Read(11,2);
get_num_buf[5] = CAN_MSG_Read(11,3);
......@@ -1911,11 +1905,11 @@ void Can_Send_0x714_CHECK(void)
get_num_buf[8] = CAN_MSG_Read(11,6);
get_num_buf[9] = CAN_MSG_Read(11,7);
zhenduansendStep++;
}
else
{
return;
}
// }
// else
// {
// return;
// }
case 4:
if(CAN_MSG_Read(11,0) == 0x22)
{
......@@ -1933,20 +1927,102 @@ void Can_Send_0x714_CHECK(void)
return;
}
case 5:
data20[0] = 0x03;
data20[1] = 0x22;
data20[2] = 0xF1;
data20[3] = 0x8A;
data20[4] = 0xAA;
data20[5] = 0xAA;
data20[6] = 0xAA;
data20[7] = 0xAA;
init_CAN_Frame(&m_msg20, 0x714, 8, 0, data20); //诊断
can_mid(m_msg20);
Gen_TimeDelay(10000, 50);
zhenduansendStep++;
zhenduansendStep = 0;
case 6:
get_num_buf[17] = CAN_MSG_Read(11,5);
get_num_buf[18] = CAN_MSG_Read(11,6);
get_num_buf[19] = CAN_MSG_Read(11,7);
zhenduansendStep++;
case 7:
data20[0] = 0x30;
data20[1] = 0x00;
data20[2] = 0x00;
data20[3] = 0xAA;
data20[4] = 0xAA;
data20[5] = 0xAA;
data20[6] = 0xAA;
data20[7] = 0xAA;
init_CAN_Frame(&m_msg20, 0x714, 8, 0, data20); //诊断
can_mid(m_msg20);
Gen_TimeDelay(10000, 50);
zhenduansendStep++;
break;
case 8:
if(CAN_MSG_Read(11,0) == 0x21)
{
get_num_buf[20] = CAN_MSG_Read(11,1);
get_num_buf[21] = CAN_MSG_Read(11,2);
get_num_buf[22] = CAN_MSG_Read(11,3);
get_num_buf[23] = CAN_MSG_Read(11,4);
get_num_buf[25] = CAN_MSG_Read(11,5);
get_num_buf[26] = CAN_MSG_Read(11,6);
get_num_buf[27] = CAN_MSG_Read(11,7);
zhenduansendStep++;
}
else
{
return;
}
case 9:
data20[0] = 0x03;
data20[1] = 0x22;
data20[2] = 0xF1;
data20[3] = 0x99;
data20[4] = 0xAA;
data20[5] = 0xAA;
data20[6] = 0xAA;
data20[7] = 0xAA;
init_CAN_Frame(&m_msg20, 0x714, 8, 0, data20); //诊断
can_mid(m_msg20);
Gen_TimeDelay(10000, 50);
zhenduansendStep++;
case 10:
if(CAN_MSG_Read(11,0) == 0x07 && CAN_MSG_Read(11,1) == 0x62)
{
get_num_buf[28] = CAN_MSG_Read(11,4);
get_num_buf[29] = CAN_MSG_Read(11,5);
get_num_buf[30] = CAN_MSG_Read(11,6);
get_num_buf[31] = CAN_MSG_Read(11,7);
zhenduansendStep++;
}
else
{
return;
}
case 15:
data20[0] = 0x02;
data20[1] = 0x27;
data20[2] = 0x01;
case 11:
data20[0] = 0x03;
data20[1] = 0x22;
data20[2] = 0xF1;
data20[3] = 0x8C;
data20[4] = 0xAA;
data20[5] = 0xAA;
data20[6] = 0xAA;
data20[7] = 0xAA;
init_CAN_Frame(&m_msg20, 0x714, 8, 0, data20); //诊断
can_mid(m_msg20);
Gen_TimeDelay(10000, 50);
zhenduansendStep++;
case 12:
get_num_buf[17] = CAN_MSG_Read(11,5);
get_num_buf[18] = CAN_MSG_Read(11,6);
get_num_buf[19] = CAN_MSG_Read(11,7);
zhenduansendStep++;
case 13:
data20[0] = 0x30;
data20[1] = 0x00;
data20[2] = 0x00;
data20[3] = 0xAA;
data20[4] = 0xAA;
data20[5] = 0xAA;
......@@ -1954,12 +2030,37 @@ void Can_Send_0x714_CHECK(void)
data20[7] = 0xAA;
init_CAN_Frame(&m_msg20, 0x714, 8, 0, data20); //诊断
can_mid(m_msg20);
Gen_TimeDelay(10000, 50);
zhenduansendStep++;
break;
case 14:
if(CAN_MSG_Read(11,0) == 0x21)
{
get_num_buf[20] = CAN_MSG_Read(11,1);
get_num_buf[21] = CAN_MSG_Read(11,2);
get_num_buf[22] = CAN_MSG_Read(11,3);
get_num_buf[23] = CAN_MSG_Read(11,4);
get_num_buf[25] = CAN_MSG_Read(11,5);
get_num_buf[26] = CAN_MSG_Read(11,6);
get_num_buf[27] = CAN_MSG_Read(11,7);
zhenduansendStep++;
}
else
{
return;
}
memcpy(get_num_buf,BarCode+7,34 );
comparestart = 1;
zhenduanflag = 3;
case 15:
LINE_OUT_NEG_01 = 0;
LINE_OUT_NEG_02 = 0;
LINE_OUT_NEG_03 = 0;
LINE_OUT_NEG_04 = 0;
zhenduansendStep = 0;
// comparestart = 1;
// zhenduanflag = 3;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment