rusefi-1/firmware/init/sensor/init_baro.cpp

28 lines
547 B
C++
Raw Normal View History

#include "engine.h"
#include "Lps25Sensor.h"
#include "rusefi_hw_enums.h"
EXTERN_ENGINE;
static Lps25 device;
static Lps25Sensor sensor(device);
void initBaro(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// If there's already an external (analog) baro sensor configured,
// don't configure the internal one.
if (Sensor::hasSensor(SensorType::BarometricPressure)) {
return;
}
2021-04-28 15:28:07 -07:00
if (device.init(CONFIG(lps25BaroSensorScl), CONFIG(lps25BaroSensorSda))) {
sensor.Register();
}
}
void baroUpdate() {
#if EFI_PROD_CODE
sensor.update();
#endif
}