From f350338642b3cf71cc6f61ca5014dc36a7e72a4c Mon Sep 17 00:00:00 2001 From: rusefillc Date: Wed, 22 Dec 2021 20:43:08 -0500 Subject: [PATCH] Second CAN #3687 --- firmware/hw_layer/ports/stm32/stm32_common.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firmware/hw_layer/ports/stm32/stm32_common.cpp b/firmware/hw_layer/ports/stm32/stm32_common.cpp index 3bb4557b12..d4ae72783a 100644 --- a/firmware/hw_layer/ports/stm32/stm32_common.cpp +++ b/firmware/hw_layer/ports/stm32/stm32_common.cpp @@ -779,6 +779,9 @@ bool isValidCanRxPin(brain_pin_e pin) { } CANDriver* detectCanDeviceImpl(brain_pin_e pinRx, brain_pin_e pinTx) { + if (pinRx == GPIO_UNASSIGNED && pinTx == GPIO_UNASSIGNED) { + return nullptr; + } #if STM32_CAN_USE_CAN1 || STM32_CAN_USE_FDCAN1 if (isValidCan1RxPin(pinRx) && isValidCan1TxPin(pinTx)) return &CAND1;