diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index cefc6fc49e..f048dfb820 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -756,7 +756,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->rpmAcceleration = engine->rpmCalculator.getRpmAcceleration(); // offset 108 // For air-interpolated tCharge mode, we calculate a decent massAirFlow approximation, so we can show it to users even without MAF sensor! - tsOutputChannels->massAirFlow = getAirFlowGauge(PASS_ENGINE_PARAMETER_SIGNATURE); + tsOutputChannels->massAirFlow = getAirFlowGauge(PASS_ENGINE_PARAMETER_SIGNATURE); // offset 116 // TPS acceleration tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getMaxDelta(); @@ -793,12 +793,14 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->firmwareVersion = getRusEfiVersion(); // 268 tsOutputChannels->fuelPidCorrection = ENGINE(engineState.running.pidCorrection); - // 276 - tsOutputChannels->accelerationX = engine->sensors.accelerometer.x; - // 278 - tsOutputChannels->accelerationY = engine->sensors.accelerometer.y; - // 288 - tsOutputChannels->injectionOffset = engine->engineState.injectionOffset; + // 276 + tsOutputChannels->accelerationX = engine->sensors.accelerometer.x; + // 278 + tsOutputChannels->accelerationY = engine->sensors.accelerometer.y; + // 280 + tsOutputChannels->oilPressure = Sensor::get(SensorType::OilPressure).Value; + // 288 + tsOutputChannels->injectionOffset = engine->engineState.injectionOffset; if (hasMapSensor(PASS_ENGINE_PARAMETER_SIGNATURE)) { float mapValue = getMap(PASS_ENGINE_PARAMETER_SIGNATURE); diff --git a/firmware/controllers/sensors/functional_sensor.cpp b/firmware/controllers/sensors/functional_sensor.cpp index bc45bb0a9b..2626cbf677 100644 --- a/firmware/controllers/sensors/functional_sensor.cpp +++ b/firmware/controllers/sensors/functional_sensor.cpp @@ -1,12 +1,6 @@ #include "functional_sensor.h" void FunctionalSensor::postRawValue(float inputValue) { - // Report the raw value - float *rawReportLocation = m_rawReportingLocation; - if (rawReportLocation) { - *rawReportLocation = inputValue; - } - // If no function is set, this sensor isn't valid. if (!m_function) { invalidate(); diff --git a/firmware/controllers/sensors/functional_sensor.h b/firmware/controllers/sensors/functional_sensor.h index c9ffe0f5f4..ba3ae92e30 100644 --- a/firmware/controllers/sensors/functional_sensor.h +++ b/firmware/controllers/sensors/functional_sensor.h @@ -30,17 +30,11 @@ public: void postRawValue(float inputValue); - void setRawReportingLocation(float *rawReportingLocation) { - m_rawReportingLocation = rawReportingLocation; - } - void setFunction(SensorConverter& func) { m_function = &func; } private: - float *m_rawReportingLocation = nullptr; - // Conversion function for this sensor SensorConverter* m_function = nullptr; }; diff --git a/firmware/controllers/sensors/stored_value_sensor.h b/firmware/controllers/sensors/stored_value_sensor.h index d8198567ee..597edc56b6 100644 --- a/firmware/controllers/sensors/stored_value_sensor.h +++ b/firmware/controllers/sensors/stored_value_sensor.h @@ -34,15 +34,11 @@ public: return {valid, value}; } - void setReportingLocation(float *reportLocation) { - m_reportingLocation = reportLocation; - } - protected: explicit StoredValueSensor(SensorType type) : Sensor(type) - //, m_reportingLocation(reportingLocation) - {} + { + } // Invalidate the stored value. void invalidate() { @@ -54,17 +50,9 @@ protected: // Set value before valid - so we don't briefly have the valid bit set on an invalid value m_value = value; m_isValid = true; - - // Report value - float *reportLoc = m_reportingLocation; - if (reportLoc) { - *reportLoc = value; - } } private: bool m_isValid = false; float m_value = 0.0f; - - float *m_reportingLocation = nullptr; }; diff --git a/firmware/init/sensor/init_oil_pressure.cpp b/firmware/init/sensor/init_oil_pressure.cpp index f1069ab644..bf7f167c72 100644 --- a/firmware/init/sensor/init_oil_pressure.cpp +++ b/firmware/init/sensor/init_oil_pressure.cpp @@ -33,11 +33,6 @@ void initOilPressure() { oilpSensorFunc.configure(sensorCfg->v1, val1, sensorCfg->v2, val2, /*minOutput*/ -5, greaterOutput); oilpSensor.setFunction(oilpSensorFunc); -#if EFI_TUNER_STUDIO - // Tell it to report to its output channel - oilpSensor.setReportingLocation(&tsOutputChannels.oilPressure); -#endif - // Subscribe the sensor to the ADC AdcSubscription::SubscribeSensor(oilpSensor, channel);