mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Limit MSP ports to 2 for normal usage scenarios.
This commit is contained in:
parent
7453e98b3b
commit
0b353341f8
3 changed files with 13 additions and 4 deletions
|
@ -449,12 +449,18 @@ bool isSerialConfigValid(serialConfig_t *serialConfigToCheck)
|
|||
|
||||
uint8_t functionIndex;
|
||||
uint8_t cliPortCount = 0;
|
||||
uint8_t mspPortCount = 0;
|
||||
for (functionIndex = 0; functionIndex < SERIAL_PORT_COUNT; functionIndex++) {
|
||||
if (serialPortFunctions[functionIndex].scenario & FUNCTION_CLI) {
|
||||
if (++cliPortCount > 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (serialPortFunctions[functionIndex].scenario & FUNCTION_MSP) {
|
||||
if (++mspPortCount > MAX_MSP_PORT_COUNT) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue