Mazda Z5 trigger integration

This commit is contained in:
rusefi 2018-11-22 10:01:48 -05:00
parent e8f0036042
commit c77ab926c2
6 changed files with 26 additions and 6 deletions

View File

@ -1,6 +1,6 @@
// auto-generated from.\controllers/algo/rusefi_enums.h
// by enum2string.jar tool
// on Wed Nov 21 20:48:18 EST 2018
// on Wed Nov 21 21:47:19 EST 2018
// see also gen_config_and_enums.bat
@ -192,6 +192,8 @@ case TT_MAZDA_MIATA_VVT_TEST:
return "TT_MAZDA_MIATA_VVT_TEST";
case TT_MAZDA_SOHC_4:
return "TT_MAZDA_SOHC_4";
case TT_MAZDA_Z5:
return "TT_MAZDA_Z5";
case TT_MIATA_VVT:
return "TT_MIATA_VVT";
case TT_MINI_COOPER_R50:

View File

@ -288,7 +288,12 @@ typedef enum {
// https://rusefi.com/forum/viewtopic.php?f=5&t=1440
TT_FIAT_IAW_P8 = 41,
TT_UNUSED = 42, // this is used if we want to iterate over all trigger types
TT_MAZDA_Z5 = 42,
// do not forget to edit "#define trigger_type_e_enum" line in integration/rusefi_config.txt file to propogate new value to rusefi.ini TS project
// do not forget to invoke "gen_config.bat" once you make changes to integration/rusefi_config.txt
// todo: one day a hero would integrate some of these things into Makefile in order to reduce manual magic
TT_UNUSED = 43, // this is used if we want to iterate over all trigger types
Force_4_bytes_size_trigger_type = ENUM_32_BITS,
} trigger_type_e;

View File

@ -65,7 +65,7 @@
#define pin_output_mode_e_enum "default", "default inverted", "open collector", "open collector inverted"
#define adc_channel_e_enum "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"
#define engine_load_mode_e_enum "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY"
#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 Primera", "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", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "trg42", "trg43", "trg44", "trg45", "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 Primera", "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", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "trg43", "trg44", "trg45", "INVALID"
#define sensor_chart_e_enum "none", "trigger", "MAP", "RPM ACCEL", "DETAILED RPM", "INVALID"
#define ego_sensor_e_enum "BPSX", "Innovate", "14Point7", "Narrow", "PLX", "Custom"
#define pin_mode_e_enum "default", "INVALID", "INVALID", "INVALID", "opendrain", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "PULLUP", "mode33", "mode34", "mode35"

View File

@ -361,6 +361,15 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no
|| currentCycle.eventCount[1] != TRIGGER_SHAPE(expectedEventCount[1])
|| currentCycle.eventCount[2] != TRIGGER_SHAPE(expectedEventCount[2]);
#if EFI_UNIT_TEST
printf("sync point: isDecodingError=%d isInit=%d\r\n", isDecodingError, isInitializingTrigger);
if (isDecodingError) {
printf("count: cur=%d exp=%d\r\n", currentCycle.eventCount[0], TRIGGER_SHAPE(expectedEventCount[0]));
printf("count: cur=%d exp=%d\r\n", currentCycle.eventCount[1], TRIGGER_SHAPE(expectedEventCount[1]));
printf("count: cur=%d exp=%d\r\n", currentCycle.eventCount[2], TRIGGER_SHAPE(expectedEventCount[2]));
}
#endif
enginePins.triggerDecoderErrorPin.setValue(isDecodingError);
if (isDecodingError && !isInitializingTrigger) {
if (engineConfiguration->debugMode == DBG_TRIGGER_SYNC) {
@ -494,6 +503,10 @@ void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMET
initializeMazdaMiataVVtTestShape(this PASS_ENGINE_PARAMETER_SUFFIX);
break;
case TT_MAZDA_Z5:
initialize_Mazda_Engine_z5_Shape(this PASS_ENGINE_PARAMETER_SUFFIX);
break;
case TT_MIATA_VVT:
initializeMazdaMiataNb2Crank(this PASS_ENGINE_PARAMETER_SUFFIX);
break;

View File

@ -392,7 +392,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 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 Primera", "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", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "trg42", "trg43", "trg44", "trg45", "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 Primera", "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", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "trg43", "trg44", "trg45", "INVALID"
custom trigger_type_e 4 bits, U32, @OFFSET@, [0:5], @@trigger_type_e_enum@@
trigger_type_e type;set trigger_type X

View File

@ -63,7 +63,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 Sat Nov 10 20:59:11 EST 2018
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Nov 22 10:00:39 EST 2018
pageSize = 20000
page = 1
@ -175,7 +175,7 @@ page = 1
tpsAdcChannel = bits, U32, 520, [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"
;no TS info - skipping overrideCrankingIgnition offset 524
sensorChartFrequency = scalar, S32, 528, "index", 1, 0, 0, 300, 0 ; size 4
trigger_type = bits, U32, 532, [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 Primera", "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", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "trg42", "trg43", "trg44", "trg45", "INVALID"
trigger_type = bits, U32, 532, [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 Primera", "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", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "trg43", "trg44", "trg45", "INVALID"
trigger_unusedCustomIsSynchronizationNeeded= bits, U32, 536, [0:0], "false", "true"
trigger_unusedCustomNeedSecondTriggerInput= bits, U32, 536, [1:1], "false", "true"
trigger_useOnlyFirstChannel= bits, U32, 536, [2:2], "false", "true"