auto-sync
This commit is contained in:
parent
a44125366b
commit
224bf325a7
|
@ -181,7 +181,7 @@ void setHondaAccordConfigurationTwoWires(DECLARE_ENGINE_PARAMETER_F) {
|
|||
|
||||
void setHondaAccordConfigurationThreeWires(DECLARE_ENGINE_PARAMETER_F) {
|
||||
engineConfiguration->engineType = HONDA_ACCORD_CD;
|
||||
engineConfiguration->trigger.type = TT_HONDA_ACCORD_CD;
|
||||
engineConfiguration->trigger.type = TT_HONDA_4_24_1;
|
||||
setHondaAccordConfigurationCommon(PASS_ENGINE_PARAMETER_F);
|
||||
}
|
||||
|
||||
|
|
|
@ -157,8 +157,8 @@ case TT_ONE_PLUS_ONE:
|
|||
return "TT_ONE_PLUS_ONE";
|
||||
case TT_GM_7X:
|
||||
return "TT_GM_7X";
|
||||
case TT_HONDA_ACCORD_CD:
|
||||
return "TT_HONDA_ACCORD_CD";
|
||||
case TT_HONDA_4_24_1:
|
||||
return "TT_HONDA_4_24_1";
|
||||
case TT_HONDA_1_24:
|
||||
return "TT_HONDA_1_24";
|
||||
case TT_HONDA_ACCORD_1_24_SHIFTED:
|
||||
|
@ -169,8 +169,8 @@ case TT_36_2_2_2:
|
|||
return "TT_36_2_2_2";
|
||||
case TT_HONDA_ACCORD_CD_DIP:
|
||||
return "TT_HONDA_ACCORD_CD_DIP";
|
||||
case TT_HONDA_ACCORD_CD_TWO_WIRES:
|
||||
return "TT_HONDA_ACCORD_CD_TWO_WIRES";
|
||||
case TT_HONDA_4_24:
|
||||
return "TT_HONDA_4_24";
|
||||
case TT_MAZDA_MIATA_NA:
|
||||
return "TT_MAZDA_MIATA_NA";
|
||||
case TT_MAZDA_MIATA_NB1:
|
||||
|
|
|
@ -160,11 +160,12 @@ typedef enum {
|
|||
TT_TOOTHED_WHEEL_60_2 = 8,
|
||||
TT_TOOTHED_WHEEL_36_1 = 9,
|
||||
|
||||
TT_HONDA_ACCORD_CD = 10,
|
||||
TT_HONDA_4_24_1 = 10,
|
||||
|
||||
TT_MITSU = 11,
|
||||
|
||||
TT_HONDA_ACCORD_CD_TWO_WIRES = 12,
|
||||
// this makes sense because mechanical spark distribution does not require synchronization
|
||||
TT_HONDA_4_24 = 12,
|
||||
|
||||
TT_HONDA_ACCORD_CD_DIP = 13,
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "trigger_honda.h"
|
||||
#include "trigger_universal.h"
|
||||
|
||||
#define S24 (720.0f / 24 / 2)
|
||||
|
||||
|
@ -96,12 +97,18 @@ void configureHondaAccordCDDip(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
||||
void configureHonda_1_24(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
|
||||
/**
|
||||
* '1' is conditional
|
||||
* '4' is conditional
|
||||
* '24' is always secondary channel
|
||||
*/
|
||||
void configureHonda_1_4_24(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
|
||||
trigger_wheel_e const oneEventWave,
|
||||
trigger_wheel_e const fourEventWave,
|
||||
float prefix DECLARE_ENGINE_PARAMETER_S) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
|
||||
float sb = 5.0f + prefix;
|
||||
|
||||
float tdcWidth = 0.1854 * 720 / 4;
|
||||
|
@ -271,3 +278,22 @@ void configureHondaAccordShifted(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
|
|||
s->isSynchronizationNeeded = false;
|
||||
}
|
||||
|
||||
void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_S) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||
|
||||
int totalTeethCount = 16;
|
||||
int skippedCount = 0;
|
||||
|
||||
s->addEvent2(2, T_PRIMARY, TV_RISE PASS_ENGINE_PARAMETER);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 2, 20 PASS_ENGINE_PARAMETER);
|
||||
s->addEvent2(20, T_PRIMARY, TV_FALL PASS_ENGINE_PARAMETER);
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 0, 360, 20, NO_RIGHT_FILTER PASS_ENGINE_PARAMETER);
|
||||
|
||||
addSkippedToothTriggerEvents(T_SECONDARY, s, totalTeethCount, skippedCount, 0.5, 360, 360, NO_LEFT_FILTER,
|
||||
NO_RIGHT_FILTER PASS_ENGINE_PARAMETER);
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,11 +13,13 @@
|
|||
void configureHondaAccordCDDip(TriggerShape *s DECLARE_ENGINE_PARAMETER_S);
|
||||
void configureHondaAccordShifted(TriggerShape *s DECLARE_ENGINE_PARAMETER_S);
|
||||
|
||||
void configureHonda_1_24(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
|
||||
void configureHonda_1_4_24(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
|
||||
trigger_wheel_e const oneEventWave,
|
||||
trigger_wheel_e const fourEventWave,
|
||||
float d DECLARE_ENGINE_PARAMETER_S);
|
||||
|
||||
void configureOnePlus16(TriggerShape *s, operation_mode_e operationMode DECLARE_ENGINE_PARAMETER_S);
|
||||
|
||||
void configureHondaCbr600(TriggerShape *s DECLARE_ENGINE_PARAMETER_S);
|
||||
void configureHondaCbr600custom(TriggerShape *s DECLARE_ENGINE_PARAMETER_S);
|
||||
|
||||
|
|
|
@ -522,16 +522,16 @@ void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMET
|
|||
setToothedWheelConfiguration(triggerShape, 36, 1, engineConfiguration->operationMode PASS_ENGINE_PARAMETER);
|
||||
break;
|
||||
|
||||
case TT_HONDA_ACCORD_CD:
|
||||
configureHonda_1_24(triggerShape, true, true, T_CHANNEL_3, T_PRIMARY, 0 PASS_ENGINE_PARAMETER);
|
||||
case TT_HONDA_4_24_1:
|
||||
configureHonda_1_4_24(triggerShape, true, true, T_CHANNEL_3, T_PRIMARY, 0 PASS_ENGINE_PARAMETER);
|
||||
break;
|
||||
|
||||
case TT_HONDA_ACCORD_CD_TWO_WIRES:
|
||||
configureHonda_1_24(triggerShape, false, true, T_CHANNEL_3, T_PRIMARY, 0 PASS_ENGINE_PARAMETER);
|
||||
case TT_HONDA_4_24:
|
||||
configureHonda_1_4_24(triggerShape, false, true, T_NONE, T_PRIMARY, 0 PASS_ENGINE_PARAMETER);
|
||||
break;
|
||||
|
||||
case TT_HONDA_1_24:
|
||||
configureHonda_1_24(triggerShape, true, false, T_PRIMARY, T_PRIMARY, 10 PASS_ENGINE_PARAMETER);
|
||||
configureHonda_1_4_24(triggerShape, true, false, T_PRIMARY, T_NONE, 10 PASS_ENGINE_PARAMETER);
|
||||
break;
|
||||
|
||||
case TT_HONDA_ACCORD_1_24_SHIFTED:
|
||||
|
|
|
@ -338,7 +338,7 @@ struct trigger_config_s @brief Trigger wheel(s) configuration
|
|||
|
||||
custom bool32_t 4 bits, U32, @OFFSET@, [0:0], "false", "true"
|
||||
|
||||
#define trigger_type_e_enum "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Accord 1+24", "DODGE STRATUS", "36_2_2_2", "Nissan", "2JZ", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "2003 neon crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "trg38", "trg39", "INVALID"
|
||||
#define trigger_type_e_enum "custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "Miata NB", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Honda 4+24+1", "Mitsubishi", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Honda 1+24", "Dodge Stratus", "36_2_2_2", "Nissan", "2JZ", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "Dodge Neon 2003 crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "trg38", "trg39", "INVALID"
|
||||
|
||||
custom trigger_type_e 4 bits, U32, @OFFSET@, [0:5], @@trigger_type_e_enum@@
|
||||
trigger_type_e type;set trigger_type X
|
||||
|
|
|
@ -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 Mon Feb 13 21:22:31 EST 2017
|
||||
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Feb 13 23:36:28 EST 2017
|
||||
|
||||
pageSize = 16376
|
||||
page = 1
|
||||
|
@ -155,7 +155,7 @@ page = 1
|
|||
tpsAdcChannel = bits, U32, 524, [0:4] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "Disabled", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
||||
;skipping overrideCrankingIgnition offset 528
|
||||
sensorChartFrequency = scalar, S32, 532, "index", 1, 0, 0, 300, 0 ; size 4
|
||||
trigger_type = bits, U32, 536, [0:5], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Accord 1+24", "DODGE STRATUS", "36_2_2_2", "Nissan", "2JZ", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "2003 neon crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "trg38", "trg39", "INVALID"
|
||||
trigger_type = bits, U32, 536, [0:5], "custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "Miata NB", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Honda 4+24+1", "Mitsubishi", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Honda 1+24", "Dodge Stratus", "36_2_2_2", "Nissan", "2JZ", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "Dodge Neon 2003 crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "trg38", "trg39", "INVALID"
|
||||
trigger_unusedCustomIsSynchronizationNeeded= bits, U32, 540, [0:0], "false", "true"
|
||||
trigger_unusedCustomNeedSecondTriggerInput= bits, U32, 540, [1:1], "false", "true"
|
||||
trigger_useOnlyFirstChannel= bits, U32, 540, [2:2], "false", "true"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.rusefi.config;
|
||||
|
||||
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Feb 13 21:22:31 EST 2017
|
||||
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Feb 13 23:36:28 EST 2017
|
||||
public class Fields {
|
||||
public static final int LE_COMMAND_LENGTH = 200;
|
||||
public static final int FSIO_ADC_COUNT = 4;
|
||||
|
@ -1116,7 +1116,7 @@ public class Fields {
|
|||
public static final Field TPSADCCHANNEL = Field.create("TPSADCCHANNEL", 524, FieldType.INT, adc_channel_e);
|
||||
public static final Field OVERRIDECRANKINGIGNITION = Field.create("OVERRIDECRANKINGIGNITION", 528, FieldType.INT);
|
||||
public static final Field SENSORCHARTFREQUENCY = Field.create("SENSORCHARTFREQUENCY", 532, FieldType.INT);
|
||||
public static final String[] trigger_type_e = {"custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Accord 1+24", "DODGE STRATUS", "36_2_2_2", "Nissan", "2JZ", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "2003 neon crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "trg38", "trg39", "INVALID"};
|
||||
public static final String[] trigger_type_e = {"custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "Miata NB", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Honda 4+24+1", "Mitsubishi", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Honda 1+24", "Dodge Stratus", "36_2_2_2", "Nissan", "2JZ", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "Dodge Neon 2003 crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "trg38", "trg39", "INVALID"};
|
||||
public static final Field TRIGGER_TYPE = Field.create("TRIGGER_TYPE", 536, FieldType.INT, trigger_type_e);
|
||||
public static final Field TRIGGER_UNUSEDCUSTOMISSYNCHRONIZATIONNEEDED = Field.create("TRIGGER_UNUSEDCUSTOMISSYNCHRONIZATIONNEEDED", 540, FieldType.BIT, 0);
|
||||
public static final Field TRIGGER_UNUSEDCUSTOMNEEDSECONDTRIGGERINPUT = Field.create("TRIGGER_UNUSEDCUSTOMNEEDSECONDTRIGGERINPUT", 540, FieldType.BIT, 1);
|
||||
|
|
|
@ -25,9 +25,8 @@ public class TriggerImage {
|
|||
private static final String TRIGGERTYPE = "TRIGGERTYPE";
|
||||
private static final String OUTPUT_FOLDER = "triggers";
|
||||
private static final String INPUT_FILE_NAME = "triggers.txt";
|
||||
private static final String TOP_MESSAGE = "(c) rusEfi 2016";
|
||||
private static final String TOP_MESSAGE = "(c) rusEfi 2013-2017";
|
||||
private static final String DEFAULT_WORK_FOLDER = ".." + File.separator + "unit_tests";
|
||||
private static int WIDTH = 320;
|
||||
/**
|
||||
* number of extra frames
|
||||
*/
|
||||
|
@ -99,6 +98,7 @@ public class TriggerImage {
|
|||
EngineReport re0 = new EngineReport(waves.get(0).list, 720, 720 * (1 + EXTRA_COUNT));
|
||||
System.out.println(re0);
|
||||
EngineReport re1 = new EngineReport(waves.get(1).list, 720, 720 * (1 + EXTRA_COUNT));
|
||||
EngineReport re2 = new EngineReport(waves.get(2).list, 720, 720 * (1 + EXTRA_COUNT));
|
||||
|
||||
triggerPanel.removeAll();
|
||||
UpDownImage upDownImage0 = new UpDownImage(re0, "trigger");
|
||||
|
@ -107,12 +107,28 @@ public class TriggerImage {
|
|||
|
||||
UpDownImage upDownImage1 = new UpDownImage(re1, "trigger");
|
||||
upDownImage1.showMouseOverText = false;
|
||||
boolean isSingleSenssor = re1.getList().isEmpty();
|
||||
|
||||
triggerPanel.setLayout(new GridLayout(isSingleSenssor ? 1 : 2, 1));
|
||||
UpDownImage upDownImage2 = new UpDownImage(re2, "trigger");
|
||||
upDownImage2.showMouseOverText = false;
|
||||
|
||||
if (!isSingleSenssor)
|
||||
boolean isSingleSensor = re1.getList().isEmpty();
|
||||
boolean isThirdVisible = !re2.getList().isEmpty();
|
||||
|
||||
int height;
|
||||
if (isSingleSensor) {
|
||||
height = 1;
|
||||
} else if (isThirdVisible) {
|
||||
height = 3;
|
||||
} else {
|
||||
height = 2;
|
||||
}
|
||||
|
||||
triggerPanel.setLayout(new GridLayout(height, 1));
|
||||
|
||||
if (!isSingleSensor)
|
||||
triggerPanel.add(upDownImage1);
|
||||
if (isThirdVisible)
|
||||
triggerPanel.add(upDownImage2);
|
||||
|
||||
triggerPanel.name = triggerName;
|
||||
triggerPanel.id = id;
|
||||
|
@ -155,16 +171,11 @@ public class TriggerImage {
|
|||
List<WaveState> waves = new ArrayList<>();
|
||||
waves.add(new WaveState());
|
||||
waves.add(new WaveState());
|
||||
waves.add(new WaveState());
|
||||
|
||||
for (Signal s : toShow) {
|
||||
int waveIndex = s.signal / 1000;
|
||||
WaveState.trigger_value_e signal = (s.signal % 1000 == 0) ?WaveState.trigger_value_e.TV_LOW : WaveState.trigger_value_e.TV_HIGH;
|
||||
|
||||
if (waveIndex > 1) {
|
||||
// TT_HONDA_ACCORD_CD
|
||||
continue;
|
||||
// throw new IllegalStateException(s.signal + " in " + name);
|
||||
}
|
||||
WaveState.trigger_value_e signal = (s.signal % 1000 == 0) ? WaveState.trigger_value_e.TV_LOW : WaveState.trigger_value_e.TV_HIGH;
|
||||
|
||||
WaveState waveState = waves.get(waveIndex);
|
||||
waveState.handle(signal, s.angle);
|
||||
|
|
Loading…
Reference in New Issue