stm32: Rework kconfig to use CONFIG_CANSERIAL for both can.c and fdcan.c

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-06-01 10:59:10 -04:00
parent 907b47b238
commit 63affd7006
2 changed files with 8 additions and 13 deletions

View File

@ -278,8 +278,6 @@ config SERIAL
bool
config CANSERIAL
bool
config FDCANSERIAL
bool
choice
prompt "Communication interface"
config STM32_USB_PA11_PA12
@ -348,13 +346,13 @@ choice
depends on HAVE_STM32_CANBUS
select CANSERIAL
config STM32_CANBUS_PB0_PB1
bool "CAN bus (on PB0/PB1)" if LOW_LEVEL_OPTIONS
bool "CAN bus (on PB0/PB1)"
depends on HAVE_STM32_FDCANBUS
select FDCANSERIAL
select CANSERIAL
endchoice
config CANBUS_FREQUENCY
int "CAN bus speed" if LOW_LEVEL_OPTIONS && (CANSERIAL || FDCANSERIAL)
int "CAN bus speed" if LOW_LEVEL_OPTIONS && CANSERIAL
default 500000
endif

View File

@ -3,7 +3,7 @@
# Setup the toolchain
CROSS_PREFIX=arm-none-eabi-
dirs-y += src/stm32 src/generic
dirs-y += src/stm32 src/generic lib/fast-hash
dirs-$(CONFIG_MACH_STM32F0) += lib/stm32f0
dirs-$(CONFIG_MACH_STM32F1) += lib/stm32f1
dirs-$(CONFIG_MACH_STM32F2) += lib/stm32f2
@ -59,15 +59,12 @@ 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
src-$(CONFIG_CANSERIAL) += stm32/can.c ../lib/fast-hash/fasthash.c
src-$(CONFIG_CANSERIAL) += generic/canbus.c
src-$(CONFIG_FDCANSERIAL) += stm32/fdcan.c ../lib/fast-hash/fasthash.c
src-$(CONFIG_FDCANSERIAL) += generic/canbus.c
canbus-src-y := generic/canbus.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)
src-$(CONFIG_HAVE_GPIO_HARD_PWM) += stm32/hard_pwm.c
dirs-$(CONFIG_CANSERIAL) += lib/fast-hash
dirs-$(CONFIG_FDCANSERIAL) += lib/fast-hash
# Binary output file rules
target-y += $(OUT)klipper.bin