aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2022-06-11 19:37:30 -0400
committerKevin O'Connor <kevin@koconnor.net>2022-06-27 10:50:23 -0400
commitc8cc98ce5dce3771cf2728eee7b1bdb026504f75 (patch)
tree9a381181998d1a33c39b2c9c16697c5a9e038f90 /src/stm32
parent11828387d93f1f68107858d98fc81e2e29b5edf6 (diff)
downloadkutter-c8cc98ce5dce3771cf2728eee7b1bdb026504f75.tar.gz
kutter-c8cc98ce5dce3771cf2728eee7b1bdb026504f75.tar.xz
kutter-c8cc98ce5dce3771cf2728eee7b1bdb026504f75.zip
canserial: Rename canbus.c to canserial.c
Rename the canbus.c code to canserial.c and introduce new wrapper functions in canbus.c that connect the low-level canbus hardware code to the high-level canserial.c code. This is in preparation for adding "usb to canbus bridge mode". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32')
-rw-r--r--src/stm32/Makefile4
-rw-r--r--src/stm32/can.c1
-rw-r--r--src/stm32/chipid.c6
-rwxr-xr-xsrc/stm32/fdcan.c1
4 files changed, 7 insertions, 5 deletions
diff --git a/src/stm32/Makefile b/src/stm32/Makefile
index fa662f91..2fbf7549 100644
--- a/src/stm32/Makefile
+++ b/src/stm32/Makefile
@@ -59,10 +59,10 @@ serial-src-$(CONFIG_MACH_STM32F0) := stm32/stm32f0_serial.c
serial-src-$(CONFIG_MACH_STM32G0) := stm32/stm32f0_serial.c
serial-src-$(CONFIG_MACH_STM32H7) := stm32/stm32h7_serial.c
src-$(CONFIG_SERIAL) += $(serial-src-y) generic/serial_irq.c
-canbus-src-y := generic/canbus.c ../lib/fast-hash/fasthash.c
+canbus-src-y := generic/canserial.c ../lib/fast-hash/fasthash.c
canbus-src-$(CONFIG_HAVE_STM32_CANBUS) += stm32/can.c
canbus-src-$(CONFIG_HAVE_STM32_FDCANBUS) += stm32/fdcan.c
-src-$(CONFIG_CANSERIAL) += $(canbus-src-y) stm32/chipid.c
+src-$(CONFIG_CANSERIAL) += $(canbus-src-y) generic/canbus.c stm32/chipid.c
src-$(CONFIG_HAVE_GPIO_HARD_PWM) += stm32/hard_pwm.c
# Binary output file rules
diff --git a/src/stm32/can.c b/src/stm32/can.c
index 6e50cea9..427a7855 100644
--- a/src/stm32/can.c
+++ b/src/stm32/can.c
@@ -12,6 +12,7 @@
#include "command.h" // DECL_CONSTANT_STR
#include "generic/armcm_boot.h" // armcm_enable_irq
#include "generic/canbus.h" // canbus_notify_tx
+#include "generic/canserial.h" // CANBUS_ID_ADMIN
#include "internal.h" // enable_pclock
#include "sched.h" // DECL_INIT
diff --git a/src/stm32/chipid.c b/src/stm32/chipid.c
index 03517739..e30563cd 100644
--- a/src/stm32/chipid.c
+++ b/src/stm32/chipid.c
@@ -4,7 +4,7 @@
//
// This file may be distributed under the terms of the GNU GPLv3 license.
-#include "generic/canbus.h" // canbus_set_uuid
+#include "generic/canserial.h" // canserial_set_uuid
#include "generic/usb_cdc.h" // usb_fill_serial
#include "generic/usbstd.h" // usb_string_descriptor
#include "internal.h" // UID_BASE
@@ -29,7 +29,7 @@ chipid_init(void)
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);
+ if (CONFIG_CANBUS)
+ canserial_set_uuid((void*)UID_BASE, CHIP_UID_LEN);
}
DECL_INIT(chipid_init);
diff --git a/src/stm32/fdcan.c b/src/stm32/fdcan.c
index 3af9ffa8..c142420e 100755
--- a/src/stm32/fdcan.c
+++ b/src/stm32/fdcan.c
@@ -12,6 +12,7 @@
#include "command.h" // DECL_CONSTANT_STR
#include "generic/armcm_boot.h" // armcm_enable_irq
#include "generic/canbus.h" // canbus_notify_tx
+#include "generic/canserial.h" // CANBUS_ID_ADMIN
#include "generic/serial_irq.h" // serial_rx_byte
#include "internal.h" // enable_pclock
#include "sched.h" // DECL_INIT