From f55556fb495f6c24ece1046977784f75ba0a7bcd Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sat, 25 Apr 2020 14:17:58 -0700 Subject: [PATCH 1/4] General purpose PWM: configuration fields (#1365) * config * significant digits * renumber enum, no need for a "none" * ui --- firmware/integration/rusefi_config.txt | 30 +++++- firmware/tunerstudio/rusefi.input | 124 ++++++++++++++++++++++++- 2 files changed, 150 insertions(+), 4 deletions(-) diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index cafe5b4b87..9aafdc8a17 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -200,6 +200,11 @@ custom pedal_to_tps_t @@PEDAL_TO_TPS_SIZE@@x@@PEDAL_TO_TPS_SIZE@@ array, U08, custom iac_pid_mult_t @@IAC_PID_MULT_SIZE@@x@@IAC_PID_MULT_SIZE@@ array, U08, @OFFSET@, [@@IAC_PID_MULT_SIZE@@x@@IAC_PID_MULT_SIZE@@],"%", 1, 0, 0, 999, 2 custom boost_table_t @@BOOST_RPM_COUNT@@x@@BOOST_LOAD_COUNT@@ array, U08, @OFFSET@, [@@BOOST_RPM_COUNT@@x@@BOOST_LOAD_COUNT@@],"", @@LOAD_1_BYTE_PACKING_MULT@@, 0 , 0, 3000, 0 +#define GPPWM_LOAD_COUNT 8 +#define GPPWM_RPM_COUNT 8 + +custom gppwm_table_t @@GPPWM_RPM_COUNT@@x@@GPPWM_LOAD_COUNT@@ array, U08, @OFFSET@, [@@GPPWM_RPM_COUNT@@x@@GPPWM_LOAD_COUNT@@], "duty", 1, 0, 0, 100, 0 + struct stft_cell_cfg_s int8_t maxAdd;; "%", 1, 0, 0, 25, 0 int8_t maxRemove;; "%", 1, 0, -25, 0, 0 @@ -288,6 +293,25 @@ struct spi_pins end_struct +#define gppwm_channel_e_enum "TPS", "MAP", "CLT", "IAT" +custom gppwm_channel_e 1 bits, U08, @OFFSET@, [0:1], @@gppwm_channel_e_enum@@ + +struct gppwm_channel + brain_pin_e pin;+Select a pin to use for PWM or on-off output.; + uint8_t dutyIfError;+If an error (with a sensor, etc) is detected, this value is used instead of reading from the table.\nThis should be a safe value for whatever hardware is connected to prevent damage.;"%", 1, 0, 0, 100, 0 + uint16_t pwmFrequency;+Select a frequency to run PWM at.\nSet this to 0hz to enable on-off mode.;"hz", 1, 0, 0, 500, 0 + + uint8_t onAboveDuty;+In on-off mode, turn the output on when the table value is above this duty.;"%", 1, 0, 0, 100, 0 + uint8_t offBelowDuty;+In on-off mode, turn the output off when the table value is below this duty.;"%", 1, 0, 0, 100, 0 + + gppwm_channel_e loadAxis;+Selects the load axis to use for the table.; + uint8_t[1] pad; + + uint8_t[GPPWM_LOAD_COUNT] loadBins;;"load", 1, 0, 0.0, 250, 0 + uint8_t[GPPWM_RPM_COUNT] rpmBins;;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0.0, 12000.0, 0 + gppwm_table_t table; +end_struct + custom air_pressure_sensor_type_e 4 bits, U32, @OFFSET@, [0:7] "Custom", "DENSO183", "MPX4250", "HONDA3BAR", "NEON_2003", "22012AA090", "3 Bar", "MPX4100", "Toyota 89420-02010", "MPX4250A", "INVALID" ! ! lower 16 values are used on stm32 rusEfi, values above 16 are related to Kinetis work in progress @@ -1245,8 +1269,10 @@ uint8_t[4] unusuedsw; custom can_vss_nbc_e 4 bits, U32, @OFFSET@, [0:7], "BMW_e46", "W202" can_vss_nbc_e canVssNbcType;set can_vss X - - int[464] mainUnusedEnd; + + gppwm_channel[4 iterate] gppwm; + + int[376] mainUnusedEnd; ! end of engine_configuration_s end_struct diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 783385d9ab..12bb2ebe7a 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -369,6 +369,12 @@ fileVersion = { @@TS_FILE_VERSION@@ } time = { timeNow } ; engineLoad = { fuleAlgorithm == 0 ? MAF : TPS } + ; These "synthetic" channels provide the Y-axis (load) value for gen purp PWM table's Y axes + gppwm1_load = {(gppwm1_loadAxis == 0) ? TPSValue : ((gppwm1_loadAxis == 1) ? MAPValue : ((gppwm1_loadAxis == 2) ? coolant : intake))} + gppwm2_load = {(gppwm2_loadAxis == 0) ? TPSValue : ((gppwm2_loadAxis == 1) ? MAPValue : ((gppwm2_loadAxis == 2) ? coolant : intake))} + gppwm3_load = {(gppwm3_loadAxis == 0) ? TPSValue : ((gppwm3_loadAxis == 1) ? MAPValue : ((gppwm3_loadAxis == 2) ? coolant : intake))} + gppwm4_load = {(gppwm4_loadAxis == 0) ? TPSValue : ((gppwm4_loadAxis == 1) ? MAPValue : ((gppwm4_loadAxis == 2) ? coolant : intake))} + [PcVariables] wueAfrTargetOffset = array, S16, [ 16], ":1", 0.1, 0.0, -3.0, 3.0, 1; wueAnalRecommend = array, U08, [ 16], "%", 1.00, 0.0, 100, 255.00, 0 @@ -856,6 +862,30 @@ fileVersion = { @@TS_FILE_VERSION@@ } gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. upDownLabel = "(Later)", "(Sooner)" + table = gppwm1Tbl, gppwm1Map, "", 1 + xyLabels = "RPM", "" + xBins = gppwm1_rpmBins, RPMValue + yBins = gppwm1_loadBins, gppwm1_load + zBins = gppwm1_table + + table = gppwm2Tbl, gppwm2Map, "", 1 + xyLabels = "RPM", "" + xBins = gppwm2_rpmBins, RPMValue + yBins = gppwm2_loadBins, gppwm2_load + zBins = gppwm2_table + + table = gppwm3Tbl, gppwm3Map, "", 1 + xyLabels = "RPM", "" + xBins = gppwm3_rpmBins, RPMValue + yBins = gppwm3_loadBins, gppwm3_load + zBins = gppwm3_table + + table = gppwm4Tbl, gppwm4Map, "", 1 + xyLabels = "RPM", "" + xBins = gppwm4_rpmBins, RPMValue + yBins = gppwm4_loadBins, gppwm4_load + zBins = gppwm4_table + [GaugeConfigurations] gaugeCategory = Sensors - Extra 2 @@ -1294,8 +1324,14 @@ menuDialog = main menu = "&Advanced" subMenu = boostDialog, "Boost Control" subMenu = boostPidDialog, "Closed Loop Boost", { boostType == 1 } - subMenu = mc33Dialog, "GDI Dreams" - subMenu = std_separator + + subMenu = std_separator + subMenu = gppwm1, "General Purpose PWM 1" + subMenu = gppwm2, "General Purpose PWM 2" + subMenu = gppwm3, "General Purpose PWM 3" + subMenu = gppwm4, "General Purpose PWM 4" + + subMenu = std_separator subMenu = fsioInputsDialog, "FSIO inputs" subMenu = auxPidDialog, "Aux PID" subMenu = fsioOutputsDialog, "FSIO outputs" @@ -1374,6 +1410,7 @@ menuDialog = main # EXPERIMENTAL FEATURES subMenu = parkingLot, "Experimental/Broken" subMenu = multisparkSettings, "Multispark", 0, {isIgnitionEnabled == 1} + subMenu = mc33Dialog, "GDI Dreams" subMenu = std_separator subMenu = hipFunction, "HIP9011 settings (knock sensor) (alpha version)" @@if_ts_show_hip9011 @@ -2912,6 +2949,89 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" webHelp = "http://www.rusefi.com/" text = "" + dialog = gppwm1left, "" + field = "Pin", gppwm1_pin + field = "" + field = "Set frequency to 0hz for on-off mode" + field = "Frequency", gppwm1_pwmFrequency, {gppwm1_pin != 0} + field = "" + field = "On above duty", gppwm1_onAboveDuty, {gppwm1_pin != 0 && gppwm1_pwmFrequency == 0} + field = "Off below duty", gppwm1_offBelowDuty, {gppwm1_pin != 0 && gppwm1_pwmFrequency == 0} + field = "Duty if error", gppwm1_dutyIfError, {gppwm1_pin != 0} + field = "" + field = "Load Axis", gppwm1_loadAxis, {gppwm1_pin != 0} + field = "" + field = "" + field = "" + field = "" + field = "" + + dialog = gppwm1, "General Purpose PWM 1", xAxis + panel = gppwm1left + panel = gppwm1Tbl, {gppwm1_pin != 0} + + dialog = gppwm2left, "" + field = "Pin", gppwm2_pin + field = "" + field = "Set frequency to 0hz for on-off mode" + field = "Frequency", gppwm2_pwmFrequency, {gppwm2_pin != 0} + field = "" + field = "On above duty", gppwm2_onAboveDuty, {gppwm2_pin != 0 && gppwm2_pwmFrequency == 0} + field = "Off below duty", gppwm2_offBelowDuty, {gppwm2_pin != 0 && gppwm2_pwmFrequency == 0} + field = "Duty if error", gppwm2_dutyIfError, {gppwm2_pin != 0} + field = "" + field = "Load Axis", gppwm2_loadAxis, {gppwm2_pin != 0} + field = "" + field = "" + field = "" + field = "" + field = "" + + dialog = gppwm2, "General Purpose PWM 2", xAxis + panel = gppwm2left + panel = gppwm2Tbl, {gppwm2_pin != 0} + + dialog = gppwm3left, "" + field = "Pin", gppwm3_pin + field = "" + field = "Set frequency to 0hz for on-off mode" + field = "Frequency", gppwm3_pwmFrequency, {gppwm3_pin != 0} + field = "" + field = "On above duty", gppwm3_onAboveDuty, {gppwm3_pin != 0 && gppwm3_pwmFrequency == 0} + field = "Off below duty", gppwm3_offBelowDuty, {gppwm3_pin != 0 && gppwm3_pwmFrequency == 0} + field = "Duty if error", gppwm3_dutyIfError, {gppwm3_pin != 0} + field = "" + field = "Load Axis", gppwm3_loadAxis, {gppwm3_pin != 0} + field = "" + field = "" + field = "" + field = "" + field = "" + + dialog = gppwm3, "General Purpose PWM 3", xAxis + panel = gppwm3left + panel = gppwm3Tbl, {gppwm3_pin != 0} + + dialog = gppwm4left, "" + field = "Pin", gppwm4_pin + field = "" + field = "Set frequency to 0hz for on-off mode" + field = "Frequency", gppwm4_pwmFrequency, {gppwm4_pin != 0} + field = "" + field = "On above duty", gppwm4_onAboveDuty, {gppwm4_pin != 0 && gppwm4_pwmFrequency == 0} + field = "Off below duty", gppwm4_offBelowDuty, {gppwm4_pin != 0 && gppwm4_pwmFrequency == 0} + field = "Duty if error", gppwm4_dutyIfError, {gppwm4_pin != 0} + field = "" + field = "Load Axis", gppwm4_loadAxis, {gppwm4_pin != 0} + field = "" + field = "" + field = "" + field = "" + field = "" + + dialog = gppwm4, "General Purpose PWM 4", xAxis + panel = gppwm4left + panel = gppwm4Tbl, {gppwm4_pin != 0} [Tools] ;addTool = toolName, PanelName From 39ea73421c4865d841e764c60716fe10fc26941c Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 25 Apr 2020 18:07:37 -0400 Subject: [PATCH 2/4] Fresh generated - auto --- .../com/rusefi/config/generated/Fields.java | 139 +++++++++++++++++- 1 file changed, 136 insertions(+), 3 deletions(-) diff --git a/java_console/models/src/com/rusefi/config/generated/Fields.java b/java_console/models/src/com/rusefi/config/generated/Fields.java index caac298e07..13fe644f92 100644 --- a/java_console/models/src/com/rusefi/config/generated/Fields.java +++ b/java_console/models/src/com/rusefi/config/generated/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config.generated; -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Fri Apr 24 23:22:49 EDT 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sat Apr 25 18:03:45 EDT 2020 // by class com.rusefi.output.FileJavaFieldsConsumer import com.rusefi.config.*; @@ -703,6 +703,74 @@ public class Fields { public static final int gpioPinModes8_offset_hex = 303; public static final int gpioPinModes9_offset = 772; public static final int gpioPinModes9_offset_hex = 304; + public static final int gppwm1_dutyIfError_offset = 4145; + public static final int gppwm1_dutyIfError_offset_hex = 1031; + public static final int gppwm1_loadAxis_offset = 4150; + public static final int gppwm1_loadAxis_offset_hex = 1036; + public static final int gppwm1_loadBins_offset = 4152; + public static final int gppwm1_loadBins_offset_hex = 1038; + public static final int gppwm1_offBelowDuty_offset = 4149; + public static final int gppwm1_offBelowDuty_offset_hex = 1035; + public static final int gppwm1_offset = 4144; + public static final int gppwm1_offset_hex = 1030; + public static final int gppwm1_onAboveDuty_offset = 4148; + public static final int gppwm1_onAboveDuty_offset_hex = 1034; + public static final int gppwm1_pad_offset = 4151; + public static final int gppwm1_pad_offset_hex = 1037; + public static final int gppwm1_pin_offset = 4144; + public static final int gppwm1_pin_offset_hex = 1030; + public static final int gppwm1_pwmFrequency_offset = 4146; + public static final int gppwm1_pwmFrequency_offset_hex = 1032; + public static final int gppwm1_rpmBins_offset = 4160; + public static final int gppwm1_rpmBins_offset_hex = 1040; + public static final int gppwm1_table_offset = 4168; + public static final int gppwm1_table_offset_hex = 1048; + public static final int gppwm2_dutyIfError_offset = 4233; + public static final int gppwm2_dutyIfError_offset_hex = 1089; + public static final int gppwm2_loadAxis_offset = 4238; + public static final int gppwm2_loadBins_offset = 4240; + public static final int gppwm2_loadBins_offset_hex = 1090; + public static final int gppwm2_offBelowDuty_offset = 4237; + public static final int gppwm2_offset = 4232; + public static final int gppwm2_offset_hex = 1088; + public static final int gppwm2_onAboveDuty_offset = 4236; + public static final int gppwm2_pad_offset = 4239; + public static final int gppwm2_pin_offset = 4232; + public static final int gppwm2_pin_offset_hex = 1088; + public static final int gppwm2_pwmFrequency_offset = 4234; + public static final int gppwm2_rpmBins_offset = 4248; + public static final int gppwm2_rpmBins_offset_hex = 1098; + public static final int gppwm2_table_offset = 4256; + public static final int gppwm3_dutyIfError_offset = 4321; + public static final int gppwm3_loadAxis_offset = 4326; + public static final int gppwm3_loadBins_offset = 4328; + public static final int gppwm3_offBelowDuty_offset = 4325; + public static final int gppwm3_offset = 4320; + public static final int gppwm3_onAboveDuty_offset = 4324; + public static final int gppwm3_pad_offset = 4327; + public static final int gppwm3_pin_offset = 4320; + public static final int gppwm3_pwmFrequency_offset = 4322; + public static final int gppwm3_rpmBins_offset = 4336; + public static final int gppwm3_table_offset = 4344; + public static final int gppwm4_dutyIfError_offset = 4409; + public static final int gppwm4_dutyIfError_offset_hex = 1139; + public static final int gppwm4_loadAxis_offset = 4414; + public static final int gppwm4_loadBins_offset = 4416; + public static final int gppwm4_loadBins_offset_hex = 1140; + public static final int gppwm4_offBelowDuty_offset = 4413; + public static final int gppwm4_offset = 4408; + public static final int gppwm4_offset_hex = 1138; + public static final int gppwm4_onAboveDuty_offset = 4412; + public static final int gppwm4_pad_offset = 4415; + public static final int gppwm4_pin_offset = 4408; + public static final int gppwm4_pin_offset_hex = 1138; + public static final int gppwm4_pwmFrequency_offset = 4410; + public static final int gppwm4_rpmBins_offset = 4424; + public static final int gppwm4_rpmBins_offset_hex = 1148; + public static final int gppwm4_table_offset = 4432; + public static final int gppwm4_table_offset_hex = 1150; + public static final int GPPWM_LOAD_COUNT = 8; + public static final int GPPWM_RPM_COUNT = 8; public static final int gps_rx_pin_offset = 656; public static final int gps_rx_pin_offset_hex = 290; public static final int gps_tx_pin_offset = 657; @@ -1001,8 +1069,8 @@ public class Fields { public static final int mafSensorType_offset = 948; public static final int mainRelayPin_offset = 706; public static final int mainRelayPinMode_offset = 752; - public static final int mainUnusedEnd_offset = 4144; - public static final int mainUnusedEnd_offset_hex = 1030; + public static final int mainUnusedEnd_offset = 4496; + public static final int mainUnusedEnd_offset_hex = 1190; public static final int malfunctionIndicatorPin_offset = 660; public static final int malfunctionIndicatorPin_offset_hex = 294; public static final int malfunctionIndicatorPinMode_offset = 661; @@ -2459,6 +2527,39 @@ public class Fields { public static final Field IDLERPMPID2_MAXVALUE = Field.create("IDLERPMPID2_MAXVALUE", 4058, FieldType.INT16); public static final Field IACPIDMULTTABLE = Field.create("IACPIDMULTTABLE", 4060, FieldType.INT); public static final Field CANVSSNBCTYPE = Field.create("CANVSSNBCTYPE", 4140, FieldType.INT); + public static final Field GPPWM1_PIN = Field.create("GPPWM1_PIN", 4144, FieldType.INT8, brain_pin_e); + public static final Field GPPWM1_DUTYIFERROR = Field.create("GPPWM1_DUTYIFERROR", 4145, FieldType.INT8); + public static final Field GPPWM1_PWMFREQUENCY = Field.create("GPPWM1_PWMFREQUENCY", 4146, FieldType.INT16); + public static final Field GPPWM1_ONABOVEDUTY = Field.create("GPPWM1_ONABOVEDUTY", 4148, FieldType.INT8); + public static final Field GPPWM1_OFFBELOWDUTY = Field.create("GPPWM1_OFFBELOWDUTY", 4149, FieldType.INT8); + public static final String[] gppwm_channel_e = {"TPS", "MAP", "CLT", "IAT"}; + public static final Field GPPWM1_LOADAXIS = Field.create("GPPWM1_LOADAXIS", 4150, FieldType.INT8, gppwm_channel_e); + public static final Field GPPWM1_PAD = Field.create("GPPWM1_PAD", 4151, FieldType.INT8); + public static final Field GPPWM1_TABLE = Field.create("GPPWM1_TABLE", 4168, FieldType.INT); + public static final Field GPPWM2_PIN = Field.create("GPPWM2_PIN", 4232, FieldType.INT8, brain_pin_e); + public static final Field GPPWM2_DUTYIFERROR = Field.create("GPPWM2_DUTYIFERROR", 4233, FieldType.INT8); + public static final Field GPPWM2_PWMFREQUENCY = Field.create("GPPWM2_PWMFREQUENCY", 4234, FieldType.INT16); + public static final Field GPPWM2_ONABOVEDUTY = Field.create("GPPWM2_ONABOVEDUTY", 4236, FieldType.INT8); + public static final Field GPPWM2_OFFBELOWDUTY = Field.create("GPPWM2_OFFBELOWDUTY", 4237, FieldType.INT8); + public static final Field GPPWM2_LOADAXIS = Field.create("GPPWM2_LOADAXIS", 4238, FieldType.INT8, gppwm_channel_e); + public static final Field GPPWM2_PAD = Field.create("GPPWM2_PAD", 4239, FieldType.INT8); + public static final Field GPPWM2_TABLE = Field.create("GPPWM2_TABLE", 4256, FieldType.INT); + public static final Field GPPWM3_PIN = Field.create("GPPWM3_PIN", 4320, FieldType.INT8, brain_pin_e); + public static final Field GPPWM3_DUTYIFERROR = Field.create("GPPWM3_DUTYIFERROR", 4321, FieldType.INT8); + public static final Field GPPWM3_PWMFREQUENCY = Field.create("GPPWM3_PWMFREQUENCY", 4322, FieldType.INT16); + public static final Field GPPWM3_ONABOVEDUTY = Field.create("GPPWM3_ONABOVEDUTY", 4324, FieldType.INT8); + public static final Field GPPWM3_OFFBELOWDUTY = Field.create("GPPWM3_OFFBELOWDUTY", 4325, FieldType.INT8); + public static final Field GPPWM3_LOADAXIS = Field.create("GPPWM3_LOADAXIS", 4326, FieldType.INT8, gppwm_channel_e); + public static final Field GPPWM3_PAD = Field.create("GPPWM3_PAD", 4327, FieldType.INT8); + public static final Field GPPWM3_TABLE = Field.create("GPPWM3_TABLE", 4344, FieldType.INT); + public static final Field GPPWM4_PIN = Field.create("GPPWM4_PIN", 4408, FieldType.INT8, brain_pin_e); + public static final Field GPPWM4_DUTYIFERROR = Field.create("GPPWM4_DUTYIFERROR", 4409, FieldType.INT8); + public static final Field GPPWM4_PWMFREQUENCY = Field.create("GPPWM4_PWMFREQUENCY", 4410, FieldType.INT16); + public static final Field GPPWM4_ONABOVEDUTY = Field.create("GPPWM4_ONABOVEDUTY", 4412, FieldType.INT8); + public static final Field GPPWM4_OFFBELOWDUTY = Field.create("GPPWM4_OFFBELOWDUTY", 4413, FieldType.INT8); + public static final Field GPPWM4_LOADAXIS = Field.create("GPPWM4_LOADAXIS", 4414, FieldType.INT8, gppwm_channel_e); + public static final Field GPPWM4_PAD = Field.create("GPPWM4_PAD", 4415, FieldType.INT8); + public static final Field GPPWM4_TABLE = Field.create("GPPWM4_TABLE", 4432, FieldType.INT); public static final Field WARNING_MESSAGE = Field.create("WARNING_MESSAGE", 6000, FieldType.INT); public static final Field BOOSTTABLEOPENLOOP = Field.create("BOOSTTABLEOPENLOOP", 6248, FieldType.INT); public static final Field BOOSTTABLECLOSEDLOOP = Field.create("BOOSTTABLECLOSEDLOOP", 6328, FieldType.INT); @@ -3378,6 +3479,38 @@ public class Fields { IDLERPMPID2_MAXVALUE, IACPIDMULTTABLE, CANVSSNBCTYPE, + GPPWM1_PIN, + GPPWM1_DUTYIFERROR, + GPPWM1_PWMFREQUENCY, + GPPWM1_ONABOVEDUTY, + GPPWM1_OFFBELOWDUTY, + GPPWM1_LOADAXIS, + GPPWM1_PAD, + GPPWM1_TABLE, + GPPWM2_PIN, + GPPWM2_DUTYIFERROR, + GPPWM2_PWMFREQUENCY, + GPPWM2_ONABOVEDUTY, + GPPWM2_OFFBELOWDUTY, + GPPWM2_LOADAXIS, + GPPWM2_PAD, + GPPWM2_TABLE, + GPPWM3_PIN, + GPPWM3_DUTYIFERROR, + GPPWM3_PWMFREQUENCY, + GPPWM3_ONABOVEDUTY, + GPPWM3_OFFBELOWDUTY, + GPPWM3_LOADAXIS, + GPPWM3_PAD, + GPPWM3_TABLE, + GPPWM4_PIN, + GPPWM4_DUTYIFERROR, + GPPWM4_PWMFREQUENCY, + GPPWM4_ONABOVEDUTY, + GPPWM4_OFFBELOWDUTY, + GPPWM4_LOADAXIS, + GPPWM4_PAD, + GPPWM4_TABLE, WARNING_MESSAGE, BOOSTTABLEOPENLOOP, BOOSTTABLECLOSEDLOOP, From a8bf8a8eb5849b1715abc97f2c74a2a9e08ae5d2 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sat, 25 Apr 2020 15:26:29 -0700 Subject: [PATCH 3/4] types & enums (#1367) --- firmware/controllers/algo/rusefi_enums.h | 12 ++++++++++++ firmware/controllers/algo/rusefi_types.h | 1 + firmware/util/containers/table_helper.h | 1 + 3 files changed, 14 insertions(+) diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 689208ba97..19998bf1d5 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -904,3 +904,15 @@ typedef enum { ALWAYS_ON_ANTILAG = 1, Force_4bytes_size_antiLagActivationMode_e = ENUM_32_BITS, } antiLagActivationMode_e; + +typedef enum __attribute__ ((__packed__)) { + GPPWM_Tps = 0, + GPPWM_Map = 1, + GPPWM_Clt = 2, + GPPWM_Iat = 3, +} gppwm_channel_e; + +typedef enum __attribute__ ((__packed__)) { + GPPWM_GreaterThan = 0, + GPPWM_LessThan = 1, +} gppwm_compare_mode_e; diff --git a/firmware/controllers/algo/rusefi_types.h b/firmware/controllers/algo/rusefi_types.h index 7758b3d006..ddd660a1d9 100644 --- a/firmware/controllers/algo/rusefi_types.h +++ b/firmware/controllers/algo/rusefi_types.h @@ -101,6 +101,7 @@ typedef float fsio_table_8x8_f32t[FSIO_TABLE_8][FSIO_TABLE_8]; typedef float tps_tps_table_t[TPS_TPS_ACCEL_TABLE][TPS_TPS_ACCEL_TABLE]; typedef uint8_t fsio_table_8x8_u8t[FSIO_TABLE_8][FSIO_TABLE_8]; typedef uint8_t boost_table_t[BOOST_LOAD_COUNT][BOOST_RPM_COUNT]; + typedef uint8_t gppwm_table_t[GPPWM_LOAD_COUNT][GPPWM_RPM_COUNT]; // this is different type simply to have different hi/low range in rusefi.ini diff --git a/firmware/util/containers/table_helper.h b/firmware/util/containers/table_helper.h index 2cd4368518..37ad332c7c 100644 --- a/firmware/util/containers/table_helper.h +++ b/firmware/util/containers/table_helper.h @@ -161,6 +161,7 @@ typedef Map3D pedal2tps_ typedef Map3D boostOpenLoop_Map3D_t; typedef Map3D boostClosedLoop_Map3D_t; typedef Map3D iacPidMultiplier_t; +typedef Map3D gppwm_Map3D_t; void setRpmBin(float array[], int size, float idleRpm, float topRpm); From 62ae3f853c234e81c9425c76b036768514746056 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 25 Apr 2020 18:39:16 -0400 Subject: [PATCH 4/4] making build a bit happier --- simulator/simulator/efifeatures.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulator/simulator/efifeatures.h b/simulator/simulator/efifeatures.h index 45c0819c1a..88759126ef 100644 --- a/simulator/simulator/efifeatures.h +++ b/simulator/simulator/efifeatures.h @@ -10,7 +10,7 @@ #include "rusefi_true.h" #define EFI_ENABLE_ASSERTS TRUE - +#define EFI_LAUNCH_CONTROL FALSE #define EFI_ENABLE_MOCK_ADC TRUE #define ENABLE_PERF_TRACE FALSE