mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
Add cli command to configure adjustment ranges.
e.g. `adjrange 0 0 1700 2100 1 2` set adjustment range 0, which applies to aux channel 0 (aux1) when range is between 1700 and 2100 then apply function 1 (rc rate) to aux channel 2 (aux3)
This commit is contained in:
parent
18abad5dd7
commit
bd39445be8
5 changed files with 110 additions and 21 deletions
|
@ -138,16 +138,27 @@ typedef enum {
|
|||
ADJUSTMENT_RC_RATE
|
||||
} adjustmentFunction_e;
|
||||
|
||||
#define ADJUSTMENT_FUNCTION_COUNT 2
|
||||
|
||||
typedef struct adjustmentConfig_s {
|
||||
uint8_t adjustmentFunction;
|
||||
uint8_t step;
|
||||
} adjustmentConfig_t;
|
||||
|
||||
typedef struct adjustmentRange_s {
|
||||
// when aux channel is in range...
|
||||
uint8_t auxChannelIndex;
|
||||
channelRange_t range;
|
||||
|
||||
#define ADJUSTMENT_COUNT 1
|
||||
// ..then apply the adjustment function to the auxSwitchChannel
|
||||
uint8_t adjustmentFunction;
|
||||
uint8_t auxSwitchChannelIndex;
|
||||
} adjustmentRange_t;
|
||||
|
||||
#define ADJUSTMENT_INDEX_OFFSET 1
|
||||
|
||||
#define MAX_ADJUSTMENT_RANGE_COUNT 12 // enough for 2 * 6pos switches.
|
||||
|
||||
void configureAdjustment(uint8_t index, uint8_t auxChannelIndex, const adjustmentConfig_t *adjustmentConfig);
|
||||
void processRcAdjustments(controlRateConfig_t *controlRateConfig, rxConfig_t *rxConfig);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue