Browse Source

AP_Soaring: Use 64 bit variable for time to avoid overflow.

c415-sdk
Samuel Tabor 6 years ago committed by Andrew Tridgell
parent
commit
5ac801b2ac
  1. 6
      libraries/AP_Soaring/AP_Soaring.h
  2. 2
      libraries/AP_Soaring/Variometer.h

6
libraries/AP_Soaring/AP_Soaring.h

@ -34,16 +34,16 @@ class SoaringController { @@ -34,16 +34,16 @@ class SoaringController {
Vector3f _prev_update_location;
// store time thermal was entered for hysteresis
unsigned long _thermal_start_time_us;
uint64_t _thermal_start_time_us;
// store position thermal was entered as a backup check
Vector3f _thermal_start_pos;
// store time cruise was entered for hysteresis
unsigned long _cruise_start_time_us;
uint64_t _cruise_start_time_us;
// store time of last update
unsigned long _prev_update_time;
uint64_t _prev_update_time;
bool _throttle_suppressed;

2
libraries/AP_Soaring/Variometer.h

@ -20,7 +20,7 @@ class Variometer { @@ -20,7 +20,7 @@ class Variometer {
const AP_Vehicle::FixedWing &_aparm;
// store time of last update
unsigned long _prev_update_time;
uint64_t _prev_update_time;
float _last_alt;

Loading…
Cancel
Save