diff --git a/306-controller_interface.X/middleware/can_interface.c b/306-controller_interface.X/middleware/can_interface.c index ec598b9..ac2d631 100644 --- a/306-controller_interface.X/middleware/can_interface.c +++ b/306-controller_interface.X/middleware/can_interface.c @@ -74,9 +74,13 @@ bool CAN_processEvent(Event* ev) { CAN_4_BYTES tmpData; tmpData.full.bytes = data; - uint8_t idMsg = 0x0F && (tmpData.separate.byte0>>4); - uint8_t idRecipient = 0x0F && tmpData.separate.byte1; - uint8_t idSender = (tmpData.separate.byte1>>4); + uint8_t idMsg = tmpData.separate.byte0; + idMsg = idMsg >> 4; + idMsg = idMsg & 0xF; + uint8_t idRecipient = tmpData.separate.byte1; + idRecipient = idRecipient & 0xF; + uint8_t idSender = tmpData.separate.byte1; + idSender = idSender >> 4; me->receiveCan(idSender, idMsg, canData); }