mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Merge pull request #2599 from mikeller/suppress_listing_of_softserials_without_resources
Suppress listing SOFTSERIAL ports if they don't have pins assigned.
This commit is contained in:
commit
9f60b69567
1 changed files with 10 additions and 8 deletions
|
@ -28,6 +28,8 @@
|
|||
#include "config/parameter_group.h"
|
||||
#include "config/parameter_group_ids.h"
|
||||
|
||||
#include "fc/config.h"
|
||||
|
||||
#include "drivers/system.h"
|
||||
#include "drivers/serial.h"
|
||||
#if defined(USE_SOFTSERIAL1) || defined(USE_SOFTSERIAL2)
|
||||
|
@ -436,18 +438,18 @@ void serialInit(bool softserialEnabled, serialPortIdentifier_e serialPortToDisab
|
|||
serialPortCount--;
|
||||
}
|
||||
}
|
||||
if (!softserialEnabled) {
|
||||
if (0
|
||||
|
||||
if ((serialPortUsageList[index].identifier == SERIAL_PORT_SOFTSERIAL1
|
||||
#ifdef USE_SOFTSERIAL1
|
||||
|| serialPortUsageList[index].identifier == SERIAL_PORT_SOFTSERIAL1
|
||||
&& !(softserialEnabled && serialPinConfig()->ioTagTx[RESOURCE_SOFT_OFFSET + SOFTSERIAL1])
|
||||
#endif
|
||||
) || (serialPortUsageList[index].identifier == SERIAL_PORT_SOFTSERIAL2
|
||||
#ifdef USE_SOFTSERIAL2
|
||||
|| serialPortUsageList[index].identifier == SERIAL_PORT_SOFTSERIAL2
|
||||
&& !(softserialEnabled && serialPinConfig()->ioTagTx[RESOURCE_SOFT_OFFSET + SOFTSERIAL2])
|
||||
#endif
|
||||
) {
|
||||
serialPortUsageList[index].identifier = SERIAL_PORT_NONE;
|
||||
serialPortCount--;
|
||||
}
|
||||
)) {
|
||||
serialPortUsageList[index].identifier = SERIAL_PORT_NONE;
|
||||
serialPortCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue