diff --git a/306-controller_interface.X/middleware/can_interface.c b/306-controller_interface.X/middleware/can_interface.c index 6c893fd..ab667e2 100644 --- a/306-controller_interface.X/middleware/can_interface.c +++ b/306-controller_interface.X/middleware/can_interface.c @@ -34,9 +34,7 @@ typedef union { uint8_t byte2; uint8_t byte3; } separate; - struct { - uint32_t bytes; - } full; + uint32_t full; } CAN_4_BYTES; void CAN_init(){ @@ -55,6 +53,7 @@ bool CAN_processEvent(Event* ev) { evIDT evid = Event_getId(ev); uint64_t data = Event_getData(ev); + CAN_4_BYTES tmpData; switch (me->state) { // onState @@ -72,8 +71,7 @@ bool CAN_processEvent(Event* ev) { uint32_t canData = (uint32_t) data; data = data>>32; - CAN_4_BYTES tmpData; - tmpData.full.bytes = data; + tmpData.full = data; uint8_t idMsg = tmpData.separate.byte0; idMsg = idMsg >> 4; idMsg = idMsg & 0xF;