auto-sync

This commit is contained in:
rusEfi 2015-03-01 11:07:24 -06:00
parent b653419a0e
commit c3f848b670
5 changed files with 23 additions and 7 deletions

View File

@ -23,7 +23,7 @@ void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
/**
* Frankenso analog #1 PC2 ADC12 CLT
* Frankenso analog #2 PC1 ADC11 IAT
* Frankenso analog #3 PA0 ADC0
* Frankenso analog #3 PA0 ADC0 MAP
* Frankenso analog #4 PC3 ADC13 WBO / O2
* Frankenso analog #5 PA2 ADC2 TPS
* Frankenso analog #6 PA1 ADC1
@ -36,8 +36,10 @@ void setCustomEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
*/
engineConfiguration->tpsAdcChannel = EFI_ADC_2;
boardConfiguration->adcHwChannelEnabled[4] = ADC_FAST;
engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
boardConfiguration->adcHwChannelEnabled[0] = ADC_FAST;
engineConfiguration->map.sensor.hwChannel = EFI_ADC_0;
boardConfiguration->adcHwChannelEnabled[4] = ADC_SLOW;
engineConfiguration->cltAdcChannel = EFI_ADC_12;
engineConfiguration->iatAdcChannel = EFI_ADC_11;

View File

@ -97,6 +97,8 @@ static FastInterpolation *getDecoder(air_pressure_sensor_type_e type) {
return &honda3bar;
case MT_DODGE_NEON_2003:
return &dodgeNeon2003;
case MT_SUBY_DENSO:
return &subyDenso;
default:
firmwareError("Unknown MAP type: %d", type);
return &customMap;

View File

@ -18,7 +18,9 @@ import java.util.concurrent.LinkedBlockingQueue;
@SuppressWarnings("FieldCanBeLocal")
public class CommandQueue {
private static final String CONFIRMATION_PREFIX = "confirmation_";
public static final int DEFAULT_TIMEOUT = 300;
public static final int DEFAULT_TIMEOUT = 500;
private static final int COMMAND_CONFIRMATION_TIMEOUT = 1000;
private static final int SLOW_CONFIRMATION_TIMEOUT = 5000;
private final Object lock = new Object();
private String latestConfirmation;
@ -43,6 +45,15 @@ public class CommandQueue {
}
};
private static boolean isSlowCommand(String cmd) {
String lc = cmd.toLowerCase();
return lc.startsWith("set_engine_type") || lc.startsWith("writeconfig") || lc.startsWith("rewriteconfig");
}
public static int getTimeout(String cmd) {
return isSlowCommand(cmd) ? SLOW_CONFIRMATION_TIMEOUT : COMMAND_CONFIRMATION_TIMEOUT;
}
public void addListener(CommandQueueListener listener) {
commandListeners.add(listener);
}

View File

@ -88,7 +88,8 @@ public class RecentCommands {
@Override
public void actionPerformed(ActionEvent e) {
reentrant = true;
CommandQueue.getInstance().write(entry.command);
int timeout = CommandQueue.getTimeout(entry.command);
CommandQueue.getInstance().write(entry.command, timeout);
reentrant = false;
}
});

View File

@ -15,7 +15,6 @@ import java.awt.event.ActionListener;
* (c) Andrey Belomutskiy
*/
public class AnyCommand {
private static final int COMMAND_CONFIRMATION_TIMEOUT = 1000;
public static final String KEY = "last_value";
private final JTextField text = new JTextField() {
@Override
@ -45,7 +44,8 @@ public class AnyCommand {
String cmd = text.getText();
if (!isValidInput(text))
return;
CommandQueue.getInstance().write(cmd.toLowerCase(), COMMAND_CONFIRMATION_TIMEOUT);
int timeout = CommandQueue.getTimeout(cmd);
CommandQueue.getInstance().write(cmd.toLowerCase(), timeout);
}
});
text.getDocument().addDocumentListener(new DocumentListener() {