mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-30 12:38:33 -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__)
|
||||
// on AVR use a less exact, but faster, calculation
|
||||
#if HAL_CPU_CLASS <= HAL_CPU_CLASS_16
|
||||
// on slower CPUs use a less exact, but faster, calculation
|
||||
scaling = (float)_ground_pressure / (float)get_pressure();
|
||||
temp = ((float)_ground_temperature) + 273.15f;
|
||||
_altitude = logf(scaling) * temp * 29.271267f;
|
||||
|
Loading…
Reference in New Issue
Block a user