From b8ccdfb7d881d1f840612851c8a806a3e3fb70b5 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sat, 6 Nov 2021 22:22:54 -0400 Subject: [PATCH] todo: smarter online change of CAN settings, kill isCanEnabled with fire --- firmware/hw_layer/drivers/can/can_hw.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/firmware/hw_layer/drivers/can/can_hw.cpp b/firmware/hw_layer/drivers/can/can_hw.cpp index f11f64a777..21f395244c 100644 --- a/firmware/hw_layer/drivers/can/can_hw.cpp +++ b/firmware/hw_layer/drivers/can/can_hw.cpp @@ -210,11 +210,19 @@ void startCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // Validate pins if (!isValidCanTxPin(CONFIG(canTxPin))) { + if (CONFIG(canTxPin) == GPIO_UNASSIGNED) { + // todo: smarter online change of settings, kill isCanEnabled with fire + return; + } firmwareError(CUSTOM_OBD_70, "invalid CAN TX %s", hwPortname(CONFIG(canTxPin))); return; } if (!isValidCanRxPin(CONFIG(canRxPin))) { + if (CONFIG(canRxPin) == GPIO_UNASSIGNED) { + // todo: smarter online change of settings, kill isCanEnabled with fire + return; + } firmwareError(CUSTOM_OBD_70, "invalid CAN RX %s", hwPortname(CONFIG(canRxPin))); return; }