From fc7838855f886383917076cee87b13938d8bbe40 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 12 Jun 2022 11:55:46 -0400 Subject: canbus: Move canbus uuid calculation to canbus.c Move the uuid hash calculation to canbus.c and call canbus_set_uuid() from src/stm32/chipid.c . This simplifies the low-level canbus hardware code. Signed-off-by: Kevin O'Connor --- src/stm32/chipid.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/stm32/chipid.c') diff --git a/src/stm32/chipid.c b/src/stm32/chipid.c index 73e27503..03517739 100644 --- a/src/stm32/chipid.c +++ b/src/stm32/chipid.c @@ -4,6 +4,7 @@ // // This file may be distributed under the terms of the GNU GPLv3 license. +#include "generic/canbus.h" // canbus_set_uuid #include "generic/usb_cdc.h" // usb_fill_serial #include "generic/usbstd.h" // usb_string_descriptor #include "internal.h" // UID_BASE @@ -25,9 +26,10 @@ usbserial_get_serialid(void) void chipid_init(void) { - if (!CONFIG_USB_SERIAL_NUMBER_CHIPID) - return; - usb_fill_serial(&cdc_chipid.desc, ARRAY_SIZE(cdc_chipid.data) - , (void*)UID_BASE); + if (CONFIG_USB_SERIAL_NUMBER_CHIPID) + usb_fill_serial(&cdc_chipid.desc, ARRAY_SIZE(cdc_chipid.data) + , (void*)UID_BASE); + if (CONFIG_CANSERIAL) + canbus_set_uuid((void*)UID_BASE, CHIP_UID_LEN); } DECL_INIT(chipid_init); -- cgit v1.2.3-70-g09d2