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 and tstibor committed Feb 7, 2024
1 parent e47fb78 commit cf1d476
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/rx/msp_override.c
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 cf1d476

Please sign in to comment.