Commit 696970f1 authored by 何锐's avatar 何锐

feat:写入UID不进boot

parent 868026ab
......@@ -544,37 +544,37 @@ void Can_Set_Buff_786(uint8_t CopyData [])
switch (UIDStep)
{
case 0:
for(uint8_t i = 0;i < 8;i++)
{
pCANMsg->Msg[i] = Data_786_5[i];
}
// for(uint8_t i = 0;i < 8;i++)
// {
// pCANMsg->Msg[i] = Data_786_5[i];
// }
UIDStep++;
break;
case 1:
for(uint8_t i = 0;i < 8;i++)
{
pCANMsg->Msg[i] = Data_786_6[i];
}
// for(uint8_t i = 0;i < 8;i++)
// {
// pCANMsg->Msg[i] = Data_786_6[i];
// }
UIDStep++;
break;
case 2:
if(UIDGetstep == 1)
{
Data_786_7[0] = 0x06;
Data_786_7[1] = 0x27;
Data_786_7[2] = 0x06;
Data_786_7[3] = seedresult[0];
Data_786_7[4] = seedresult[1];
Data_786_7[5] = seedresult[2];
Data_786_7[6] = seedresult[3];
Data_786_7[7] = 0xAA;
for(uint8_t i = 0;i < 8;i++)
{
pCANMsg->Msg[i] = Data_786_7[i];
}
// if(UIDGetstep == 1)
// {
// Data_786_7[0] = 0x06;
// Data_786_7[1] = 0x27;
// Data_786_7[2] = 0x06;
// Data_786_7[3] = seedresult[0];
// Data_786_7[4] = seedresult[1];
// Data_786_7[5] = seedresult[2];
// Data_786_7[6] = seedresult[3];
// Data_786_7[7] = 0xAA;
// for(uint8_t i = 0;i < 8;i++)
// {
// pCANMsg->Msg[i] = Data_786_7[i];
// }
UIDStep++;
UIDGetstep = 2;
}
// }
break;
case 3:
for(uint8_t i = 0;i < 8;i++)
......
......@@ -946,16 +946,16 @@ void RSCAN0_CH4_Receive(CAN_Frame_st_t *pstCANFrame)
u8get786msg[7] = pstCANFrame->unCANData.u8CANData[7];
if(UIDGetstep == 0)
{
if(u8get786msg[1] == 0x67 && u8get786msg[2] == 0x05)
{
memcpy(seednum,&u8get786msg[3],4);
key_value = CalculateKey(seednum);
seedresult[0] = (uint8_t)key_value ;
seedresult[1] = (uint8_t)(key_value >> 8);
seedresult[2] = (uint8_t)(key_value >> 16);
seedresult[3] = (uint8_t)(key_value >> 24);
UIDGetstep = 1;
}
// if(u8get786msg[1] == 0x67 && u8get786msg[2] == 0x05)
// {
// memcpy(seednum,&u8get786msg[3],4);
// key_value = CalculateKey(seednum);
// seedresult[0] = (uint8_t)key_value ;
// seedresult[1] = (uint8_t)(key_value >> 8);
// seedresult[2] = (uint8_t)(key_value >> 16);
// seedresult[3] = (uint8_t)(key_value >> 24);
// UIDGetstep = 1;
// }
}
else if(UIDGetstep == 2)
{
......@@ -966,17 +966,10 @@ void RSCAN0_CH4_Receive(CAN_Frame_st_t *pstCANFrame)
}
else if(UIDGetstep == 4)
{
if(u8get786msg[3] == 0x78)
{
UIDGetstep = 5;
}
}
else if(UIDGetstep == 5)
{
if((u8get786msg[1] == 0x6E) && (u8get786msg[3] == 0x88))
if(u8get786msg[1] == 0x6E)
{
UIDGetstep = 6;
uidWrite = 0;
UIDGetstep = 5;
General_Number_Disp(writesuccess, 3, 200); //写入成功
}
}
......
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