From b9bc6a5012cf9cb625832a35906779a26df9b53e Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sat, 4 Mar 2023 19:02:20 -0500 Subject: [PATCH] CAN GPIO #4096 only:proteus_f4 --- firmware/controllers/algo/rusefi_enums.h | 6 ++++++ firmware/integration/rusefi_config.txt | 7 ++++++- firmware/tunerstudio/rusefi.input | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index dc89f13ca1..949a659728 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -174,6 +174,12 @@ enum class SentEtbType : uint8_t { CUSTOM = 3, }; +enum class CanGpioType : uint8_t { + NONE = 0, + DRT = 1, + MS = 2, +}; + typedef enum __attribute__ ((__packed__)) { /** * GND for logical OFF, VCC for logical ON diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 1101a4bab0..7ae1683638 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -300,6 +300,9 @@ custom ego_sensor_e 1 bits, S08, @OFFSET@, [0:2], @@ego_sensor_e_enum@@ #define SentEtbType_enum "None", "GM type 1", "Ford type 1", "Custom" custom SentEtbType 1 bits, S08, @OFFSET@, [0:1], @@SentEtbType_enum@@ +#define CanGpioType_enum "None", "DRT protocol", "MS protocol" +custom CanGpioType 1 bits, S08, @OFFSET@, [0:1], @@CanGpioType_enum@@ + struct cranking_parameters_s float baseFuel;Base mass of the per-cylinder fuel injected during cranking. This is then modified by the multipliers for CLT, IAT, TPS ect, to give the final cranking pulse width.\nA reasonable starting point is 60mg per liter per cylinder.\nex: 2 liter 4 cyl = 500cc/cyl, so 30mg cranking fuel.;"mg", 1, 0, 0, 500, 1 int16_t rpm;This sets the RPM limit below which the ECU will use cranking fuel and ignition logic, typically this is around 350-450rpm. \nset cranking_rpm X;"RPM", 1, 0, 0, 3000, 0 @@ -1568,7 +1571,9 @@ uint8_t alsEtbPosition;;"", 1, 0, 0, 20000, 0 pin_input_mode_e[LUA_DIGITAL_INPUT_COUNT iterate] luaDigitalInputPinModes; uint16_t customSentTpsMax uint16_t kLineBaudRate -uint8_t[44] mainUnusedEnd;;"units", 1, 0, 0, 1, 0 + CanGpioType canGpioType + uint8_t[3] unusedSpacingHere +uint8_t[40] mainUnusedEnd;;"units", 1, 0, 0, 1, 0 ! end of engine_configuration_s end_struct diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index a67b06b324..3a16e0ec38 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -4305,6 +4305,7 @@ dialog = tcuControls, "Transmission Settings" dialog = parkingLot, "Experimental/Broken" field = kLineBaudRate, kLineBaudRate + field = canGpioType, canGpioType field = "I understand ECU Locking", yesUnderstandLocking field = "Tune read/write password", tuneHidingKey, { yesUnderstandLocking == 1 } field = verboseQuad, verboseQuad