1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 19:40:31 +03:00

Ensure MSP channel data is valid (#13352)

This commit is contained in:
Steve Evans 2024-02-06 12:43:39 +00:00 committed by GitHub
parent d84ec8da63
commit 24e7dabed3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,7 +32,8 @@ uint16_t rxMspOverrideReadRawRc(const rxRuntimeState_t *rxRuntimeState, const rx
{ {
uint16_t rxSample = (rxRuntimeState->rcReadRawFn)(rxRuntimeState, chan); uint16_t rxSample = (rxRuntimeState->rcReadRawFn)(rxRuntimeState, chan);
uint16_t overrideSample = rxMspReadRawRC(rxRuntimeState, chan); uint16_t overrideSample = constrainf(rxMspReadRawRC(rxRuntimeState, chan), rxConfig->rx_min_usec, rxConfig->rx_max_usec);
bool override = (1 << chan) & rxConfig->msp_override_channels_mask; bool override = (1 << chan) & rxConfig->msp_override_channels_mask;
if (IS_RC_MODE_ACTIVE(BOXMSPOVERRIDE) && override) { if (IS_RC_MODE_ACTIVE(BOXMSPOVERRIDE) && override) {