From 1a15e5aa0815c5c672ea66fa8369a97a88c85e7b Mon Sep 17 00:00:00 2001 From: Nicholas Sherlock Date: Sun, 30 Aug 2015 21:42:24 +1200 Subject: [PATCH] Blackbox: Fix slow frames were not logged when logging rate was 1/32 --- src/main/blackbox/blackbox.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/blackbox/blackbox.c b/src/main/blackbox/blackbox.c index e1800d6621..2f7ac51747 100644 --- a/src/main/blackbox/blackbox.c +++ b/src/main/blackbox/blackbox.c @@ -357,6 +357,10 @@ static blackboxMainState_t* blackboxHistory[3]; static bool blackboxModeActivationConditionPresent = false; +static bool blackboxIsOnlyLoggingIntraframes() { + return masterConfig.blackbox_rate_num == 1 && masterConfig.blackbox_rate_denom == 32; +} + static bool testBlackboxConditionUncached(FlightLogFieldCondition condition) { switch (condition) { @@ -1221,9 +1225,9 @@ static void blackboxLogIteration() if (blackboxShouldLogIFrame()) { /* * Don't log a slow frame if the slow data didn't change ("I" frames are already large enough without adding - * an additional item to write at the same time) + * an additional item to write at the same time). Unless we're *only* logging "I" frames, then we have no choice. */ - writeSlowFrameIfNeeded(false); + writeSlowFrameIfNeeded(blackboxIsOnlyLoggingIntraframes()); loadMainState(); writeIntraframe();