mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-27 02:05:31 +03:00
Fixed review
This commit is contained in:
parent
674d3b1e3b
commit
9a0e0b8a8d
2 changed files with 10 additions and 4 deletions
|
@ -54,6 +54,7 @@
|
||||||
#include "flight/pid_init.h"
|
#include "flight/pid_init.h"
|
||||||
#include "flight/rpm_filter.h"
|
#include "flight/rpm_filter.h"
|
||||||
#include "flight/servos.h"
|
#include "flight/servos.h"
|
||||||
|
#include "flight/position.h"
|
||||||
|
|
||||||
#include "io/beeper.h"
|
#include "io/beeper.h"
|
||||||
#include "io/gps.h"
|
#include "io/gps.h"
|
||||||
|
@ -201,6 +202,13 @@ static void validateAndFixRatesSettings(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void validateAndFixPositionConfig(void)
|
||||||
|
{
|
||||||
|
if (positionConfig()->altNumSatsBaroFallback >= positionConfig()->altNumSatsGpsUse) {
|
||||||
|
PG_RESET(positionConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void validateAndFixConfig(void)
|
static void validateAndFixConfig(void)
|
||||||
{
|
{
|
||||||
#if !defined(USE_QUAD_MIXER_ONLY)
|
#if !defined(USE_QUAD_MIXER_ONLY)
|
||||||
|
@ -586,6 +594,8 @@ static void validateAndFixConfig(void)
|
||||||
// This should be done at the end of the validation
|
// This should be done at the end of the validation
|
||||||
targetValidateConfiguration();
|
targetValidateConfiguration();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
validateAndFixPositionConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
void validateAndFixGyroConfig(void)
|
void validateAndFixGyroConfig(void)
|
||||||
|
|
|
@ -157,10 +157,6 @@ void calculateEstimatedAltitude(timeUs_t currentTimeUs)
|
||||||
if (haveBaroAlt) {
|
if (haveBaroAlt) {
|
||||||
goodGpsSats = positionConfig()->altNumSatsGpsUse;
|
goodGpsSats = positionConfig()->altNumSatsGpsUse;
|
||||||
badGpsSats = positionConfig()->altNumSatsBaroFallback;
|
badGpsSats = positionConfig()->altNumSatsBaroFallback;
|
||||||
if (badGpsSats >= goodGpsSats) {
|
|
||||||
badGpsSats = goodGpsSats - 1;
|
|
||||||
positionConfigMutable()->altNumSatsBaroFallback = badGpsSats;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ARMING_FLAG(ARMED)) {
|
if (ARMING_FLAG(ARMED)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue