Skip to content

Commit c60abea

Browse files
authored
extend msp_override_mask to 32bits / channels (iNavFlight#10891)
* extend msp_override_mask to 32bits / channels * update other override 16bit variables
1 parent 498526b commit c60abea

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

docs/Settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3038,7 +3038,7 @@ Mask of RX channels that may be overridden by MSP `SET_RAW_RC`. Note that this r
30383038

30393039
| Default | Min | Max |
30403040
| --- | --- | --- |
3041-
| 0 | 0 | 65535 |
3041+
| 0 | 0 | 4294967295 |
30423042

30433043
---
30443044

src/main/fc/settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ groups:
775775
field: mspOverrideChannels
776776
condition: USE_MSP_RC_OVERRIDE
777777
min: 0
778-
max: 65535
778+
max: UINT32_MAX
779779

780780
- name: PG_BLACKBOX_CONFIG
781781
type: blackboxConfig_t

src/main/rx/msp_override.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static timeMs_t validRxDataFailedAt = 0;
5959
static timeUs_t rxNextUpdateAtUs = 0;
6060
static timeUs_t needRxSignalBefore = 0;
6161

62-
static uint16_t mspOverrideCtrlChannels = 0; // bitmask representing which channels are used to control MSP override
62+
static uint32_t mspOverrideCtrlChannels = 0; // bitmask representing which channels are used to control MSP override
6363
static rcChannel_t mspRcChannels[MAX_SUPPORTED_RC_CHANNEL_COUNT];
6464

6565
static rxRuntimeConfig_t rxRuntimeConfigMSP;
@@ -215,7 +215,7 @@ bool mspOverrideCalculateChannels(timeUs_t currentTimeUs)
215215

216216
void mspOverrideChannels(rcChannel_t *rcChannels)
217217
{
218-
for (uint16_t channel = 0, channelMask = 1; channel < rxRuntimeConfigMSP.channelCount; ++channel, channelMask <<= 1) {
218+
for (uint32_t channel = 0, channelMask = 1; channel < rxRuntimeConfigMSP.channelCount; ++channel, channelMask <<= 1) {
219219
if (rxConfig()->mspOverrideChannels & ~mspOverrideCtrlChannels & channelMask) {
220220
rcChannels[channel].raw = rcChannels[channel].data = mspRcChannels[channel].data;
221221
}

src/main/rx/rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ rxLinkStatistics_t rxLinkStatistics;
9898
rxRuntimeConfig_t rxRuntimeConfig;
9999
static uint8_t rcSampleIndex = 0;
100100

101-
PG_REGISTER_WITH_RESET_TEMPLATE(rxConfig_t, rxConfig, PG_RX_CONFIG, 12);
101+
PG_REGISTER_WITH_RESET_TEMPLATE(rxConfig_t, rxConfig, PG_RX_CONFIG, 13);
102102

103103
#ifndef SERIALRX_PROVIDER
104104
#define SERIALRX_PROVIDER 0

src/main/rx/rx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ typedef struct rxConfig_s {
126126
uint8_t rcFilterFrequency; // RC filter cutoff frequency (smoothness vs response sharpness)
127127
uint8_t autoSmooth; // auto smooth rx input (0 = off, 1 = on)
128128
uint8_t autoSmoothFactor; // auto smooth rx input factor (1 = no smoothing, 100 = lots of smoothing)
129-
uint16_t mspOverrideChannels; // Channels to override with MSP RC when BOXMSPRCOVERRIDE is active
129+
uint32_t mspOverrideChannels; // Channels to override with MSP RC when BOXMSPRCOVERRIDE is active
130130
uint8_t rssi_source;
131131
#ifdef USE_SERIALRX_SRXL2
132132
uint8_t srxl2_unit_id;

0 commit comments

Comments
 (0)