From 21426f7e911fabbb33263ee70152ee93ee0c43c6 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 9 Feb 2021 12:24:44 -0800 Subject: [PATCH] Hw ci mcu temperature (#2324) * this was wrong * test temp sensor * import Co-authored-by: Matthew Kennedy --- .../autotest/src/com/rusefi/common/MiscTest.java | 14 ++++++++++++++ .../src/main/java/com/rusefi/core/Sensor.java | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/java_console/autotest/src/com/rusefi/common/MiscTest.java b/java_console/autotest/src/com/rusefi/common/MiscTest.java index c7be38cf4e..9004d14303 100644 --- a/java_console/autotest/src/com/rusefi/common/MiscTest.java +++ b/java_console/autotest/src/com/rusefi/common/MiscTest.java @@ -1,10 +1,13 @@ package com.rusefi.common; import com.rusefi.RusefiTestBase; +import com.rusefi.core.Sensor; +import com.rusefi.core.SensorCentral; import com.rusefi.binaryprotocol.BinaryProtocol; import com.rusefi.functional_tests.EcuTestHelper; import org.junit.Ignore; import org.junit.Test; +import static org.junit.Assert.assertTrue; public class MiscTest extends RusefiTestBase { @Test @@ -13,4 +16,15 @@ public class MiscTest extends RusefiTestBase { // let's make sure 'burn' command works since sometimes it does not bp.burn(); } + + @Test + public void testMcuTemperature() { + double mcuTemp = SensorCentral.getInstance().getValue(Sensor.INT_TEMP); + + System.out.println("MCU temperature is " + mcuTemp + " deg C"); + + // You are probably indoors and not on fire + assertTrue(mcuTemp > 10); + assertTrue(mcuTemp < 50); + } } diff --git a/java_console/models/src/main/java/com/rusefi/core/Sensor.java b/java_console/models/src/main/java/com/rusefi/core/Sensor.java index 27be0608f1..7acde965cd 100644 --- a/java_console/models/src/main/java/com/rusefi/core/Sensor.java +++ b/java_console/models/src/main/java/com/rusefi/core/Sensor.java @@ -30,7 +30,7 @@ public enum Sensor { VSS(GAUGE_NAME_VVS, SensorCategory.OPERATIONS, FieldType.UINT8, 8, 1, 0, 150, "kph"), // Temperatures - INT_TEMP(GAUGE_NAME_CPU_TEMP, SensorCategory.OPERATIONS, FieldType.INT8, 10, 1, 0, 5, "C"), + INT_TEMP(GAUGE_NAME_CPU_TEMP, SensorCategory.OPERATIONS, FieldType.INT8, 11, 1, 0, 5, "C"), CLT(GAUGE_NAME_CLT, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 12, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"), IAT(GAUGE_NAME_IAT, SensorCategory.SENSOR_INPUTS, FieldType.INT16, 14, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"), AuxT1("AuxT1", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 16, 1.0 / PACK_MULT_TEMPERATURE, -40, 150, "deg C"),