auto-sync
This commit is contained in:
parent
a377cc61eb
commit
2f3f98b5d2
|
@ -32,6 +32,9 @@
|
||||||
#include "wave_analyzer.h"
|
#include "wave_analyzer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// see RUS_EFI_VERSION_TAG in console source code
|
||||||
|
#define RUS_EFI_VERSION_TAG "rusEfiVersion"
|
||||||
|
|
||||||
#include "trigger_central.h"
|
#include "trigger_central.h"
|
||||||
#include "engine_state.h"
|
#include "engine_state.h"
|
||||||
#include "io_pins.h"
|
#include "io_pins.h"
|
||||||
|
@ -302,8 +305,10 @@ static void printInfo(systime_t nowSeconds) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
timeOfPreviousPrintVersion = nowSeconds;
|
timeOfPreviousPrintVersion = nowSeconds;
|
||||||
appendPrintf(&logger, "rusEfiVersion%s%d@%s %s%s", DELIMETER, getRusEfiVersion(), VCS_VERSION,
|
appendPrintf(&logger, "%s%s%d@%s %s %d%s", RUS_EFI_VERSION_TAG, DELIMETER,
|
||||||
|
getRusEfiVersion(), VCS_VERSION,
|
||||||
getConfigurationName(engineConfiguration->engineType),
|
getConfigurationName(engineConfiguration->engineType),
|
||||||
|
getTimeNowSeconds(),
|
||||||
DELIMETER);
|
DELIMETER);
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||||
printOutPin(CRANK1, boardConfiguration->triggerInputPins[0]);
|
printOutPin(CRANK1, boardConfiguration->triggerInputPins[0]);
|
||||||
|
|
|
@ -54,7 +54,8 @@ public class BinaryProtocol {
|
||||||
private final IncomingDataBuffer incomingData;
|
private final IncomingDataBuffer incomingData;
|
||||||
private boolean isBurnPending;
|
private boolean isBurnPending;
|
||||||
|
|
||||||
private final Object lock = new Object();
|
private final Object ioLock = new Object();
|
||||||
|
private final Object imageLock = new Object();
|
||||||
private ConfigurationImage controller;
|
private ConfigurationImage controller;
|
||||||
|
|
||||||
// todo: fix this, this is HORRIBLE!
|
// todo: fix this, this is HORRIBLE!
|
||||||
|
@ -185,7 +186,7 @@ public class BinaryProtocol {
|
||||||
dropPending();
|
dropPending();
|
||||||
|
|
||||||
stream.write((SWITCH_TO_BINARY_COMMAND + "\n").getBytes());
|
stream.write((SWITCH_TO_BINARY_COMMAND + "\n").getBytes());
|
||||||
synchronized (lock) {
|
synchronized (ioLock) {
|
||||||
boolean isTimeout = incomingData.waitForBytes(2, start, "switch to binary");
|
boolean isTimeout = incomingData.waitForBytes(2, start, "switch to binary");
|
||||||
if (isTimeout) {
|
if (isTimeout) {
|
||||||
close();
|
close();
|
||||||
|
@ -211,7 +212,7 @@ public class BinaryProtocol {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dropPending() throws IOException {
|
private void dropPending() throws IOException {
|
||||||
synchronized (lock) {
|
synchronized (ioLock) {
|
||||||
if (isClosed)
|
if (isClosed)
|
||||||
return;
|
return;
|
||||||
incomingData.dropPending();
|
incomingData.dropPending();
|
||||||
|
@ -246,7 +247,7 @@ public class BinaryProtocol {
|
||||||
|
|
||||||
private byte[] receivePacket(String msg, boolean allowLongResponse) throws InterruptedException, EOFException {
|
private byte[] receivePacket(String msg, boolean allowLongResponse) throws InterruptedException, EOFException {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
synchronized (lock) {
|
synchronized (ioLock) {
|
||||||
boolean isTimeout = incomingData.waitForBytes(2, start, msg + " header");
|
boolean isTimeout = incomingData.waitForBytes(2, start, msg + " header");
|
||||||
if (isTimeout)
|
if (isTimeout)
|
||||||
return null;
|
return null;
|
||||||
|
@ -263,11 +264,8 @@ public class BinaryProtocol {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
byte[] packet = new byte[packetSize];
|
byte[] packet = new byte[packetSize];
|
||||||
int packetCrc;
|
|
||||||
synchronized (lock) {
|
|
||||||
incomingData.getData(packet);
|
incomingData.getData(packet);
|
||||||
packetCrc = swap32(incomingData.getInt());
|
int packetCrc = swap32(incomingData.getInt());
|
||||||
}
|
|
||||||
int actualCrc = crc32(packet);
|
int actualCrc = crc32(packet);
|
||||||
|
|
||||||
boolean isCrcOk = actualCrc == packetCrc;
|
boolean isCrcOk = actualCrc == packetCrc;
|
||||||
|
@ -393,13 +391,13 @@ public class BinaryProtocol {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setController(ConfigurationImage controller) {
|
public void setController(ConfigurationImage controller) {
|
||||||
synchronized (lock) {
|
synchronized (imageLock) {
|
||||||
this.controller = controller.clone();
|
this.controller = controller.clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigurationImage getController() {
|
public ConfigurationImage getController() {
|
||||||
synchronized (lock) {
|
synchronized (imageLock) {
|
||||||
if (controller == null)
|
if (controller == null)
|
||||||
return null;
|
return null;
|
||||||
return controller.clone();
|
return controller.clone();
|
||||||
|
|
|
@ -32,7 +32,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
||||||
* @see com.rusefi.StartupFrame
|
* @see com.rusefi.StartupFrame
|
||||||
*/
|
*/
|
||||||
public class Launcher {
|
public class Launcher {
|
||||||
public static final int CONSOLE_VERSION = 20150823;
|
public static final int CONSOLE_VERSION = 20150830;
|
||||||
public static final boolean SHOW_STIMULATOR = false;
|
public static final boolean SHOW_STIMULATOR = false;
|
||||||
private static final String TAB_INDEX = "main_tab";
|
private static final String TAB_INDEX = "main_tab";
|
||||||
protected static final String PORT_KEY = "port";
|
protected static final String PORT_KEY = "port";
|
||||||
|
|
Loading…
Reference in New Issue