diff options
| author | Bdale Garbee <bdale@gag.com> | 2018-08-05 11:21:37 +0800 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2018-08-05 11:21:37 +0800 | 
| commit | d8627bb7b46fc991786835afa38cd720e9e75812 (patch) | |
| tree | e14ae029a4ead29a4a7ccccb39af556e32413d36 /src/kernel/ao_kalman.c | |
| parent | 59e23c27c2a85d7d748223e444b24d19937afe47 (diff) | |
| parent | 8830fbc99565f753c0ae1f3d9f4b079860c2634a (diff) | |
Merge branch 'master' into branch-1.8
Diffstat (limited to 'src/kernel/ao_kalman.c')
| -rw-r--r-- | src/kernel/ao_kalman.c | 10 | 
1 files changed, 7 insertions, 3 deletions
diff --git a/src/kernel/ao_kalman.c b/src/kernel/ao_kalman.c index ac41085d..e4cc6d4b 100644 --- a/src/kernel/ao_kalman.c +++ b/src/kernel/ao_kalman.c @@ -45,7 +45,11 @@ static __pdata ao_k_t		ao_avg_height_scaled;  __xdata ao_v_t			ao_avg_height;  __pdata ao_v_t			ao_error_h; -#if !HAS_ACCEL +#if !HAS_ACCEL || AO_FLIGHT_TEST +#define AO_ERROR_H_SQ_AVG	1 +#endif + +#if AO_ERROR_H_SQ_AVG  __pdata ao_v_t			ao_error_h_sq_avg;  #endif @@ -85,7 +89,7 @@ ao_kalman_predict(void)  static void  ao_kalman_err_height(void)  { -#if !HAS_ACCEL +#if AO_ERROR_H_SQ_AVG  	ao_v_t	e;  #endif  	ao_v_t height_distrust; @@ -95,7 +99,7 @@ ao_kalman_err_height(void)  	ao_error_h = ao_sample_height - (ao_v_t) (ao_k_height >> 16); -#if !HAS_ACCEL +#if AO_ERROR_H_SQ_AVG  	e = ao_error_h;  	if (e < 0)  		e = -e;  | 
