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

28 lines
483 B
C++
Raw Normal View History

#include "engine.h"
#include "Lps25Sensor.h"
#include "rusefi_hw_enums.h"
static Lps25 device;
static Lps25Sensor sensor(device);
void initBaro() {
// If there's already an external (analog) baro sensor configured,
// don't configure the internal one.
if (Sensor::hasSensor(SensorType::BarometricPressure)) {
return;
}
#if HW_PROTEUS
if (device.init(GPIOB_10, GPIOB_11)) {
sensor.Register();
}
#endif
}
void baroUpdate() {
#if EFI_PROD_CODE
sensor.update();
#endif
}