diff --git a/firmware/config/boards/microrusefi/mapping.yaml b/firmware/config/boards/microrusefi/mapping.yaml index 193a864e56..bba8fe07e4 100644 --- a/firmware/config/boards/microrusefi/mapping.yaml +++ b/firmware/config/boards/microrusefi/mapping.yaml @@ -10,6 +10,15 @@ outputs: TLE8888_PIN_20: "Extra Low #5" TLE8888_PIN_21: "Extra Low #6" +event_inputs: + GPIOA_5: "haha2" + GPIOC_6: "hoho1" + +switch_inputs: + GPIOE_10: "Brake Switch" + GPIOG_1: "Clutch Switch" + + analog_inputs: EFI_ADC_0: "AN-TEMP-1" EFI_ADC_1: "AN-TEMP-2" diff --git a/firmware/config/boards/microrusefi/prepend.txt b/firmware/config/boards/microrusefi/prepend.txt index 7639f8adc1..efc5cc3fbb 100644 --- a/firmware/config/boards/microrusefi/prepend.txt +++ b/firmware/config/boards/microrusefi/prepend.txt @@ -5,3 +5,4 @@ #define ts_show_joystick false #define ts_show_egt false #define ts_show_gps false +#define ts_show_etb_pins false diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 4d724f2558..4dba63bd6f 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Sun Jun 02 14:03:15 EDT 2019 +// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Fri Jun 07 17:34:20 EDT 2019 // begin #ifndef CONTROLLERS_ALGO_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H #define CONTROLLERS_ALGO_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H @@ -543,7 +543,7 @@ struct board_configuration_s { * some cars have a switch to indicate that clutch pedal is all the way down * offset 64 */ - brain_pin_e clutchDownPin; + switch_input_pin_e clutchDownPin; /** * offset 65 */ @@ -989,7 +989,7 @@ struct board_configuration_s { * Some vehicles have a switch to indicate that clutch pedal is all the way up * offset 369 */ - brain_pin_e clutchUpPin; + switch_input_pin_e clutchUpPin; /** * offset 370 */ @@ -2263,7 +2263,7 @@ struct engine_configuration_s { /** * offset 2632 */ - brain_pin_e brakePedalPin; + switch_input_pin_e brakePedalPin; /** * lambda input * offset 2633 @@ -2788,4 +2788,4 @@ typedef struct persistent_config_s persistent_config_s; #endif // end -// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Sun Jun 02 14:03:15 EDT 2019 +// this section was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Fri Jun 07 17:34:20 EDT 2019 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index d58c9b7435..68439f885b 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -1597,6 +1597,7 @@ #define stepperParkingExtraSteps_offset_hex 332 #define storageMode_offset 2280 #define storageMode_offset_hex 8e8 +#define switch_input_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","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" #define tachOutputPin_offset 704 #define tachOutputPin_offset_hex 2c0 #define tachOutputPinMode_offset 705 @@ -1759,6 +1760,7 @@ #define ts_show_cj125 true #define ts_show_egt true #define ts_show_etb true +#define ts_show_etb_pins true #define ts_show_full_pinout true #define ts_show_gps true #define ts_show_hip9011 true diff --git a/firmware/controllers/algo/rusefi_types.h b/firmware/controllers/algo/rusefi_types.h index 96eedfd5ce..1cd987c8f5 100644 --- a/firmware/controllers/algo/rusefi_types.h +++ b/firmware/controllers/algo/rusefi_types.h @@ -98,6 +98,7 @@ typedef float fsio_setting_t; typedef float cfg_float_t_1f; typedef brain_pin_e brain_input_pin_e; +typedef brain_pin_e switch_input_pin_e; typedef fuel_table_t ve_table_t; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index eb2b5b3339..edbc426089 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -181,7 +181,11 @@ custom mass_storage_e 4 bits, U32, @OFFSET@, [0:1], @@mass_storage_e_enum@@ custom brain_input_pin_e 1 bits, U08, @OFFSET@, [0:6], @@brain_input_pin_e_enum@@ #define brain_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","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" +#define switch_input_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","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" + custom brain_pin_e 1 bits, U08, @OFFSET@, [0:7], @@brain_pin_e_enum@@ +custom switch_input_pin_e 1 bits, U08, @OFFSET@, [0:7], @@switch_input_pin_e_enum@@ + #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","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", "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", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" custom output_pin_e 1 bits, U08, @OFFSET@, [0:7], @@output_pin_e_enum@@ @@ -522,7 +526,7 @@ float mapFrequency100Kpa;;"Hz", 1, 0, 0, 100000, 2 pin_output_mode_e fanPinMode; output_pin_e fanPin; -brain_pin_e clutchDownPin;some cars have a switch to indicate that clutch pedal is all the way down +switch_input_pin_e clutchDownPin;some cars have a switch to indicate that clutch pedal is all the way down output_pin_e alternatorControlPin; pin_output_mode_e alternatorControlPinMode; pin_input_mode_e clutchDownPinMode; @@ -691,7 +695,7 @@ maf_sensor_type_e mafSensorType; brain_pin_e[FSIO_COMMAND_COUNT iterate] fsioDigitalInputs;todo:not finshed\nThese input pins allow us to pull toggle buttons state; brain_input_pin_e vehicleSpeedSensorInputPin; - brain_pin_e clutchUpPin;Some vehicles have a switch to indicate that clutch pedal is all the way up + switch_input_pin_e clutchUpPin;Some vehicles have a switch to indicate that clutch pedal is all the way up brain_input_pin_e frequencyReportingMapInputPin; pin_input_mode_e clutchUpPinMode; float etbIdleRange;;"angle", 1, 0, -100, 100, 2 @@ -961,7 +965,7 @@ float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0.0, 300, brain_pin_e mc33816_rstb;ResetB brain_pin_e mc33816_driven - brain_pin_e brakePedalPin + switch_input_pin_e brakePedalPin adc_channel_e cj125ua;lambda input adc_channel_e cj125ur;heater input pin_input_mode_e brakePedalPinMode; @@ -1208,6 +1212,7 @@ end_struct #define ts_show_hip9011 true #define ts_show_cj125 true #define ts_show_etb true +#define ts_show_etb_pins true #define ts_show_full_pinout true #define ts_show_lcd true #define ts_show_joystick true diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index cdbd5dfea4..c14ef7a559 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1597,12 +1597,12 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "Idle Stepper Enable", stepperEnablePin field = "Fuel Pump Pin", fuelPumpPin field = "Fuel Pump Pin Mode", fuelPumpPinMode - field = "ETB#1 Dir #1", etb1_directionPin1 - field = "ETB#1 Dir #2", etb1_directionPin2 - field = "ETB#1 Control #1", etb1_controlPin1 - field = "ETB#2 Dir #1", etb2_directionPin1 - field = "ETB#2 Dir #2", etb2_directionPin2 - field = "ETB#2 Control #1", etb2_controlPin1 + field = "ETB#1 Dir #1", etb1_directionPin1 @@if_ts_show_etb_pins + field = "ETB#1 Dir #2", etb1_directionPin2 @@if_ts_show_etb_pins + field = "ETB#1 Control #1", etb1_controlPin1 @@if_ts_show_etb_pins + field = "ETB#2 Dir #1", etb2_directionPin1 @@if_ts_show_etb_pins + field = "ETB#2 Dir #2", etb2_directionPin2 @@if_ts_show_etb_pins + field = "ETB#2 Control #1", etb2_controlPin1 @@if_ts_show_etb_pins field = "SD CS Pin", sdCardCsPin field = "Check Engine Pin", malfunctionIndicatorPin field = "Check Engine Pin Mode", malfunctionIndicatorPinMode diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 7249da969b..d344bc2f49 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config; -// this file was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Mon Jun 03 10:01:41 EDT 2019 +// this file was generated automatically by ConfigDefinition.jar based on integration\rusefi_config.txt Fri Jun 07 17:34:20 EDT 2019 public class Fields { public static final int accelerometerSpiDevice_offset = 2736; public static final int acCutoffHighRpm_offset = 1498; @@ -1421,7 +1421,8 @@ public class Fields { public static final Field MALFUNCTIONINDICATORPINMODE = Field.create("MALFUNCTIONINDICATORPINMODE", 661, FieldType.INT8, pin_output_mode_e); public static final Field FANPINMODE = Field.create("FANPINMODE", 662, FieldType.INT8, pin_output_mode_e); public static final Field FANPIN = Field.create("FANPIN", 663, FieldType.INT8, output_pin_e); - public static final Field CLUTCHDOWNPIN = Field.create("CLUTCHDOWNPIN", 664, FieldType.INT8, brain_pin_e); + public static final String[] switch_input_pin_e = {"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","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"}; + public static final Field CLUTCHDOWNPIN = Field.create("CLUTCHDOWNPIN", 664, FieldType.INT8, switch_input_pin_e); public static final Field ALTERNATORCONTROLPIN = Field.create("ALTERNATORCONTROLPIN", 665, FieldType.INT8, output_pin_e); public static final Field ALTERNATORCONTROLPINMODE = Field.create("ALTERNATORCONTROLPINMODE", 666, FieldType.INT8, pin_output_mode_e); public static final Field CLUTCHDOWNPINMODE = Field.create("CLUTCHDOWNPINMODE", 667, FieldType.INT8); @@ -1635,7 +1636,7 @@ public class Fields { public static final Field FSIODIGITALINPUTS15 = Field.create("FSIODIGITALINPUTS15", 966, FieldType.INT8, brain_pin_e); public static final Field FSIODIGITALINPUTS16 = Field.create("FSIODIGITALINPUTS16", 967, FieldType.INT8, brain_pin_e); public static final Field VEHICLESPEEDSENSORINPUTPIN = Field.create("VEHICLESPEEDSENSORINPUTPIN", 968, FieldType.INT8, brain_input_pin_e); - public static final Field CLUTCHUPPIN = Field.create("CLUTCHUPPIN", 969, FieldType.INT8, brain_pin_e); + public static final Field CLUTCHUPPIN = Field.create("CLUTCHUPPIN", 969, FieldType.INT8, switch_input_pin_e); public static final Field FREQUENCYREPORTINGMAPINPUTPIN = Field.create("FREQUENCYREPORTINGMAPINPUTPIN", 970, FieldType.INT8, brain_input_pin_e); public static final Field CLUTCHUPPINMODE = Field.create("CLUTCHUPPINMODE", 971, FieldType.INT8); public static final Field ETBIDLERANGE = Field.create("ETBIDLERANGE", 972, FieldType.FLOAT); @@ -1898,7 +1899,7 @@ public class Fields { public static final Field STEPPERENABLEPINMODE = Field.create("STEPPERENABLEPINMODE", 2629, FieldType.INT8, pin_output_mode_e); public static final Field MC33816_RSTB = Field.create("MC33816_RSTB", 2630, FieldType.INT8, brain_pin_e); public static final Field MC33816_DRIVEN = Field.create("MC33816_DRIVEN", 2631, FieldType.INT8, brain_pin_e); - public static final Field BRAKEPEDALPIN = Field.create("BRAKEPEDALPIN", 2632, FieldType.INT8, brain_pin_e); + public static final Field BRAKEPEDALPIN = Field.create("BRAKEPEDALPIN", 2632, FieldType.INT8, switch_input_pin_e); public static final Field CJ125UA = Field.create("CJ125UA", 2633, FieldType.INT8, adc_channel_e); public static final Field CJ125UR = Field.create("CJ125UR", 2634, FieldType.INT8, adc_channel_e); public static final Field BRAKEPEDALPINMODE = Field.create("BRAKEPEDALPINMODE", 2635, FieldType.INT8); diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index 624ec12fd9..bf5ee06837 100644 Binary files a/java_tools/ConfigDefinition.jar and b/java_tools/ConfigDefinition.jar differ diff --git a/java_tools/configuration_definition/src/com/rusefi/board_generator/BoardReader.java b/java_tools/configuration_definition/src/com/rusefi/board_generator/BoardReader.java index 28b50bb19c..54ad0dca8a 100644 --- a/java_tools/configuration_definition/src/com/rusefi/board_generator/BoardReader.java +++ b/java_tools/configuration_definition/src/com/rusefi/board_generator/BoardReader.java @@ -52,11 +52,16 @@ public class BoardReader { bw.write(processSection(data, "brain_pin_e", "output_pin_e", "outputs", "GPIO_UNASSIGNED")); bw.write(processSection(data, "adc_channel_e", "adc_channel_e", "analog_inputs", "EFI_ADC_NONE")); + bw.write(processSection(data, "brain_pin_e", "brain_input_pin_e", "event_inputs", "GPIO_UNASSIGNED")); + bw.write(processSection(data, "brain_pin_e", "switch_input_pin_e", "switch_inputs", "GPIO_UNASSIGNED")); + bw.close(); } - private static String processSection(Map data, String headerEnumName, String oututEnumName, String sectionName, String NOTHING_NAME) { + private static String processSection(Map data, String headerEnumName, String outputEnumName, String sectionName, String NOTHING_NAME) { Map outputs = (Map) data.get(sectionName); + if (outputs == null) + return ""; Map enumMap = EnumsReader.enums.get(headerEnumName); Objects.requireNonNull(enumMap, "enum for " + headerEnumName); @@ -86,7 +91,7 @@ public class BoardReader { sb.append("\"" + code + "\""); } - return " #define " + oututEnumName + "_enum " + sb + "\r\n"; + return " #define " + outputEnumName + "_enum " + sb + "\r\n"; } private static int getMaxValue(Collection values) {