F4 MCU says it's too cold #2552
This commit is contained in:
parent
2eb46c5504
commit
006d8c3aab
|
@ -1,13 +1,12 @@
|
|||
package com.rusefi.common;
|
||||
|
||||
import com.rusefi.RusefiTestBase;
|
||||
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||
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 com.devexperts.util.TimeUtil.SECOND;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class MiscTest extends RusefiTestBase {
|
||||
|
@ -19,8 +18,13 @@ public class MiscTest extends RusefiTestBase {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testMcuTemperature() {
|
||||
double mcuTemp = SensorCentral.getInstance().getValue(Sensor.INT_TEMP);
|
||||
public void testMcuTemperature() throws InterruptedException {
|
||||
double mcuTemp = Double.NaN;
|
||||
long start = System.currentTimeMillis();
|
||||
while (Double.isNaN(mcuTemp) && (System.currentTimeMillis() - start) < 5 * SECOND) {
|
||||
Thread.sleep(100);
|
||||
mcuTemp = SensorCentral.getInstance().getValue(Sensor.INT_TEMP);
|
||||
}
|
||||
|
||||
System.out.println("MCU temperature is " + mcuTemp + " deg C");
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@ package com.rusefi.core;
|
|||
public interface ISensorCentral extends ISensorHolder {
|
||||
void setAnySensorListener(SensorCentral.SensorListener2 anySensorListener);
|
||||
|
||||
public class ListenerToken {
|
||||
private ISensorCentral sensorCentralInstance;
|
||||
private Sensor sensor;
|
||||
private SensorCentral.SensorListener listener;
|
||||
class ListenerToken {
|
||||
private final ISensorCentral sensorCentralInstance;
|
||||
private final Sensor sensor;
|
||||
private final SensorCentral.SensorListener listener;
|
||||
|
||||
public ListenerToken(ISensorCentral instance, Sensor sensor, SensorCentral.SensorListener listener) {
|
||||
this.sensorCentralInstance = instance;
|
||||
|
|
Loading…
Reference in New Issue