Hw ci mcu temperature (#2324)

* this was wrong

* test temp sensor

* import

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2021-02-09 12:24:44 -08:00 committed by GitHub
parent 9fb101186a
commit 21426f7e91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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"),