auto-sync

This commit is contained in:
rusEfi 2016-09-11 23:03:00 -04:00
parent 9a9edb32ef
commit aa2507a5ac
8 changed files with 34 additions and 9 deletions

View File

@ -132,7 +132,8 @@ typedef struct {
int lastErrorCode; // 240
float internalMcuTemperature; // 244
float vvtPosition; // 248
int unused3[6];
int engineMode; // 252
int unused3[5];
} TunerStudioOutputChannels;
#endif /* TUNERSTUDIO_CONFIGURATION_H_ */

View File

@ -149,6 +149,16 @@ EXTERN_ENGINE
static char buf[6];
/**
* This is useful if we are changing engine mode dynamically
* For example http://rusefi.com/forum/viewtopic.php?f=5&t=1085
*/
static int packEngineMode(DECLARE_ENGINE_PARAMETER_F) {
return (engineConfiguration->fuelAlgorithm << 4) +
(engineConfiguration->injectionMode << 2) +
engineConfiguration->ignitionMode;
}
static void printSensors(Logging *log, bool fileFormat) {
// current time, in milliseconds
int nowMs = currentTimeMillis();
@ -168,6 +178,8 @@ static void printSensors(Logging *log, bool fileFormat) {
reportSensorF(log, fileFormat, "int_temp", "C", getMCUInternalTemperature(), 2); // log column #3
#endif
reportSensorI(log, fileFormat, "mode", "v", packEngineMode(PASS_ENGINE_PARAMETER_F)); // log column #3
if (engineConfiguration->hasCltSensor) {
reportSensorF(log, fileFormat, "CLT", "C", getCoolantTemperature(PASS_ENGINE_PARAMETER_F), 2); // log column #4
}
@ -714,6 +726,8 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->vvtPosition = engine->triggerCentral.vvtPosition;
tsOutputChannels->engineMode = packEngineMode(PASS_ENGINE_PARAMETER_F);
#if EFI_PROD_CODE || defined(__DOXYGEN__)
tsOutputChannels->internalMcuTemperature = getMCUInternalTemperature();
tsOutputChannels->idlePosition = getIdlePosition();

View File

@ -1,4 +1,4 @@
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Sep 11 20:11:57 EDT 2016
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Sep 11 22:19:47 EDT 2016
// begin
#ifndef ENGINE_CONFIGURATION_GENERATED_H_
#define ENGINE_CONFIGURATION_GENERATED_H_
@ -1406,7 +1406,7 @@ typedef struct {
*/
float tachPulseDuractionMs;
/**
* trigger cycle index at which we start tach pulse (performance consideration)
* Trigger cycle index at which we start tach pulse (performance consideration)
* offset 1820
*/
int tachPulseTriggerIndex;
@ -1930,4 +1930,4 @@ typedef struct {
#endif
// end
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Sep 11 20:11:57 EDT 2016
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Sep 11 22:19:47 EDT 2016

View File

@ -442,7 +442,7 @@ custom adc_channel_mode_e 4 bits, U32, @OFFSET@, [0:1], "Off", "Slow", "Fas
ego_sensor_e afr_type;AFR, WBO, EGO - whatever you like to call it;
int etbDT;
pin_output_mode_e hip9011CsPinMode;
brain_pin_e tachOutputPin;This implementation produces one pulse per engine cycle. See also dizzySparkOutputPin.
brain_pin_e tachOutputPin;+This implementation produces one pulse per engine cycle. See also dizzySparkOutputPin.
pin_output_mode_e tachOutputPinMode;
brain_input_pin_e[3 iterate] triggerInputPins;
@ -651,7 +651,7 @@ baro_corr_table_t baroCorrTable;
float[CRANKING_CURVE_SIZE] crankingTpsBins;;"%", 1, 0, 0.0, 100.0, 2
float tachPulseDuractionMs;;"ms", 1, 0, 0.0, 100.0, 2
int tachPulseTriggerIndex;trigger cycle index at which we start tach pulse (performance consideration);"index", 1, 0, 0.0, 360.0, 0
int tachPulseTriggerIndex;+Trigger cycle index at which we start tach pulse (performance consideration);"index", 1, 0, 0.0, 360.0, 0
float suckedOffCoef;;"%", 1, 0, 0.0, 300.0, 2
float[7] unused71;TODO make suckedOffCoef an array by RPM;
@ -714,7 +714,7 @@ baro_corr_table_t baroCorrTable;
float[MAP_ACCEL_TAPER] mapAccelTaperBins;;"counter", 1, 0, 0.0, 300, 0
float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0.0, 300, 2
brain_pin_e dizzySparkOutputPin;This implementation makes a pulse every time one of the coils is charged. See also tachOutputPin
brain_pin_e dizzySparkOutputPin;+This implementation makes a pulse every time one of the coils is charged. See also tachOutputPin
pin_output_mode_e dizzySparkOutputPinMode;
adc_channel_e[FSIO_ADC_COUNT iterate] fsioAdc;
float fixedTiming;Fixed timing, useful for TDC testing;"deg", 1, 0, -720, 720, 2

View File

@ -42,7 +42,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Sep 11 20:11:57 EDT 2016
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Sep 11 22:19:47 EDT 2016
pageSize = 16376
page = 1
@ -702,6 +702,7 @@ page = 1
fanOffTemperature = "Cooling fan turn-off temperature threshold, in Celsuis"
vehicleSpeedCoef = "This coefficient translates vehicle speed input frequency (in Hz) into vehicle speed, km/h"
trigger_useOnlyFirstChannel = "This option could be used if your second trigger channel is broken"
tachOutputPin = "This implementation produces one pulse per engine cycle. See also dizzySparkOutputPin."
vvtCamSensorUseRise = "Use rise or fall signal front"
sensorChartMode = "rusEfi console Sensor Sniffer mode"
isCylinderCleanupEnabled = "If TPS above 95% no fuel would be injected during cranking"
@ -710,7 +711,9 @@ page = 1
twoWireBatchIgnition = "This is needed if batched igniton (waster spark) and individual coil wiring"
ignMathCalculateAtIndex = "At what trigger index should some ignition-related math be executed? This is a performance trick to reduce load on synchronization trigger callback."
mapAveragingSchedulingAtIndex = "At what trigger index should some MAP-related math be executed? This is a performance trick to reduce load on synchronization trigger callback."
tachPulseTriggerIndex = "Trigger cycle index at which we start tach pulse (performance consideration)"
slowAdcAlpha = "ExpAverage alpha coefficient"
dizzySparkOutputPin = "This implementation makes a pulse every time one of the coils is charged. See also tachOutputPin"
; CONFIG_DEFINITION_END

View File

@ -127,6 +127,7 @@ public enum Sensor {
SPEED2RPM(SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 232, BackgroundColor.MUD, 0, 5),
INT_TEMP(SensorCategory.OPERATIONS, FieldType.FLOAT, 244, BackgroundColor.MUD, 0, 5),
vvtPosition(SensorCategory.SENSOR_INPUTS, FieldType.FLOAT, 248, BackgroundColor.MUD, 0, 5),
engineMode(SensorCategory.OPERATIONS, FieldType.INT, 252, BackgroundColor.MUD, 0, 5),
INJ_1_2_DELTA("inj 1-2 delta", SensorCategory.SNIFFING),
INJ_3_4_DELTA("inj 3-4 delta", SensorCategory.SNIFFING),

View File

@ -17,6 +17,7 @@ public class SensorLogger {
private static Sensor[] SENSORS = {Sensor.RPM,
Sensor.INT_TEMP,
Sensor.engineMode,
Sensor.CLT,
Sensor.TPS,
Sensor.VBATT,
@ -52,6 +53,7 @@ public class SensorLogger {
Sensor.runningFuel,
Sensor.injectorLagMs,
Sensor.vvtPosition,
Sensor.VSS,
Sensor.SPEED2RPM,

View File

@ -280,7 +280,9 @@ public class EngineSnifferPanel {
private UpDownImage createImage(final String name) {
Color signalBody = Color.lightGray;
Color signalBorder = Color.blue;
if (name.startsWith("t")) {
if (name.startsWith("tach") || name.startsWith("dizzy")) {
signalBody = Color.yellow;
} else if (name.startsWith("t")) {
// trigger
} else if (name.startsWith("c")) {
// coil
@ -290,6 +292,8 @@ public class EngineSnifferPanel {
} else if (name.startsWith("i")) {
// injection
signalBody = Color.green;
} else if (name.startsWith("map")) {
signalBody = Color.gray;
} else {
signalBody = Color.gray;
}