mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-22 07:45:29 +03:00
Avoids initialisation of UART2 when PWM or PPM RX is used
This commit is contained in:
parent
6dcefedde6
commit
5c1c64fc41
4 changed files with 14 additions and 5 deletions
|
@ -364,7 +364,7 @@ void closeSerialPort(serialPort_t *serialPort) {
|
|||
serialPortUsage->serialPort = NULL;
|
||||
}
|
||||
|
||||
void serialInit(serialConfig_t *initialSerialConfig, bool softserialEnabled)
|
||||
void serialInit(serialConfig_t *initialSerialConfig, bool softserialEnabled, serialPortIdentifier_e serialPortToDisable)
|
||||
{
|
||||
uint8_t index;
|
||||
|
||||
|
@ -376,6 +376,12 @@ void serialInit(serialConfig_t *initialSerialConfig, bool softserialEnabled)
|
|||
for (index = 0; index < SERIAL_PORT_COUNT; index++) {
|
||||
serialPortUsageList[index].identifier = serialPortIdentifiers[index];
|
||||
|
||||
if (serialPortToDisable != SERIAL_PORT_NONE) {
|
||||
if (serialPortUsageList[index].identifier == serialPortToDisable) {
|
||||
serialPortUsageList[index].identifier = SERIAL_PORT_NONE;
|
||||
serialPortCount--;
|
||||
}
|
||||
}
|
||||
if (!softserialEnabled) {
|
||||
if (0
|
||||
#ifdef USE_SOFTSERIAL1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue