+
+ if (ao_flight_pres < ao_interval_cur_min_pres)
+ ao_interval_cur_min_pres = ao_flight_pres;
+ if (ao_flight_pres > ao_interval_cur_max_pres)
+ ao_interval_cur_max_pres = ao_flight_pres;
+ if (ao_flight_accel < ao_interval_cur_min_accel)
+ ao_interval_cur_min_accel = ao_flight_accel;
+ if (ao_flight_accel > ao_interval_cur_max_accel)
+ ao_interval_cur_max_accel = ao_flight_accel;
+
+ if ((int16_t) (ao_flight_tick - ao_interval_end) >= 0) {
+ ao_interval_max_pres = ao_interval_cur_max_pres;
+ ao_interval_min_pres = ao_interval_cur_min_pres;
+ ao_interval_max_accel = ao_interval_cur_max_accel;
+ ao_interval_min_accel = ao_interval_cur_min_accel;
+ ao_interval_end = ao_flight_tick + AO_INTERVAL_TICKS;
+ ao_interval_cur_min_pres = ao_interval_cur_max_pres = ao_flight_pres;
+ ao_interval_cur_min_accel = ao_interval_cur_max_accel = ao_flight_accel;
+ }
+
+ if ((uint16_t) (ao_interval_max_accel - ao_interval_min_accel) < (uint16_t) ACCEL_INT_LAND &&
+ ao_flight_pres > ao_ground_pres - BARO_LAND &&
+ (uint16_t) (ao_interval_max_pres - ao_interval_min_pres) < (uint16_t) BARO_INT_LAND)