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 #ifndef DEFAULT_FEATURES
26 #define DEFAULT_FEATURES 0
29 #ifndef DEFAULT_RX_FEATURE
31 #if defined(USE_SERIALRX)
32 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
33 #elif defined(USE_RX_MSP)
34 #define DEFAULT_RX_FEATURE FEATURE_RX_MSP
35 #elif defined(USE_RX_SPI)
36 // need to test with FEATURE_RX_EXPRESSLRS
37 #define DEFAULT_RX_FEATURE FEATURE_RX_SPI
40 #endif // DEFAULT_RX_FEATURE
42 // features must be listed in
43 // config/feature.c:featuresSupportedByBuild
44 // cli/cli.c:featureNames
46 FEATURE_RX_PPM
= 1 << 0,
47 FEATURE_INFLIGHT_ACC_CAL
= 1 << 2,
48 FEATURE_RX_SERIAL
= 1 << 3,
49 FEATURE_MOTOR_STOP
= 1 << 4,
50 FEATURE_SERVO_TILT
= 1 << 5,
51 FEATURE_SOFTSERIAL
= 1 << 6,
53 FEATURE_RANGEFINDER
= 1 << 9,
54 FEATURE_TELEMETRY
= 1 << 10,
56 FEATURE_RX_PARALLEL_PWM
= 1 << 13,
57 FEATURE_RX_MSP
= 1 << 14,
58 FEATURE_RSSI_ADC
= 1 << 15,
59 FEATURE_LED_STRIP
= 1 << 16,
60 FEATURE_DASHBOARD
= 1 << 17,
61 FEATURE_OSD
= 1 << 18,
62 FEATURE_CHANNEL_FORWARDING
= 1 << 20,
63 FEATURE_TRANSPONDER
= 1 << 21,
64 FEATURE_AIRMODE
= 1 << 22,
65 FEATURE_RX_SPI
= 1 << 25,
66 //FEATURE_SOFTSPI = 1 << 26, (removed)
67 FEATURE_ESC_SENSOR
= 1 << 27,
68 FEATURE_ANTI_GRAVITY
= 1 << 28,
69 //FEATURE_DYNAMIC_FILTER = 1 << 29, (removed)
72 typedef struct featureConfig_s
{
73 uint32_t enabledFeatures
;
76 PG_DECLARE(featureConfig_t
, featureConfig
);
78 // Mask of features that have code compiled in with current config.
79 // Other restrictions on available features may apply.
80 extern uint32_t featuresSupportedByBuild
;
82 void featureInit(void);
83 bool featureIsEnabled(const uint32_t mask
);
84 bool featureIsConfigured(const uint32_t mask
);
85 void featureEnableImmediate(const uint32_t mask
);
86 void featureDisableImmediate(const uint32_t mask
);
87 void featureConfigSet(const uint32_t mask
);
88 void featureConfigClear(const uint32_t mask
);
89 void featureConfigReplace(const uint32_t mask
);