1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 14:55:21 +03:00

Renamed MAX_MAPPABLE_RX_INPUTS

This commit is contained in:
Martin Budden 2017-07-08 07:00:15 +01:00
parent 3f621e26b2
commit 6ec6e7005d
5 changed files with 10 additions and 12 deletions

View file

@ -2083,7 +2083,7 @@ static void printMap(uint8_t dumpMask, const rxConfig_t *rxConfig, const rxConfi
char buf[16];
char bufDefault[16];
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];
if (defaultRxConfig) {
bufDefault[defaultRxConfig->rcmap[i]] = rcChannelLetters[i];

View file

@ -1200,7 +1200,7 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProcessFn
break;
case MSP_RX_MAP:
sbufWriteData(dst, rxConfig()->rcmap, MAX_MAPPABLE_RX_INPUTS);
sbufWriteData(dst, rxConfig()->rcmap, RX_MAPPABLE_CHANNEL_COUNT);
break;
case MSP_BF_CONFIG:
@ -1955,7 +1955,7 @@ static mspResult_e mspFcProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
break;
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);
}
break;

View file

@ -81,7 +81,7 @@ static uint32_t needRxSignalMaxDelayUs;
static uint32_t suspendRxSignalUntil = 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]
uint32_t rcInvalidPulsPeriod[MAX_SUPPORTED_RC_CHANNEL_COUNT];
@ -516,7 +516,7 @@ static void readRxChannelsApplyRanges(void)
const int channelCount = getRxChannelCount();
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
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++) {
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;
}
}

View file

@ -78,7 +78,7 @@ extern const char rcChannelLetters[];
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_MAX 255
@ -115,7 +115,7 @@ typedef struct rxChannelRangeConfig_s {
PG_DECLARE_ARRAY(rxChannelRangeConfig_t, NON_AUX_CHANNEL_COUNT, rxChannelRangeConfigs);
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 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.
@ -145,8 +145,6 @@ typedef struct rxConfig_s {
PG_DECLARE(rxConfig_t, rxConfig);
#define REMAPPABLE_CHANNEL_COUNT (sizeof(((rxConfig_t *)0)->rcmap) / sizeof(((rxConfig_t *)0)->rcmap[0]))
struct rxRuntimeConfig_s;
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);

View file

@ -411,7 +411,7 @@ static bool bstSlaveProcessFeedbackCommand(uint8_t bstRequest)
break;
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]);
break;
@ -563,7 +563,7 @@ static bool bstSlaveProcessWriteCommand(uint8_t bstWriteCommand)
}
break;
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();
}
break;