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/>.
20 #include "common/time.h"
21 #include "config/parameter_group.h"
23 #if defined(GPS) || defined(MAG)
24 extern int16_t magHold
;
27 extern bool isRXDataNew
;
28 extern int16_t headFreeModeHold
;
30 extern uint8_t motorControlEnable
;
32 typedef struct throttleCorrectionConfig_s
{
33 uint16_t throttle_correction_angle
; // the angle when the throttle correction is maximal. in 0.1 degres, ex 225 = 22.5 ,30.0, 450 = 45.0 deg
34 uint8_t throttle_correction_value
; // the correction that will be applied at throttle_correction_angle.
35 } throttleCorrectionConfig_t
;
37 PG_DECLARE(throttleCorrectionConfig_t
, throttleCorrectionConfig
);
39 union rollAndPitchTrims_u
;
40 void applyAndSaveAccelerometerTrimsDelta(union rollAndPitchTrims_u
*rollAndPitchTrimsDelta
);
41 void handleInflightCalibrationStickPosition();
46 void processRx(timeUs_t currentTimeUs
);
47 void updateLEDs(void);
48 void updateRcCommands(void);
50 void taskMainPidLoop(timeUs_t currentTimeUs
);