1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Changes from review

Used HZ_TO_INTERVAL_US() instead of hardcoded 500us.

Moved tests into a dedicated function.
This commit is contained in:
Bruce Luckcuck 2018-07-29 17:16:01 -04:00
parent f411b82eb6
commit 25c6b038d9
5 changed files with 9 additions and 4 deletions

View file

@ -60,6 +60,7 @@
#include "sensors/acceleration.h"
#include "sensors/battery.h"
#include "sensors/gyro.h"
#include "sensors/gyroanalyse.h"
#ifndef USE_OSD_SLAVE
pidProfile_t *currentPidProfile;
@ -410,10 +411,12 @@ static void validateAndFixConfig(void)
#ifndef USE_OSD_SLAVE
void validateAndFixGyroConfig(void)
{
#ifdef USE_GYRO_DATA_ANALYSE
// Disable dynamic filter if gyro loop is less than 2KHz
if (gyro.targetLooptime > GYRO_LOOPTIME_2KHZ) {
if (!dynamicFilterAllowed()) {
featureClear(FEATURE_DYNAMIC_FILTER);
}
#endif
// Prevent invalid notch cutoff
if (gyroConfig()->gyro_soft_notch_cutoff_1 >= gyroConfig()->gyro_soft_notch_hz_1) {