mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 04:45:24 +03:00
Trivial changes
- use inline functions for gpio (typesafe, no speed penalty) - fix sortSerialPortFunctions (original was IMO broken) - allow softserial port on sonar pin when FEATURE_SONAR is not enabled - minor style changes and comments
This commit is contained in:
parent
fd32ad6fcb
commit
e179218caf
5 changed files with 20 additions and 20 deletions
|
@ -1391,19 +1391,21 @@ void mspSetTelemetryPort(serialPort_t *serialPort)
|
|||
mspPort_t *matchedPort = NULL;
|
||||
|
||||
// find existing telemetry port
|
||||
for (portIndex = 0; portIndex < MAX_MSP_PORT_COUNT && !matchedPort; portIndex++) {
|
||||
for (portIndex = 0; portIndex < MAX_MSP_PORT_COUNT; portIndex++) {
|
||||
candidatePort = &mspPorts[portIndex];
|
||||
if (candidatePort->mspPortUsage == FOR_TELEMETRY) {
|
||||
matchedPort = candidatePort;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!matchedPort) {
|
||||
// find unused port
|
||||
for (portIndex = 0; portIndex < MAX_MSP_PORT_COUNT && !matchedPort; portIndex++) {
|
||||
for (portIndex = 0; portIndex < MAX_MSP_PORT_COUNT; portIndex++) {
|
||||
candidatePort = &mspPorts[portIndex];
|
||||
if (candidatePort->mspPortUsage == UNUSED_PORT) {
|
||||
matchedPort = candidatePort;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue