mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
Treat uarts without a pin as non-existent
This commit is contained in:
parent
7b831f94ee
commit
b8e0d22d01
1 changed files with 11 additions and 1 deletions
|
@ -459,7 +459,17 @@ void serialInit(bool softserialEnabled, serialPortIdentifier_e serialPortToDisab
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((serialPortUsageList[index].identifier == SERIAL_PORT_SOFTSERIAL1
|
#ifndef SITL
|
||||||
|
else if (serialPortUsageList[index].identifier <= SERIAL_PORT_USART8) {
|
||||||
|
int resourceIndex = SERIAL_PORT_IDENTIFIER_TO_INDEX(serialPortUsageList[index].identifier);
|
||||||
|
if (!(serialPinConfig()->ioTagTx[resourceIndex] || serialPinConfig()->ioTagRx[resourceIndex])) {
|
||||||
|
serialPortUsageList[index].identifier = SERIAL_PORT_NONE;
|
||||||
|
serialPortCount--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
else if ((serialPortUsageList[index].identifier == SERIAL_PORT_SOFTSERIAL1
|
||||||
#ifdef USE_SOFTSERIAL1
|
#ifdef USE_SOFTSERIAL1
|
||||||
&& !(softserialEnabled && (serialPinConfig()->ioTagTx[RESOURCE_SOFT_OFFSET + SOFTSERIAL1] ||
|
&& !(softserialEnabled && (serialPinConfig()->ioTagTx[RESOURCE_SOFT_OFFSET + SOFTSERIAL1] ||
|
||||||
serialPinConfig()->ioTagRx[RESOURCE_SOFT_OFFSET + SOFTSERIAL1]))
|
serialPinConfig()->ioTagRx[RESOURCE_SOFT_OFFSET + SOFTSERIAL1]))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue