mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 21:35:44 +03:00
Shared altitude control function in position_control.c (#13954)
* Altitude control code shared fewer debugs subtract D * remove #include comments, simplify coding, restructuring thanks JP and MH * fix cms limits for throttle control * Use altitude_control debug, fix throttle calculation minor refactoring * use AUTO_CONTROL_ALTITUDE debug in place of GPS Rescue throttle pid * use autopilot for position control names * fixes from reviews - thanks * Re-organise included files and functions thanks Karate * missed init and other typos * remove old unused unit test file, tidy up thanks Mark * fix indentation on one line
This commit is contained in:
parent
1d9823b4cd
commit
58fc8bbbb8
33 changed files with 263 additions and 595 deletions
|
@ -95,6 +95,7 @@
|
|||
#include "fc/tasks.h"
|
||||
|
||||
#include "flight/alt_hold.h"
|
||||
#include "flight/autopilot.h"
|
||||
#include "flight/failsafe.h"
|
||||
#include "flight/imu.h"
|
||||
#include "flight/mixer.h"
|
||||
|
@ -102,7 +103,6 @@
|
|||
#include "flight/pid.h"
|
||||
#include "flight/pid_init.h"
|
||||
#include "flight/position.h"
|
||||
#include "flight/position_control.h"
|
||||
#include "flight/servos.h"
|
||||
|
||||
#include "io/asyncfatfs/asyncfatfs.h"
|
||||
|
@ -828,7 +828,7 @@ void init(void)
|
|||
#endif
|
||||
|
||||
positionInit();
|
||||
positionControlInit(positionControlConfig());
|
||||
autopilotInit(autopilotConfig());
|
||||
|
||||
#if defined(USE_VTX_COMMON) || defined(USE_VTX_CONTROL)
|
||||
vtxTableInit();
|
||||
|
@ -1000,7 +1000,7 @@ void init(void)
|
|||
spiInitBusDMA();
|
||||
#endif
|
||||
|
||||
// position_control must be initialised before modes that require the position_control pids
|
||||
// autopilot must be initialised before modes that require the autopilot pids
|
||||
#ifdef USE_ALT_HOLD_MODE
|
||||
altHoldInit();
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue