auto-sync

This commit is contained in:
rusEfi 2015-02-28 19:08:55 -06:00
parent 2cacb9f92c
commit db691c6166
5 changed files with 48 additions and 8 deletions

View File

@ -38,6 +38,8 @@ void setMazda626EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
engineConfiguration->tpsMax = 764;
engineConfiguration->algorithm = LM_ALPHA_N;
setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER);
setTimingLoadBin(0, 100 PASS_ENGINE_PARAMETER);
// set_whole_fuel_map 9
setWholeFuelMap(9 PASS_ENGINE_PARAMETER);

View File

@ -2,6 +2,7 @@ package com.rusefi;
import com.rusefi.io.LinkManager;
import com.rusefi.io.tcp.TcpConnector;
import com.rusefi.maintenance.EraseChip;
import com.rusefi.maintenance.FirmwareFlasher;
import com.rusefi.maintenance.ProcessStatusWindow;
import com.rusefi.ui.util.HorizontalLine;
@ -91,13 +92,12 @@ public class StartupFrame {
if (ProcessStatusWindow.isWindows()) {
leftPanel.add(new HorizontalLine());
leftPanel.add(FirmwareFlasher.getContent());
// leftPanel.add(new HorizontalLine());
// leftPanel.add(new EraseChip().getButton());
}
leftPanel.add(new HorizontalLine());
JPanel rightPanel = new JPanel(new VerticalFlowLayout());
ImageIcon logoIcon = loadIcon(LOGO);
if (logoIcon != null) {
JLabel logo = new JLabel(logoIcon);

View File

@ -0,0 +1,32 @@
package com.rusefi.maintenance;
import javax.swing.*;
import java.awt.event.ActionEvent;
public class EraseChip extends ProcessStatusWindow {
private final JButton button = new JButton("Erase Chip");
private static final String OPEN_OCD_COMMAND = FirmwareFlasher.OPENOCD_BIN +
" -f interface/stlink-v2.cfg -f board/stm32f4discovery.cfg -c init -c targets -c \"halt\" -c \"flash erase_address 0x08000000 0x080000\" -c shutdown";
public EraseChip() {
button.addActionListener(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
if (JOptionPane.showConfirmDialog(button, "Do you really want to reset stm32 chip?") !=
JOptionPane.YES_OPTION)
return;
submitAction(new Runnable() {
@Override
public void run() {
executeCommand(OPEN_OCD_COMMAND);
}
});
}
});
}
public JButton getButton() {
return button;
}
}

View File

@ -12,7 +12,8 @@ import java.io.*;
*/
public class FirmwareFlasher extends ProcessStatusWindow {
private static final String IMAGE_FILE = "rusefi.bin";
private static final String OPEN_OCD_COMMAND = "openocd-0.8.0.exe -f interface/stlink-v2.cfg -f board/stm32f4discovery.cfg -c \"program " +
static final String OPENOCD_BIN = "openocd/bin/openocd-0.8.0.exe";
private static final String OPEN_OCD_COMMAND = OPENOCD_BIN + " -f interface/stlink-v2.cfg -f board/stm32f4discovery.cfg -c \"program " +
IMAGE_FILE +
" verify reset exit 0x08000000\"";
private static final String SUCCESS_MESSAGE_TAG = "shutdown command invoked";
@ -25,14 +26,13 @@ public class FirmwareFlasher extends ProcessStatusWindow {
public void actionPerformed(ActionEvent event) {
showFrame();
Thread openOcdThread = new Thread(new Runnable() {
Runnable runnable = new Runnable() {
@Override
public void run() {
doFlashFirmware();
}
});
openOcdThread.setDaemon(true);
openOcdThread.start();
};
submitAction(runnable);
}
});
}

View File

@ -96,4 +96,10 @@ public class ProcessStatusWindow {
}
return error;
}
protected void submitAction(Runnable runnable) {
Thread thread = new Thread(runnable, "console extProcessThread");
thread.setDaemon(true);
thread.start();
}
}