From e30f39a6dd3ecf98be5c49d4d68b1c57fcfaf078 Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 24 Nov 2023 15:44:21 -0500 Subject: [PATCH] bench test 33810 module #5745 --- .../controllers/algo/rusefi_hw_stm32_enums.h | 16 +++++++-------- firmware/integration/rusefi_config.txt | 3 ++- .../com/rusefi/test/ConfigDefinitionTest.java | 13 +++++++++--- .../rusefi/test/output_pin_e_enumTest.java | 20 +++++++++++++++++++ 4 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 java_tools/configuration_definition/src/test/java/com/rusefi/test/output_pin_e_enumTest.java diff --git a/firmware/controllers/algo/rusefi_hw_stm32_enums.h b/firmware/controllers/algo/rusefi_hw_stm32_enums.h index 661e8e8930..96a2531928 100644 --- a/firmware/controllers/algo/rusefi_hw_stm32_enums.h +++ b/firmware/controllers/algo/rusefi_hw_stm32_enums.h @@ -307,14 +307,14 @@ enum class Gpio : uint16_t { MC33810_0_GD_2 = 286, MC33810_0_GD_3 = 287, - MC33810_1_OUT_0 = 291, - MC33810_1_OUT_1 = 292, - MC33810_1_OUT_2 = 293, - MC33810_1_OUT_3 = 294, - MC33810_1_GD_0 = 295, - MC33810_1_GD_1 = 296, - MC33810_1_GD_2 = 297, - MC33810_1_GD_3 = 298, + MC33810_1_OUT_0 = 290, + MC33810_1_OUT_1 = 291, + MC33810_1_OUT_2 = 292, + MC33810_1_OUT_3 = 293, + MC33810_1_GD_0 = 294, + MC33810_1_GD_1 = 295, + MC33810_1_GD_2 = 296, + MC33810_1_GD_3 = 297, }; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 252c4b6e69..604bedaeaa 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -319,7 +319,8 @@ custom sent_input_pin_e 2 bits, U16, @OFFSET@, [0:7], @@sent_input_pin_e_enum@@ custom Gpio 2 bits, U16, @OFFSET@, [0:7], $gpio_list custom switch_input_pin_e 2 bits, U16, @OFFSET@, [0:7], $switch_input_pin_e_list -#define output_pin_e_enum "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "PF0", "PF1", "PF2", "PF3", "PF4", "PF5", "PF6", "PF7", "PF8", "PF9", "PF10", "PF11", "PF12", "PF13", "PF14", "PF15", "PG0", "PG1", "PG2", "PG3", "PG4", "PG5", "PG6", "PG7", "PG8", "PG9", "PG10", "PG11", "PG12", "PG13", "PG14", "PG15", "PH0", "PH1", "PH2", "PH3", "PH4", "PH5", "PH6", "PH7", "PH8", "PH9", "PH10", "PH11", "PH12", "PH13", "PH14", "PH15", "PI0", "PI1", "PI2", "PI3", "PI4", "PI5", "PI6", "PI7", "PI8", "PI9", "PI10", "PI11", "PI12", "PI13", "PI14", "PI15", "MC33972_1", "MC33972_2", "MC33972_3", "MC33972_4", "MC33972_5", "MC33972_6", "MC33972_7", "MC33972_8", "MC33972_9", "MC33972_10", "MC33972_11", "MC33972_12", "MC33972_13", "MC33972_14", "MC33972_15", "MC33972_16", "MC33972_17", "MC33972_18", "MC33972_19", "MC33972_20", "MC33972_21", "MC33972_22", "TLE8888_1", "TLE8888_2", "TLE8888_3", "TLE8888_4", "TLE8888_5", "TLE8888_6", "TLE8888_7", "TLE8888_8", "TLE8888_9", "TLE8888_10", "TLE8888_11", "TLE8888_12", "TLE8888_13", "TLE8888_14", "TLE8888_15", "TLE8888_16", "TLE8888_17", "TLE8888_18", "TLE8888_19", "TLE8888_20", "TLE8888_21", "TLE8888_22", "TLE8888_23", "TLE8888_24", "TLE8888_25", "TLE8888_26", "TLE8888_27", "TLE8888_28", "INVALID", "INVALID", "INVALID", "TLE6240_1", "TLE6240_2", "TLE6240_3", "TLE6240_4", "TLE6240_5", "TLE6240_6", "TLE6240_7", "TLE6240_8", "TLE6240_9", "TLE6240_10", "TLE6240_11", "TLE6240_12", "TLE6240_13", "TLE6240_14", "TLE6240_15", "TLE6240_16", "L215", "L216", "L217", "L218", "L219", "L220", "L221", "L222", "L223", "L224", "L225", "L226", "L227", "L228", "L229", "L230", "L231", "L232", "L233", "L234", "L235", "L236", "L237", "L238", "L239", "L240", "L241", "L242", "L243", "L244", "L245", "L246", "L247", "L248", "can0", "can1", "can2", "can3", "can4", "can5", "can6", "can7", "protected 0", "protected 1", "protected 2", "protected 3", "protected 4", "protected 5", "protected 6", "protected 7", "MC33810_0_OUT_0", "MC33810_0_OUT_1", "MC33810_0_OUT_2", "MC33810_0_OUT_3", "MC33810_0_GD_0", "MC33810_0_GD_1", "MC33810_0_GD_2", "MC33810_0_GD_3" +! see output_pin_e_enumTest.java +#define output_pin_e_enum "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "PF0", "PF1", "PF2", "PF3", "PF4", "PF5", "PF6", "PF7", "PF8", "PF9", "PF10", "PF11", "PF12", "PF13", "PF14", "PF15", "PG0", "PG1", "PG2", "PG3", "PG4", "PG5", "PG6", "PG7", "PG8", "PG9", "PG10", "PG11", "PG12", "PG13", "PG14", "PG15", "PH0", "PH1", "PH2", "PH3", "PH4", "PH5", "PH6", "PH7", "PH8", "PH9", "PH10", "PH11", "PH12", "PH13", "PH14", "PH15", "PI0", "PI1", "PI2", "PI3", "PI4", "PI5", "PI6", "PI7", "PI8", "PI9", "PI10", "PI11", "PI12", "PI13", "PI14", "PI15", "MC33972_1", "MC33972_2", "MC33972_3", "MC33972_4", "MC33972_5", "MC33972_6", "MC33972_7", "MC33972_8", "MC33972_9", "MC33972_10", "MC33972_11", "MC33972_12", "MC33972_13", "MC33972_14", "MC33972_15", "MC33972_16", "MC33972_17", "MC33972_18", "MC33972_19", "MC33972_20", "MC33972_21", "MC33972_22", "TLE8888_1", "TLE8888_2", "TLE8888_3", "TLE8888_4", "TLE8888_5", "TLE8888_6", "TLE8888_7", "TLE8888_8", "TLE8888_9", "TLE8888_10", "TLE8888_11", "TLE8888_12", "TLE8888_13", "TLE8888_14", "TLE8888_15", "TLE8888_16", "TLE8888_17", "TLE8888_18", "TLE8888_19", "TLE8888_20", "TLE8888_21", "TLE8888_22", "TLE8888_23", "TLE8888_24", "TLE8888_25", "TLE8888_26", "TLE8888_27", "TLE8888_28", "INVALID", "INVALID", "INVALID", "TLE6240_1", "TLE6240_2", "TLE6240_3", "TLE6240_4", "TLE6240_5", "TLE6240_6", "TLE6240_7", "TLE6240_8", "TLE6240_9", "TLE6240_10", "TLE6240_11", "TLE6240_12", "TLE6240_13", "TLE6240_14", "TLE6240_15", "TLE6240_16", "L215", "L216", "L217", "L218", "L219", "L220", "L221", "L222", "L223", "L224", "L225", "L226", "L227", "L228", "L229", "L230", "L231", "L232", "L233", "L234", "L235", "L236", "L237", "L238", "L239", "L240", "L241", "L242", "L243", "L244", "L245", "L246", "L247", "L248", "can0", "can1", "can2", "can3", "can4", "can5", "can6", "can7", "protected_0", "protected_1", "protected_2", "protected_3", "protected_4", "protected_5", "protected_6", "protected_7", "protected_8", "protected_9", "protected_10", "protected_11", "protected_12", "protected_13", "protected_14", "protected_15", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "MC33810_0_OUT_0", "MC33810_0_OUT_1", "MC33810_0_OUT_2", "MC33810_0_OUT_3", "MC33810_0_GD_0", "MC33810_0_GD_1", "MC33810_0_GD_2", "MC33810_0_GD_3" custom output_pin_e 2 bits, U16, @OFFSET@, [0:8], $output_pin_e_list #define output_pin_e_fullenum @@output_pin_e_enum@@ diff --git a/java_tools/configuration_definition/src/test/java/com/rusefi/test/ConfigDefinitionTest.java b/java_tools/configuration_definition/src/test/java/com/rusefi/test/ConfigDefinitionTest.java index 5ac5cee979..fe3b14afc6 100644 --- a/java_tools/configuration_definition/src/test/java/com/rusefi/test/ConfigDefinitionTest.java +++ b/java_tools/configuration_definition/src/test/java/com/rusefi/test/ConfigDefinitionTest.java @@ -2,6 +2,7 @@ package com.rusefi.test; import com.rusefi.EnumsReader; import com.rusefi.VariableRegistry; +import org.jetbrains.annotations.NotNull; import org.junit.Test; import java.io.File; @@ -19,9 +20,7 @@ public class ConfigDefinitionTest { EnumsReader enumsReader = new EnumsReader(); enumsReader.read(new FileReader(FIRMWARE + File.separator + "controllers/algo/engine_types.h")); - VariableRegistry variableRegistry = new VariableRegistry(); - - variableRegistry.readPrependValues(FIRMWARE + File.separator + "integration/rusefi_config.txt"); + VariableRegistry variableRegistry = readRealConfig(); String sb = variableRegistry.getEnumOptionsForTunerStudio(enumsReader, "engine_type_e"); @@ -30,4 +29,12 @@ public class ConfigDefinitionTest { assertNotNull(sb); assertTrue("Seems too long" + sb, sb.length() < 100000); } + + @NotNull + public static VariableRegistry readRealConfig() throws IOException { + VariableRegistry variableRegistry = new VariableRegistry(); + + variableRegistry.readPrependValues(FIRMWARE + File.separator + "integration/rusefi_config.txt"); + return variableRegistry; + } } diff --git a/java_tools/configuration_definition/src/test/java/com/rusefi/test/output_pin_e_enumTest.java b/java_tools/configuration_definition/src/test/java/com/rusefi/test/output_pin_e_enumTest.java new file mode 100644 index 0000000000..52bb88365a --- /dev/null +++ b/java_tools/configuration_definition/src/test/java/com/rusefi/test/output_pin_e_enumTest.java @@ -0,0 +1,20 @@ +package com.rusefi.test; + +import com.rusefi.VariableRegistry; +import org.junit.Test; + +import java.io.IOException; +import java.util.Arrays; + +import static com.rusefi.VariableRegistry.unquote; +import static org.junit.Assert.assertEquals; + +public class output_pin_e_enumTest { + @Test + public void test() throws IOException { + VariableRegistry r = ConfigDefinitionTest.readRealConfig(); + String packed = r.get("output_pin_e_enum"); + String[] array = packed.split("\\s+"); + assertEquals(unquote(array[287]), "MC33810_0_GD_3"); + } +}