mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
AltHold cleanup.
* Renamed several methods and variables so they make more sense. * Move more altitude hold related code out of imu.c/h into altitudehold.c/h. * Fixed a unsigned integer being using instead of an signed integer in the throttle calculation code.
This commit is contained in:
parent
7d4abb8a4a
commit
daa823ddba
8 changed files with 222 additions and 199 deletions
|
@ -20,6 +20,18 @@
|
|||
|
||||
#include "maths.h"
|
||||
|
||||
int32_t applyDeadband(int32_t value, int32_t deadband)
|
||||
{
|
||||
if (abs(value) < deadband) {
|
||||
value = 0;
|
||||
} else if (value > 0) {
|
||||
value -= deadband;
|
||||
} else if (value < 0) {
|
||||
value += deadband;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
int constrain(int amt, int low, int high)
|
||||
{
|
||||
if (amt < low)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue