1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

There was a little more fixed to do when telemetry was not eanbled.

Tested arm/disarm/arm/disarm with telemetry on and off, all working now.

See #155.
This commit is contained in:
Dominic Clifton 2014-11-08 01:11:10 +00:00
parent 2c8b3af88d
commit 2461973dd6
5 changed files with 40 additions and 4 deletions

View file

@ -561,6 +561,18 @@ static void openAllMSPSerialPorts(serialConfig_t *serialConfig)
UNUSED(serialPortFunctionList);
}
void mspReleasePortIfAllocated(serialPort_t *serialPort)
{
uint8_t portIndex;
for (portIndex = 0; portIndex < MAX_MSP_PORT_COUNT; portIndex++) {
mspPort_t *candidateMspPort = &mspPorts[portIndex++];
if (candidateMspPort->port == serialPort) {
endSerialPortFunction(serialPort, FUNCTION_MSP);
memset(candidateMspPort, 0, sizeof(mspPort_t));
}
}
}
void mspInit(serialConfig_t *serialConfig)
{
// calculate used boxes based on features and fill availableBoxes[] array