mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 15:23:57 -04:00
AP_Baro: use HAL_CPU_CLASS in baro driver
This commit is contained in:
parent
ea649e036b
commit
5e3c4441dc
@ -142,8 +142,8 @@ float AP_Baro::get_altitude(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
#if HAL_CPU_CLASS <= HAL_CPU_CLASS_16
|
||||||
// on AVR use a less exact, but faster, calculation
|
// on slower CPUs use a less exact, but faster, calculation
|
||||||
scaling = (float)_ground_pressure / (float)get_pressure();
|
scaling = (float)_ground_pressure / (float)get_pressure();
|
||||||
temp = ((float)_ground_temperature) + 273.15f;
|
temp = ((float)_ground_temperature) + 273.15f;
|
||||||
_altitude = logf(scaling) * temp * 29.271267f;
|
_altitude = logf(scaling) * temp * 29.271267f;
|
||||||
|
Loading…
Reference in New Issue
Block a user