CAN: we need both Rx and Tx pins to be valid

This commit is contained in:
Andrey Gusakov 2023-11-19 15:06:35 +03:00 committed by rusefillc
parent dfbd44c705
commit 54274d8022
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ bool isValidCanRxPin(brain_pin_e pin) {
}
CANDriver* detectCanDevice(brain_pin_e pinRx, brain_pin_e pinTx) {
if (pinRx == Gpio::Unassigned && pinTx == Gpio::Unassigned) {
if (pinRx == Gpio::Unassigned || pinTx == Gpio::Unassigned) {
return nullptr;
}
#if STM32_CAN_USE_CAN1 || STM32_CAN_USE_FDCAN1