fix can byte order

This commit is contained in:
Rémi Heredero 2023-08-28 09:04:52 +02:00
parent 2b31ef5c06
commit 4d513277b7

View File

@ -146,13 +146,13 @@ void CAN_newMsg() {
CAN_receive(&canMsg); CAN_receive(&canMsg);
data = canMsg.frame.id; data = canMsg.frame.id;
data = data<<12; data = data<<12;
data = data | canMsg.frame.data0; data = data | canMsg.frame.data3;
data = data<<8;
data = data | canMsg.frame.data1;
data = data<<8; data = data<<8;
data = data | canMsg.frame.data2; data = data | canMsg.frame.data2;
data = data<<8; data = data<<8;
data = data | canMsg.frame.data3; data = data | canMsg.frame.data1;
data = data<<8;
data = data | canMsg.frame.data0;
POST(&CAN_myself, &CAN_processEvent, evCAnewMsg, 0, data); POST(&CAN_myself, &CAN_processEvent, evCAnewMsg, 0, data);
} }