diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index 156e5a5f97..892513a73c 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -1,7 +1,7 @@ #include "global.h" #include "rusefi_enums.h" #include "rusefi_hw_enums.h" -// was generated automatically by rusEfi tool from rusefi_hw_enums.h // was generated automatically by rusEfi tool from rusefi_enums.h // by enum2string.jar tool on Fri Jan 01 06:11:31 UTC 2021 +// was generated automatically by rusEfi tool from rusefi_hw_enums.h // was generated automatically by rusEfi tool from rusefi_enums.h // by enum2string.jar tool on Sun Jan 03 13:42:19 EST 2021 // see also gen_config_and_enums.bat @@ -1379,6 +1379,8 @@ case TT_TOOTHED_WHEEL_36_2: return "TT_TOOTHED_WHEEL_36_2"; case TT_TOOTHED_WHEEL_60_2: return "TT_TOOTHED_WHEEL_60_2"; +case TT_TRI_TACH: + return "TT_TRI_TACH"; case TT_UNUSED: return "TT_UNUSED"; case TT_VVT_BOSCH_QUICK_START: diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index bee4bc8bdf..28afc2074e 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -362,13 +362,16 @@ typedef enum { TT_52 = TT_TT_52, + // https://rusefi.com/forum/viewtopic.php?f=5&t=1912 + TT_TRI_TACH = TT_TT_TRI_TACH, + // 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 // // Another point: once you add a new trigger, run get_trigger_images.bat which would run rusefi_test.exe from unit_tests // - TT_UNUSED = 53, // this is used if we want to iterate over all trigger types + TT_UNUSED = 54, // this is used if we want to iterate over all trigger types Force_4_bytes_size_trigger_type = ENUM_32_BITS, } trigger_type_e; diff --git a/firmware/controllers/trigger/decoders/trigger_structure.cpp b/firmware/controllers/trigger/decoders/trigger_structure.cpp index ff5d2fd6b8..854612af02 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.cpp +++ b/firmware/controllers/trigger/decoders/trigger_structure.cpp @@ -243,7 +243,9 @@ void TriggerWaveform::addEvent(angle_t angle, trigger_wheel_e const channelIndex efiAssertVoid(CUSTOM_ERR_6599, angle > 0 && angle <= 1, "angle should be positive not above 1"); if (privateTriggerDefinitionSize > 0) { if (angle <= previousAngle) { - warning(CUSTOM_ERR_TRG_ANGLE_ORDER, "invalid angle order: new=%.2f/%f and prev=%.2f/%f, size=%d", + warning(CUSTOM_ERR_TRG_ANGLE_ORDER, "invalid angle order %s %s: new=%.2f/%f and prev=%.2f/%f, size=%d", + getTrigger_wheel_e(channelIndex), + getTrigger_value_e(state), angle, angle * getCycleDuration(), previousAngle, previousAngle * getCycleDuration(), privateTriggerDefinitionSize); @@ -660,6 +662,7 @@ void TriggerWaveform::initializeTriggerWaveform(Logging *logger, operation_mode_ configureFiatIAQ_P8(this); break; + case TT_TRI_TACH: case TT_GM_LS_24: initGmLS24(this); break; diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 854cb7dac5..0c4a7b4cc9 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -143,6 +143,7 @@ void calculateTriggerSynchPoint( efiAssertVoid(CUSTOM_SHAPE_LEN_ZERO, length > 0, "shapeLength=0"); if (length >= PWM_PHASE_MAX_COUNT) { + // todo: by the time we are here we had already modified a lot of RAM out of bounds! firmwareError(CUSTOM_ERR_TRIGGER_WAVEFORM_TOO_LONG, "Trigger length above maximum: %d", length); shape.setShapeDefinitionError(true); return;