diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 87593e1d2e..47bb5c33fc 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -288,7 +288,7 @@ void Engine::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) { fuelLevelVoltage); } - sensors.vBatt = Sensor::get(SensorType::BatteryVoltage).value_or(12); + sensors.vBatt = Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE); #if (BOARD_TLE8888_COUNT > 0) // nasty value injection into C driver which would not be able to access Engine class diff --git a/firmware/controllers/algo/engine_parts.h b/firmware/controllers/algo/engine_parts.h index 581b08a839..1bb92e2434 100644 --- a/firmware/controllers/algo/engine_parts.h +++ b/firmware/controllers/algo/engine_parts.h @@ -36,7 +36,7 @@ public: Accelerometer accelerometer; - // todo: remove this variable, replace with Sensor::get(SensorType::vbatt).value_or(VBAT_FALLBACK_VALUE) + // todo: remove this variable, replace with Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE) // todo: https://github.com/rusefi/rusefi/issues/2260 float vBatt = 0; /** diff --git a/firmware/controllers/sensors/sensor_type.h b/firmware/controllers/sensors/sensor_type.h index d2b1368e94..c499a545be 100644 --- a/firmware/controllers/sensors/sensor_type.h +++ b/firmware/controllers/sensors/sensor_type.h @@ -8,6 +8,8 @@ #pragma once +#define VBAT_FALLBACK_VALUE 12 + /** ************************************** * SEE sensor.h ON HOW TO ADD NEW SENSOR TYPES