mirror of https://github.com/rusefi/rusefi-1.git
auto-sync
This commit is contained in:
parent
8782c80749
commit
574e72bc94
|
@ -86,8 +86,6 @@
|
|||
|
||||
#if EFI_TUNER_STUDIO || defined(__DOXYGEN__)
|
||||
|
||||
#define TS_OUTPUT_SIZE 356
|
||||
|
||||
EXTERN_ENGINE
|
||||
;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#define LE_COMMAND_LENGTH 200
|
||||
#define FSIO_ADC_COUNT 4
|
||||
#define TS_OUTPUT_SIZE 356
|
||||
#define TS_FILE_VERSION 20161225
|
||||
#define WARMUP_TARGET_AFR_SIZE 4
|
||||
#define MAP_ANGLE_SIZE 8
|
||||
|
|
|
@ -31,6 +31,10 @@ struct_no_prefix engine_configuration_s
|
|||
#define LE_COMMAND_LENGTH 200
|
||||
|
||||
#define FSIO_ADC_COUNT 4
|
||||
|
||||
! this is here so that rusEfi console can access it, too
|
||||
#define TS_OUTPUT_SIZE 356
|
||||
|
||||
!
|
||||
! this is used to confirm that firmware and TunerStudio are using the same rusefi.ini version
|
||||
! so not forget to change fileVersion in rusefi.ini
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.rusefi.binaryprotocol;
|
|||
|
||||
import com.rusefi.*;
|
||||
import com.rusefi.config.FieldType;
|
||||
import com.rusefi.config.Fields;
|
||||
import com.rusefi.core.Pair;
|
||||
import com.rusefi.core.Sensor;
|
||||
import com.rusefi.core.SensorCentral;
|
||||
|
@ -28,9 +29,6 @@ import static com.rusefi.binaryprotocol.IoHelper.*;
|
|||
* 3/6/2015
|
||||
*/
|
||||
public class BinaryProtocol {
|
||||
// todo: is this auto-synched with rusefi.ini?
|
||||
public static final int OUTPUT_CHANNELS_SIZE = 276;
|
||||
|
||||
// see BLOCKING_FACTOR in firmware code
|
||||
private static final int BLOCKING_FACTOR = 400;
|
||||
private static final byte RESPONSE_OK = 0;
|
||||
|
@ -266,7 +264,7 @@ public class BinaryProtocol {
|
|||
logger.trace("Got packet size " + packetSize);
|
||||
if (packetSize < 0)
|
||||
return null;
|
||||
if (!allowLongResponse && packetSize > Math.max(BLOCKING_FACTOR, OUTPUT_CHANNELS_SIZE) + 10)
|
||||
if (!allowLongResponse && packetSize > Math.max(BLOCKING_FACTOR, Fields.TS_OUTPUT_SIZE) + 10)
|
||||
return null;
|
||||
|
||||
isTimeout = incomingData.waitForBytes(packetSize + 4, start, msg + " body");
|
||||
|
@ -481,7 +479,7 @@ public class BinaryProtocol {
|
|||
if (isClosed)
|
||||
return;
|
||||
byte[] response = executeCommand(new byte[]{COMMAND_OUTPUTS}, "output channels", false);
|
||||
if (response == null || response.length != (OUTPUT_CHANNELS_SIZE + 1) || response[0] != RESPONSE_OK)
|
||||
if (response == null || response.length != (Fields.TS_OUTPUT_SIZE + 1) || response[0] != RESPONSE_OK)
|
||||
return;
|
||||
|
||||
currentOutputs = response;
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.rusefi.io.tcp;
|
|||
import com.rusefi.FileLog;
|
||||
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||
import com.rusefi.binaryprotocol.IoHelper;
|
||||
import com.rusefi.config.Fields;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.ServerSocket;
|
||||
|
@ -122,11 +123,11 @@ public class BinaryProtocolServer {
|
|||
}
|
||||
} else if (command == BinaryProtocol.COMMAND_OUTPUTS) {
|
||||
|
||||
byte[] response = new byte[1 + BinaryProtocol.OUTPUT_CHANNELS_SIZE];
|
||||
byte[] response = new byte[1 + Fields.TS_OUTPUT_SIZE];
|
||||
response[0] = (byte) TS_OK.charAt(0);
|
||||
byte[] currentOutputs = BinaryProtocol.currentOutputs;
|
||||
if (currentOutputs != null)
|
||||
System.arraycopy(currentOutputs, 1, response, 1, BinaryProtocol.OUTPUT_CHANNELS_SIZE);
|
||||
System.arraycopy(currentOutputs, 1, response, 1, Fields.TS_OUTPUT_SIZE);
|
||||
BinaryProtocol.sendCrcPacket(response, FileLog.LOGGER, stream);
|
||||
} else {
|
||||
FileLog.MAIN.logLine("Error: unknown command " + command);
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.rusefi.io.tcp.test;
|
|||
import com.rusefi.ConfigurationImage;
|
||||
import com.rusefi.FileLog;
|
||||
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||
import com.rusefi.config.Fields;
|
||||
import com.rusefi.io.tcp.BinaryProtocolServer;
|
||||
import com.rusefi.io.tcp.TcpIoStream;
|
||||
|
||||
|
@ -14,7 +15,7 @@ class BinaryProtocolServerSandbox {
|
|||
TcpIoStream stream = new TcpIoStream(new ByteArrayInputStream(new byte[0]), new ByteArrayOutputStream());
|
||||
BinaryProtocol.instance = new BinaryProtocol(FileLog.LOGGER, stream);
|
||||
BinaryProtocol.instance.setController(new ConfigurationImage(new byte[14008]));
|
||||
BinaryProtocol.currentOutputs = new byte[1 + BinaryProtocol.OUTPUT_CHANNELS_SIZE];
|
||||
BinaryProtocol.currentOutputs = new byte[1 + Fields.TS_OUTPUT_SIZE];
|
||||
BinaryProtocolServer.start();
|
||||
}
|
||||
}
|
|
@ -1,9 +1,10 @@
|
|||
package com.rusefi.config;
|
||||
|
||||
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Feb 09 11:38:10 EST 2017
|
||||
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Feb 09 12:25:50 EST 2017
|
||||
public class Fields {
|
||||
public static final int LE_COMMAND_LENGTH = 200;
|
||||
public static final int FSIO_ADC_COUNT = 4;
|
||||
public static final int TS_OUTPUT_SIZE = 356;
|
||||
public static final int TS_FILE_VERSION = 20161225;
|
||||
public static final int WARMUP_TARGET_AFR_SIZE = 4;
|
||||
public static final int MAP_ANGLE_SIZE = 8;
|
||||
|
|
|
@ -44,7 +44,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
|
|||
* @see EngineSnifferPanel
|
||||
*/
|
||||
public class Launcher {
|
||||
public static final int CONSOLE_VERSION = 20170205;
|
||||
public static final int CONSOLE_VERSION = 20170209;
|
||||
public static final boolean SHOW_STIMULATOR = false;
|
||||
private static final String TAB_INDEX = "main_tab";
|
||||
protected static final String PORT_KEY = "port";
|
||||
|
|
Loading…
Reference in New Issue