mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Altitude hold for 4.6 (#13816)
This commit is contained in:
parent
350510603c
commit
254da8f460
46 changed files with 805 additions and 108 deletions
|
@ -58,6 +58,7 @@
|
|||
#include "flight/mixer.h"
|
||||
#include "flight/pid.h"
|
||||
#include "flight/position.h"
|
||||
#include "flight/alt_hold.h"
|
||||
|
||||
#include "io/asyncfatfs/asyncfatfs.h"
|
||||
#include "io/beeper.h"
|
||||
|
@ -382,6 +383,10 @@ task_attribute_t task_attributes[TASK_COUNT] = {
|
|||
[TASK_GPS_RESCUE] = DEFINE_TASK("GPS_RESCUE", NULL, NULL, taskGpsRescue, TASK_PERIOD_HZ(TASK_GPS_RESCUE_RATE_HZ), TASK_PRIORITY_MEDIUM),
|
||||
#endif
|
||||
|
||||
#ifdef USE_ALT_HOLD_MODE
|
||||
[TASK_ALTHOLD] = DEFINE_TASK("ALTHOLD", NULL, NULL, updateAltHoldState, TASK_PERIOD_HZ(ALTHOLD_TASK_RATE_HZ), TASK_PRIORITY_LOW),
|
||||
#endif
|
||||
|
||||
#ifdef USE_MAG
|
||||
[TASK_COMPASS] = DEFINE_TASK("COMPASS", NULL, NULL, taskUpdateMag, TASK_PERIOD_HZ(TASK_COMPASS_RATE_HZ), TASK_PRIORITY_LOW),
|
||||
#endif
|
||||
|
@ -537,6 +542,10 @@ void tasksInit(void)
|
|||
setTaskEnabled(TASK_GPS_RESCUE, featureIsEnabled(FEATURE_GPS));
|
||||
#endif
|
||||
|
||||
#ifdef USE_ALT_HOLD_MODE
|
||||
setTaskEnabled(TASK_ALTHOLD, true);
|
||||
#endif
|
||||
|
||||
#ifdef USE_MAG
|
||||
setTaskEnabled(TASK_COMPASS, sensors(SENSOR_MAG));
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue