1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-27 02:05:31 +03:00

Merge pull request #10490 from etracer65/msp_serial_push_fix

Fix mspSerialPush() selected serial port logic
This commit is contained in:
Michael Keller 2021-02-14 15:31:31 +13:00 committed by GitHub
commit 5506a0eb77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View file

@ -91,7 +91,8 @@ typedef enum {
SERIAL_PORT_USB_VCP = 20, SERIAL_PORT_USB_VCP = 20,
SERIAL_PORT_SOFTSERIAL1 = 30, SERIAL_PORT_SOFTSERIAL1 = 30,
SERIAL_PORT_SOFTSERIAL2, SERIAL_PORT_SOFTSERIAL2,
SERIAL_PORT_IDENTIFIER_MAX = SERIAL_PORT_SOFTSERIAL2 SERIAL_PORT_IDENTIFIER_MAX = SERIAL_PORT_SOFTSERIAL2,
SERIAL_PORT_ALL = 255,
} serialPortIdentifier_e; } serialPortIdentifier_e;
extern const serialPortIdentifier_e serialPortIdentifiers[SERIAL_PORT_COUNT]; extern const serialPortIdentifier_e serialPortIdentifiers[SERIAL_PORT_COUNT];

View file

@ -566,7 +566,7 @@ int mspSerialPush(serialPortIdentifier_e port, uint8_t cmd, uint8_t *data, int d
#ifndef USE_MSP_PUSH_OVER_VCP #ifndef USE_MSP_PUSH_OVER_VCP
|| mspPort->port->identifier == SERIAL_PORT_USB_VCP || mspPort->port->identifier == SERIAL_PORT_USB_VCP
#endif #endif
|| (port != SERIAL_PORT_NONE && mspPort->port->identifier != port)) { || (port != SERIAL_PORT_ALL && mspPort->port->identifier != port)) {
continue; continue;
} }

View file

@ -279,7 +279,7 @@ void currentMeterMSPRefresh(timeUs_t currentTimeUs)
if (cmp32(currentTimeUs, streamRequestAt) > 0) { if (cmp32(currentTimeUs, streamRequestAt) > 0) {
streamRequestAt = currentTimeUs + ((1000 * 1000) / 10); // 10hz streamRequestAt = currentTimeUs + ((1000 * 1000) / 10); // 10hz
mspSerialPush(SERIAL_PORT_NONE, MSP_ANALOG, NULL, 0, MSP_DIRECTION_REQUEST); mspSerialPush(SERIAL_PORT_ALL, MSP_ANALOG, NULL, 0, MSP_DIRECTION_REQUEST);
} }
} }