mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +03:00
Merge pull request #1140 from martinbudden/bf_msp_streambuf_prep
Rename serial MSP functions in prep for converting to using streambuf
This commit is contained in:
commit
73d928d79f
6 changed files with 15 additions and 15 deletions
|
@ -650,7 +650,7 @@ void blackboxDeviceClose(void)
|
|||
* of time to shut down asynchronously, we're the only ones that know when to call it.
|
||||
*/
|
||||
if (blackboxPortSharing == PORTSHARING_SHARED) {
|
||||
mspAllocateSerialPorts(&masterConfig.serialConfig);
|
||||
mspSerialAllocatePorts(&masterConfig.serialConfig);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -424,7 +424,7 @@ void mwDisarm(void)
|
|||
void releaseSharedTelemetryPorts(void) {
|
||||
serialPort_t *sharedPort = findSharedSerialPort(TELEMETRY_FUNCTION_MASK, FUNCTION_MSP);
|
||||
while (sharedPort) {
|
||||
mspReleasePortIfAllocated(sharedPort);
|
||||
mspSerialReleasePortIfAllocated(sharedPort);
|
||||
sharedPort = findNextSharedSerialPort(TELEMETRY_FUNCTION_MASK, FUNCTION_MSP);
|
||||
}
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ void mwArm(void)
|
|||
if (feature(FEATURE_BLACKBOX)) {
|
||||
serialPort_t *sharedBlackboxAndMspPort = findSharedSerialPort(FUNCTION_BLACKBOX, FUNCTION_MSP);
|
||||
if (sharedBlackboxAndMspPort) {
|
||||
mspReleasePortIfAllocated(sharedBlackboxAndMspPort);
|
||||
mspSerialReleasePortIfAllocated(sharedBlackboxAndMspPort);
|
||||
}
|
||||
startBlackbox();
|
||||
}
|
||||
|
@ -718,7 +718,7 @@ void processRx(void)
|
|||
} else {
|
||||
// the telemetry state must be checked immediately so that shared serial ports are released.
|
||||
telemetryCheckState();
|
||||
mspAllocateSerialPorts(&masterConfig.serialConfig);
|
||||
mspSerialAllocatePorts(&masterConfig.serialConfig);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -433,7 +433,7 @@ void handleSerial(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
mspProcess();
|
||||
mspSerialProcess();
|
||||
}
|
||||
|
||||
void waitForSerialPortToFinishTransmitting(serialPort_t *serialPort)
|
||||
|
|
|
@ -429,7 +429,7 @@ static void resetMspPort(mspPort_t *mspPortToReset, serialPort_t *serialPort)
|
|||
mspPortToReset->port = serialPort;
|
||||
}
|
||||
|
||||
void mspAllocateSerialPorts(serialConfig_t *serialConfig)
|
||||
void mspSerialAllocatePorts(serialConfig_t *serialConfig)
|
||||
{
|
||||
UNUSED(serialConfig);
|
||||
|
||||
|
@ -456,7 +456,7 @@ void mspAllocateSerialPorts(serialConfig_t *serialConfig)
|
|||
}
|
||||
}
|
||||
|
||||
void mspReleasePortIfAllocated(serialPort_t *serialPort)
|
||||
void mspSerialReleasePortIfAllocated(serialPort_t *serialPort)
|
||||
{
|
||||
uint8_t portIndex;
|
||||
for (portIndex = 0; portIndex < MAX_MSP_PORT_COUNT; portIndex++) {
|
||||
|
@ -468,7 +468,7 @@ void mspReleasePortIfAllocated(serialPort_t *serialPort)
|
|||
}
|
||||
}
|
||||
|
||||
void mspInit(serialConfig_t *serialConfig)
|
||||
void mspSerialInit(serialConfig_t *serialConfig)
|
||||
{
|
||||
// calculate used boxes based on features and fill availableBoxes[] array
|
||||
memset(activeBoxIds, 0xFF, sizeof(activeBoxIds));
|
||||
|
@ -567,7 +567,7 @@ void mspInit(serialConfig_t *serialConfig)
|
|||
#endif
|
||||
|
||||
memset(mspPorts, 0x00, sizeof(mspPorts));
|
||||
mspAllocateSerialPorts(serialConfig);
|
||||
mspSerialAllocatePorts(serialConfig);
|
||||
}
|
||||
|
||||
#define IS_ENABLED(mask) (mask == 0 ? 0 : 1)
|
||||
|
@ -1961,7 +1961,7 @@ STATIC_UNIT_TESTED void setCurrentPort(mspPort_t *port)
|
|||
mspSerialPort = currentPort->port;
|
||||
}
|
||||
|
||||
void mspProcess(void)
|
||||
void mspSerialProcess(void)
|
||||
{
|
||||
uint8_t portIndex;
|
||||
mspPort_t *candidatePort;
|
||||
|
|
|
@ -44,8 +44,8 @@ typedef struct mspPort_s {
|
|||
} mspPort_t;
|
||||
|
||||
struct serialConfig_s;
|
||||
void mspInit(struct serialConfig_s *serialConfig);
|
||||
void mspProcess(void);
|
||||
void mspAllocateSerialPorts(struct serialConfig_s *serialConfig);
|
||||
void mspSerialInit(struct serialConfig_s *serialConfig);
|
||||
void mspSerialProcess(void);
|
||||
void mspSerialAllocatePorts(struct serialConfig_s *serialConfig);
|
||||
struct serialPort_s;
|
||||
void mspReleasePortIfAllocated(struct serialPort_s *serialPort);
|
||||
void mspSerialReleasePortIfAllocated(struct serialPort_s *serialPort);
|
||||
|
|
|
@ -505,7 +505,7 @@ void init(void)
|
|||
|
||||
imuInit();
|
||||
|
||||
mspInit(&masterConfig.serialConfig);
|
||||
mspSerialInit(&masterConfig.serialConfig);
|
||||
|
||||
#ifdef USE_CLI
|
||||
cliInit(&masterConfig.serialConfig);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue