1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Merge pull request #7927 from krzysztofmatula/km-odometer

Flight statistics (odometer) added.
This commit is contained in:
Michael Keller 2019-04-14 21:49:31 +12:00 committed by GitHub
commit e12b802bb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 199 additions and 2 deletions

View file

@ -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"
@ -371,6 +372,10 @@ void disarm(void)
#endif
flipOverAfterCrashActive = false;
#ifdef USE_PERSISTENT_STATS
statsOnDisarm();
#endif
// if ARMING_DISABLED_RUNAWAY_TAKEOFF is set then we want to play it's beep pattern instead
if (!(getArmingDisableFlags() & (ARMING_DISABLED_RUNAWAY_TAKEOFF | ARMING_DISABLED_CRASH_DETECTED))) {
beeper(BEEPER_DISARMING); // emit disarm tone
@ -485,6 +490,10 @@ void tryArm(void)
beeper(BEEPER_ARMING);
#endif
#ifdef USE_PERSISTENT_STATS
statsOnArm();
#endif
#ifdef USE_RUNAWAY_TAKEOFF
runawayTakeoffDeactivateUs = 0;
runawayTakeoffAccumulatedUs = 0;
@ -974,7 +983,12 @@ bool processRx(timeUs_t currentTimeUs)
#endif
pidSetAntiGravityState(IS_RC_MODE_ACTIVE(BOXANTIGRAVITY) || featureIsEnabled(FEATURE_ANTI_GRAVITY));
#ifdef USE_PERSISTENT_STATS
/* allow the stats collector to do periodic tasks */
statsOnLoop();
#endif
return true;
}