CF/BF - Fix HoTT telemetry.
[betaflight.git] / src / main / fc / runtime_config.h
blobf88e152a7b6ee52f21280e036a81aa16b35ba574
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 // FIXME some of these are flight modes, some of these are general status indicators
21 typedef enum {
22 OK_TO_ARM = (1 << 0),
23 PREVENT_ARMING = (1 << 1),
24 ARMED = (1 << 2),
25 WAS_EVER_ARMED = (1 << 3)
26 } armingFlag_e;
28 extern uint8_t armingFlags;
30 #define DISABLE_ARMING_FLAG(mask) (armingFlags &= ~(mask))
31 #define ENABLE_ARMING_FLAG(mask) (armingFlags |= (mask))
32 #define ARMING_FLAG(mask) (armingFlags & (mask))
34 typedef enum {
35 ANGLE_MODE = (1 << 0),
36 HORIZON_MODE = (1 << 1),
37 MAG_MODE = (1 << 2),
38 BARO_MODE = (1 << 3),
39 GPS_HOME_MODE = (1 << 4),
40 GPS_HOLD_MODE = (1 << 5),
41 HEADFREE_MODE = (1 << 6),
42 UNUSED_MODE = (1 << 7), // old autotune
43 PASSTHRU_MODE = (1 << 8),
44 SONAR_MODE = (1 << 9),
45 FAILSAFE_MODE = (1 << 10)
46 } flightModeFlags_e;
48 extern uint16_t flightModeFlags;
50 #define DISABLE_FLIGHT_MODE(mask) disableFlightMode(mask)
51 #define ENABLE_FLIGHT_MODE(mask) enableFlightMode(mask)
52 #define FLIGHT_MODE(mask) (flightModeFlags & (mask))
54 typedef enum {
55 GPS_FIX_HOME = (1 << 0),
56 GPS_FIX = (1 << 1),
57 CALIBRATE_MAG = (1 << 2),
58 SMALL_ANGLE = (1 << 3),
59 FIXED_WING = (1 << 4) // set when in flying_wing or airplane mode. currently used by althold selection code
60 } stateFlags_t;
62 #define DISABLE_STATE(mask) (stateFlags &= ~(mask))
63 #define ENABLE_STATE(mask) (stateFlags |= (mask))
64 #define STATE(mask) (stateFlags & (mask))
66 extern uint8_t stateFlags;
68 uint16_t enableFlightMode(flightModeFlags_e mask);
69 uint16_t disableFlightMode(flightModeFlags_e mask);
71 bool sensors(uint32_t mask);
72 void sensorsSet(uint32_t mask);
73 void sensorsClear(uint32_t mask);
74 uint32_t sensorsMask(void);
76 void mwDisarm(void);