From fcef353b129e455123fe842a8751d76b198fd6b8 Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 3 Apr 2020 16:14:29 -0400 Subject: [PATCH] could this work? --- firmware/controllers/algo/engine2.cpp | 2 ++ firmware/controllers/can/can_rx.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/firmware/controllers/algo/engine2.cpp b/firmware/controllers/algo/engine2.cpp index 93db31a200..6a75fa446e 100644 --- a/firmware/controllers/algo/engine2.cpp +++ b/firmware/controllers/algo/engine2.cpp @@ -118,7 +118,9 @@ void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engine->sensors.iat = getIntakeAirTemperatureM(PASS_ENGINE_PARAMETER_SIGNATURE); +#if !EFI_CANBUS_SLAVE engine->sensors.clt = getCoolantTemperatureM(PASS_ENGINE_PARAMETER_SIGNATURE); +#endif /* EFI_CANBUS_SLAVE */ // todo: reduce code duplication with 'getCoolantTemperature' if (engineConfiguration->auxTempSensor1.adcChannel != EFI_ADC_NONE) { diff --git a/firmware/controllers/can/can_rx.cpp b/firmware/controllers/can/can_rx.cpp index b4b269efe2..ca895752c5 100644 --- a/firmware/controllers/can/can_rx.cpp +++ b/firmware/controllers/can/can_rx.cpp @@ -60,6 +60,10 @@ void processCanRxMessage(const CANRxFrame& frame, Logging* logger, efitick_t now } else if (frame.EID == CONFIG(verboseCanBaseAddress) + CAN_SENSOR_1_OFFSET) { int16_t mapScaled = *reinterpret_cast(&frame.data8[0]); canMap = mapScaled / (1.0 * PACK_MULT_PRESSURE); + uint8_t cltShifted = *reinterpret_cast(&frame.data8[2]); +#if EFI_CANBUS_SLAVE + engine->sensors.clt = cltShifted - PACK_ADD_TEMPERATURE; +#endif /* EFI_CANBUS_SLAVE */ } else { obdOnCanPacketRx(frame); }