Skip to content

Commit

Permalink
Ensure MSP channel data is valid (betaflight#13352)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveCEvans authored Feb 6, 2024
1 parent d84ec8d commit 24e7dab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/rx/msp_override.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ uint16_t rxMspOverrideReadRawRc(const rxRuntimeState_t *rxRuntimeState, const rx
{
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;

if (IS_RC_MODE_ACTIVE(BOXMSPOVERRIDE) && override) {
Expand Down

0 comments on commit 24e7dab

Please sign in to comment.