mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Fix builds on targets that do not have sonar support.
This commit is contained in:
parent
1d48fdafc9
commit
e56535f4f3
1 changed files with 5 additions and 0 deletions
|
@ -425,7 +425,10 @@ void calculateEstimatedAltitude(uint32_t currentTime)
|
|||
static int32_t baroAlt_offset = 0;
|
||||
float sonarTransition;
|
||||
|
||||
#ifdef SONAR
|
||||
int16_t tiltAngle;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
dTime = currentTime - previousTime;
|
||||
|
@ -442,8 +445,10 @@ void calculateEstimatedAltitude(uint32_t currentTime)
|
|||
|
||||
BaroAlt = baroCalculateAltitude();
|
||||
|
||||
#ifdef SONAR
|
||||
tiltAngle = calculateTiltAngle(&inclination);
|
||||
sonarAlt = sonarCalculateAltitude(sonarAlt, tiltAngle);
|
||||
#endif
|
||||
|
||||
if (sonarAlt > 0 && sonarAlt < 200) {
|
||||
baroAlt_offset = BaroAlt - sonarAlt;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue