From 35d28e880d1f4e0ae67fa7a7403849f10a052cba Mon Sep 17 00:00:00 2001 From: bondus Date: Mon, 10 Aug 2020 03:07:59 +0200 Subject: stm32: Improvements to CAN bus ID generation. And added a small fast hash library (#3165) Improved CAM bus ID generation, there were issues with ID collisions. Added a small fast hash library. Signed-off-by: Pontus Borg --- src/stm32/can.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/stm32/can.c') diff --git a/src/stm32/can.c b/src/stm32/can.c index 7e3d75f1..d0e84908 100644 --- a/src/stm32/can.c +++ b/src/stm32/can.c @@ -15,6 +15,7 @@ #include "sched.h" // DECL_INIT #include #include "can.h" +#include #if (CONFIG_CAN_PINS_PA11_PA12) DECL_CONSTANT_STR("RESERVE_PINS_CAN", "PA11,PA12"); @@ -151,10 +152,8 @@ static void can_transmit(uint32_t id, uint32_t dlc, uint8_t *pkt) // Convert Unique 96-bit value into 48 bit representation static void pack_uuid(uint8_t* u) { - for(int i=0; i