mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Renamed MAX_MAPPABLE_RX_INPUTS
This commit is contained in:
parent
3f621e26b2
commit
6ec6e7005d
5 changed files with 10 additions and 12 deletions
|
@ -2083,7 +2083,7 @@ static void printMap(uint8_t dumpMask, const rxConfig_t *rxConfig, const rxConfi
|
||||||
char buf[16];
|
char buf[16];
|
||||||
char bufDefault[16];
|
char bufDefault[16];
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < MAX_MAPPABLE_RX_INPUTS; i++) {
|
for (i = 0; i < RX_MAPPABLE_CHANNEL_COUNT; i++) {
|
||||||
buf[rxConfig->rcmap[i]] = rcChannelLetters[i];
|
buf[rxConfig->rcmap[i]] = rcChannelLetters[i];
|
||||||
if (defaultRxConfig) {
|
if (defaultRxConfig) {
|
||||||
bufDefault[defaultRxConfig->rcmap[i]] = rcChannelLetters[i];
|
bufDefault[defaultRxConfig->rcmap[i]] = rcChannelLetters[i];
|
||||||
|
|
|
@ -1200,7 +1200,7 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProcessFn
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_RX_MAP:
|
case MSP_RX_MAP:
|
||||||
sbufWriteData(dst, rxConfig()->rcmap, MAX_MAPPABLE_RX_INPUTS);
|
sbufWriteData(dst, rxConfig()->rcmap, RX_MAPPABLE_CHANNEL_COUNT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_BF_CONFIG:
|
case MSP_BF_CONFIG:
|
||||||
|
@ -1955,7 +1955,7 @@ static mspResult_e mspFcProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_SET_RX_MAP:
|
case MSP_SET_RX_MAP:
|
||||||
for (int i = 0; i < MAX_MAPPABLE_RX_INPUTS; i++) {
|
for (int i = 0; i < RX_MAPPABLE_CHANNEL_COUNT; i++) {
|
||||||
rxConfigMutable()->rcmap[i] = sbufReadU8(src);
|
rxConfigMutable()->rcmap[i] = sbufReadU8(src);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -81,7 +81,7 @@ static uint32_t needRxSignalMaxDelayUs;
|
||||||
static uint32_t suspendRxSignalUntil = 0;
|
static uint32_t suspendRxSignalUntil = 0;
|
||||||
static uint8_t skipRxSamples = 0;
|
static uint8_t skipRxSamples = 0;
|
||||||
|
|
||||||
int16_t rcRaw[MAX_SUPPORTED_RC_CHANNEL_COUNT]; // interval [1000;2000]
|
static int16_t rcRaw[MAX_SUPPORTED_RC_CHANNEL_COUNT]; // interval [1000;2000]
|
||||||
int16_t rcData[MAX_SUPPORTED_RC_CHANNEL_COUNT]; // interval [1000;2000]
|
int16_t rcData[MAX_SUPPORTED_RC_CHANNEL_COUNT]; // interval [1000;2000]
|
||||||
uint32_t rcInvalidPulsPeriod[MAX_SUPPORTED_RC_CHANNEL_COUNT];
|
uint32_t rcInvalidPulsPeriod[MAX_SUPPORTED_RC_CHANNEL_COUNT];
|
||||||
|
|
||||||
|
@ -516,7 +516,7 @@ static void readRxChannelsApplyRanges(void)
|
||||||
const int channelCount = getRxChannelCount();
|
const int channelCount = getRxChannelCount();
|
||||||
for (int channel = 0; channel < channelCount; channel++) {
|
for (int channel = 0; channel < channelCount; channel++) {
|
||||||
|
|
||||||
const uint8_t rawChannel = calculateChannelRemapping(rxConfig()->rcmap, REMAPPABLE_CHANNEL_COUNT, channel);
|
const uint8_t rawChannel = calculateChannelRemapping(rxConfig()->rcmap, RX_MAPPABLE_CHANNEL_COUNT, channel);
|
||||||
|
|
||||||
// sample the channel
|
// sample the channel
|
||||||
uint16_t sample = rxRuntimeConfig.rcReadRawFn(&rxRuntimeConfig, rawChannel);
|
uint16_t sample = rxRuntimeConfig.rcReadRawFn(&rxRuntimeConfig, rawChannel);
|
||||||
|
@ -617,7 +617,7 @@ void parseRcChannels(const char *input, rxConfig_t *rxConfig)
|
||||||
{
|
{
|
||||||
for (const char *c = input; *c; c++) {
|
for (const char *c = input; *c; c++) {
|
||||||
const char *s = strchr(rcChannelLetters, *c);
|
const char *s = strchr(rcChannelLetters, *c);
|
||||||
if (s && (s < rcChannelLetters + MAX_MAPPABLE_RX_INPUTS)) {
|
if (s && (s < rcChannelLetters + RX_MAPPABLE_CHANNEL_COUNT)) {
|
||||||
rxConfig->rcmap[s - rcChannelLetters] = c - input;
|
rxConfig->rcmap[s - rcChannelLetters] = c - input;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ extern const char rcChannelLetters[];
|
||||||
|
|
||||||
extern int16_t rcData[MAX_SUPPORTED_RC_CHANNEL_COUNT]; // interval [1000;2000]
|
extern int16_t rcData[MAX_SUPPORTED_RC_CHANNEL_COUNT]; // interval [1000;2000]
|
||||||
|
|
||||||
#define MAX_MAPPABLE_RX_INPUTS 8
|
#define RX_MAPPABLE_CHANNEL_COUNT 8
|
||||||
|
|
||||||
#define RSSI_SCALE_MIN 1
|
#define RSSI_SCALE_MIN 1
|
||||||
#define RSSI_SCALE_MAX 255
|
#define RSSI_SCALE_MAX 255
|
||||||
|
@ -115,7 +115,7 @@ typedef struct rxChannelRangeConfig_s {
|
||||||
PG_DECLARE_ARRAY(rxChannelRangeConfig_t, NON_AUX_CHANNEL_COUNT, rxChannelRangeConfigs);
|
PG_DECLARE_ARRAY(rxChannelRangeConfig_t, NON_AUX_CHANNEL_COUNT, rxChannelRangeConfigs);
|
||||||
|
|
||||||
typedef struct rxConfig_s {
|
typedef struct rxConfig_s {
|
||||||
uint8_t rcmap[MAX_MAPPABLE_RX_INPUTS]; // mapping of radio channels to internal RPYTA+ order
|
uint8_t rcmap[RX_MAPPABLE_CHANNEL_COUNT]; // mapping of radio channels to internal RPYTA+ order
|
||||||
uint8_t serialrx_provider; // type of UART-based receiver (0 = spek 10, 1 = spek 11, 2 = sbus). Must be enabled by FEATURE_RX_SERIAL first.
|
uint8_t serialrx_provider; // type of UART-based receiver (0 = spek 10, 1 = spek 11, 2 = sbus). Must be enabled by FEATURE_RX_SERIAL first.
|
||||||
uint8_t sbus_inversion; // default sbus (Futaba, FrSKY) is inverted. Support for uninverted OpenLRS (and modified FrSKY) receivers.
|
uint8_t sbus_inversion; // default sbus (Futaba, FrSKY) is inverted. Support for uninverted OpenLRS (and modified FrSKY) receivers.
|
||||||
uint8_t halfDuplex; // allow rx to operate in half duplex mode on F4, ignored for F1 and F3.
|
uint8_t halfDuplex; // allow rx to operate in half duplex mode on F4, ignored for F1 and F3.
|
||||||
|
@ -145,8 +145,6 @@ typedef struct rxConfig_s {
|
||||||
|
|
||||||
PG_DECLARE(rxConfig_t, rxConfig);
|
PG_DECLARE(rxConfig_t, rxConfig);
|
||||||
|
|
||||||
#define REMAPPABLE_CHANNEL_COUNT (sizeof(((rxConfig_t *)0)->rcmap) / sizeof(((rxConfig_t *)0)->rcmap[0]))
|
|
||||||
|
|
||||||
struct rxRuntimeConfig_s;
|
struct rxRuntimeConfig_s;
|
||||||
typedef uint16_t (*rcReadRawDataFnPtr)(const struct rxRuntimeConfig_s *rxRuntimeConfig, uint8_t chan); // used by receiver driver to return channel data
|
typedef uint16_t (*rcReadRawDataFnPtr)(const struct rxRuntimeConfig_s *rxRuntimeConfig, uint8_t chan); // used by receiver driver to return channel data
|
||||||
typedef uint8_t (*rcFrameStatusFnPtr)(void);
|
typedef uint8_t (*rcFrameStatusFnPtr)(void);
|
||||||
|
|
|
@ -411,7 +411,7 @@ static bool bstSlaveProcessFeedbackCommand(uint8_t bstRequest)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BST_RX_MAP:
|
case BST_RX_MAP:
|
||||||
for (i = 0; i < MAX_MAPPABLE_RX_INPUTS; i++)
|
for (i = 0; i < RX_MAPPABLE_CHANNEL_COUNT; i++)
|
||||||
bstWrite8(rxConfig()->rcmap[i]);
|
bstWrite8(rxConfig()->rcmap[i]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -563,7 +563,7 @@ static bool bstSlaveProcessWriteCommand(uint8_t bstWriteCommand)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BST_SET_RX_MAP:
|
case BST_SET_RX_MAP:
|
||||||
for (i = 0; i < MAX_MAPPABLE_RX_INPUTS; i++) {
|
for (i = 0; i < RX_MAPPABLE_CHANNEL_COUNT; i++) {
|
||||||
rxConfigMutable()->rcmap[i] = bstRead8();
|
rxConfigMutable()->rcmap[i] = bstRead8();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue