2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
25 #include "fc/rc_modes.h"
33 ADJUSTMENT_THROTTLE_EXPO
,
34 ADJUSTMENT_PITCH_ROLL_RATE
,
36 ADJUSTMENT_PITCH_ROLL_P
,
37 ADJUSTMENT_PITCH_ROLL_I
,
38 ADJUSTMENT_PITCH_ROLL_D
,
42 ADJUSTMENT_RATE_PROFILE
,
43 ADJUSTMENT_PITCH_RATE
,
51 ADJUSTMENT_RC_RATE_YAW
,
52 ADJUSTMENT_PITCH_ROLL_F
,
53 ADJUSTMENT_FEEDFORWARD_TRANSITION
,
54 ADJUSTMENT_HORIZON_STRENGTH
,
55 ADJUSTMENT_ROLL_RC_RATE
,
56 ADJUSTMENT_PITCH_RC_RATE
,
57 ADJUSTMENT_ROLL_RC_EXPO
,
58 ADJUSTMENT_PITCH_RC_EXPO
,
63 ADJUSTMENT_OSD_PROFILE
,
64 ADJUSTMENT_LED_PROFILE
,
65 ADJUSTMENT_FUNCTION_COUNT
66 } adjustmentFunction_e
;
70 ADJUSTMENT_MODE_SELECT
73 typedef union adjustmentConfig_u
{
75 uint8_t switchPositions
;
78 typedef struct adjustmentConfig_s
{
79 adjustmentFunction_e adjustmentFunction
;
80 adjustmentMode_e mode
;
81 adjustmentData_t data
;
84 #define MAX_ADJUSTMENT_RANGE_COUNT 30
86 typedef struct adjustmentRange_s
{
87 // when aux channel is in range...
88 uint8_t auxChannelIndex
;
91 // ..then apply the adjustment function to the auxSwitchChannel ...
92 uint8_t adjustmentConfig
;
93 uint8_t auxSwitchChannelIndex
;
95 uint16_t adjustmentCenter
;
96 uint16_t adjustmentScale
;
99 PG_DECLARE_ARRAY(adjustmentRange_t
, MAX_ADJUSTMENT_RANGE_COUNT
, adjustmentRanges
);
101 typedef struct timedAdjustmentState_s
{
103 uint8_t adjustmentRangeIndex
;
105 } timedAdjustmentState_t
;
107 typedef struct continuosAdjustmentState_s
{
108 uint8_t adjustmentRangeIndex
;
110 } continuosAdjustmentState_t
;
112 struct controlRateConfig_s
;
113 void processRcAdjustments(struct controlRateConfig_s
*controlRateConfig
);
114 const char *getAdjustmentsRangeName(void);
115 int getAdjustmentsRangeValue(void);
116 void activeAdjustmentRangeReset(void);