mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 09:16:07 +03:00
Flight statistics (odometer) added.
Supported counters: - total flights count - total flight time - total flight distance (if GPS available)
This commit is contained in:
parent
22b9f34532
commit
36c8f1e224
12 changed files with 201 additions and 2 deletions
|
@ -65,6 +65,7 @@
|
|||
#include "fc/rc_adjustments.h"
|
||||
#include "fc/rc_controls.h"
|
||||
#include "fc/runtime_config.h"
|
||||
#include "fc/stats.h"
|
||||
|
||||
#include "msp/msp_serial.h"
|
||||
|
||||
|
@ -370,6 +371,8 @@ void disarm(void)
|
|||
#endif
|
||||
flipOverAfterCrashActive = false;
|
||||
|
||||
statsOnDisarm();
|
||||
|
||||
// if ARMING_DISABLED_RUNAWAY_TAKEOFF is set then we want to play it's beep pattern instead
|
||||
if (!(getArmingDisableFlags() & ARMING_DISABLED_RUNAWAY_TAKEOFF)) {
|
||||
beeper(BEEPER_DISARMING); // emit disarm tone
|
||||
|
@ -483,6 +486,7 @@ void tryArm(void)
|
|||
#else
|
||||
beeper(BEEPER_ARMING);
|
||||
#endif
|
||||
statsOnArm();
|
||||
|
||||
#ifdef USE_RUNAWAY_TAKEOFF
|
||||
runawayTakeoffDeactivateUs = 0;
|
||||
|
@ -973,7 +977,10 @@ bool processRx(timeUs_t currentTimeUs)
|
|||
#endif
|
||||
|
||||
pidSetAntiGravityState(IS_RC_MODE_ACTIVE(BOXANTIGRAVITY) || featureIsEnabled(FEATURE_ANTI_GRAVITY));
|
||||
|
||||
|
||||
/* allow the stats collector to do periodic tasks */
|
||||
statsOnLoop();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue