auto-sync
This commit is contained in:
parent
cee8e7aef2
commit
6a20b96ad4
|
@ -23,8 +23,8 @@ void setMazda626EngineConfiguration(engine_configuration_s *engineConfiguration)
|
||||||
boardConfiguration->analogChartMode = AC_TRIGGER;
|
boardConfiguration->analogChartMode = AC_TRIGGER;
|
||||||
engineConfiguration->analogChartFrequency = 2;
|
engineConfiguration->analogChartFrequency = 2;
|
||||||
|
|
||||||
// set_global_trigger_offset_angle -40
|
// set_global_trigger_offset_angle -42
|
||||||
engineConfiguration->globalTriggerAngleOffset = -40;
|
engineConfiguration->globalTriggerAngleOffset = -42;
|
||||||
|
|
||||||
// set_cranking_timing_angle 15
|
// set_cranking_timing_angle 15
|
||||||
engineConfiguration->crankingTimingAngle = 15;
|
engineConfiguration->crankingTimingAngle = 15;
|
||||||
|
|
|
@ -164,7 +164,6 @@ void printSensors(Logging *log, bool fileFormat, Engine *engine) {
|
||||||
reportSensorF(log, fileFormat, "mafr", "kg/hr", getRealMaf(), 2);
|
reportSensorF(log, fileFormat, "mafr", "kg/hr", getRealMaf(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__)
|
#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__)
|
||||||
if (engineConfiguration->hasMapSensor) {
|
if (engineConfiguration->hasMapSensor) {
|
||||||
reportSensorF(log, fileFormat, "MAP", "kPa", getMap(), 2);
|
reportSensorF(log, fileFormat, "MAP", "kPa", getMap(), 2);
|
||||||
|
@ -226,7 +225,6 @@ static void printState(Engine *engine) {
|
||||||
// ITM_SendChar(msg[i]);
|
// ITM_SendChar(msg[i]);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||||
|
|
||||||
int rpm = getRpmE(engine);
|
int rpm = getRpmE(engine);
|
||||||
|
@ -393,8 +391,7 @@ static void showFuelInfo2(float rpm, float engineLoad, Engine *engine) {
|
||||||
scheduleMsg(&logger2, "algo=%s/pump=%s", getEngine_load_mode_e(engineConfiguration->algorithm),
|
scheduleMsg(&logger2, "algo=%s/pump=%s", getEngine_load_mode_e(engineConfiguration->algorithm),
|
||||||
boolToString(enginePins.fuelPumpRelay.getLogicValue()));
|
boolToString(enginePins.fuelPumpRelay.getLogicValue()));
|
||||||
|
|
||||||
scheduleMsg(&logger2, "phase=%f correction=%f", getInjectionAngle(rpm),
|
scheduleMsg(&logger2, "phase=%f correction=%f", getInjectionAngle(rpm), engineConfiguration->globalFuelCorrection);
|
||||||
engineConfiguration->globalFuelCorrection);
|
|
||||||
|
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
scheduleMsg(&logger, "base cranking fuel %f", engineConfiguration->cranking.baseFuel);
|
scheduleMsg(&logger, "base cranking fuel %f", engineConfiguration->cranking.baseFuel);
|
||||||
|
@ -468,6 +465,16 @@ static void initialLedsBlink(void) {
|
||||||
leds[i]->setValue(0);
|
leds[i]->setValue(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int blinkingPeriod = 33;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this is useful to test connectivity
|
||||||
|
*/
|
||||||
|
static void setBlinkingPeriod(int value) {
|
||||||
|
if (value > 0)
|
||||||
|
blinkingPeriod = value;
|
||||||
|
}
|
||||||
|
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* this thread has a lower-then-usual stack size so we cannot afford *print* methods here
|
* this thread has a lower-then-usual stack size so we cannot afford *print* methods here
|
||||||
|
@ -482,9 +489,9 @@ static void blinkingThread(void *arg) {
|
||||||
int delay;
|
int delay;
|
||||||
|
|
||||||
if (getNeedToWriteConfiguration()) {
|
if (getNeedToWriteConfiguration()) {
|
||||||
delay = isConsoleReady() ? 200 : 66;
|
delay = isConsoleReady() ? 6 * blinkingPeriod : 2 * blinkingPeriod;
|
||||||
} else {
|
} else {
|
||||||
delay = isConsoleReady() ? 100 : 33;
|
delay = isConsoleReady() ? 3 * blinkingPeriod : blinkingPeriod;
|
||||||
}
|
}
|
||||||
|
|
||||||
communicationPin.setValue(0);
|
communicationPin.setValue(0);
|
||||||
|
@ -630,6 +637,7 @@ void initStatusLoop(Engine *engine) {
|
||||||
|
|
||||||
addConsoleActionI("subscribe", subscribe);
|
addConsoleActionI("subscribe", subscribe);
|
||||||
addConsoleActionI("unsubscribe", unsubscribe);
|
addConsoleActionI("unsubscribe", unsubscribe);
|
||||||
|
addConsoleActionI("set_led_blinking_period", setBlinkingPeriod);
|
||||||
|
|
||||||
addConsoleAction("status", printStatus);
|
addConsoleAction("status", printStatus);
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
|
@ -59,11 +59,17 @@ public class IoUtil {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is blocking and waits for the next wave chart to arrive
|
||||||
|
*
|
||||||
|
* @return next wave chart in the I/O pipeline
|
||||||
|
*/
|
||||||
private static String getWaveChart() {
|
private static String getWaveChart() {
|
||||||
final CountDownLatch waveChartLatch = new CountDownLatch(1);
|
final CountDownLatch waveChartLatch = new CountDownLatch(1);
|
||||||
|
|
||||||
final AtomicReference<String> result = new AtomicReference<String>();
|
final AtomicReference<String> result = new AtomicReference<>();
|
||||||
|
|
||||||
|
FileLog.MAIN.logLine("waiting for next chart");
|
||||||
LinkManager.engineState.registerStringValueAction(WaveReport.WAVE_CHART, new EngineState.ValueCallback<String>() {
|
LinkManager.engineState.registerStringValueAction(WaveReport.WAVE_CHART, new EngineState.ValueCallback<String>() {
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(String value) {
|
public void onUpdate(String value) {
|
||||||
|
@ -72,7 +78,9 @@ public class IoUtil {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
int timeout = 60;
|
int timeout = 60;
|
||||||
|
long waitStartTime = System.currentTimeMillis();
|
||||||
wait(waveChartLatch, timeout);
|
wait(waveChartLatch, timeout);
|
||||||
|
FileLog.MAIN.logLine("got next chart in " + (System.currentTimeMillis() - waitStartTime) + "ms");
|
||||||
LinkManager.engineState.removeAction(WaveReport.WAVE_CHART);
|
LinkManager.engineState.removeAction(WaveReport.WAVE_CHART);
|
||||||
if (result.get() == null)
|
if (result.get() == null)
|
||||||
throw new IllegalStateException("Chart timeout: " + timeout);
|
throw new IllegalStateException("Chart timeout: " + timeout);
|
||||||
|
@ -158,4 +166,12 @@ public class IoUtil {
|
||||||
|
|
||||||
waitForFirstResponse();
|
waitForFirstResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void sleep(int seconds) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(seconds * 1000L);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new IllegalStateException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue