diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index ad78f5d009..df383ffef8 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -259,7 +259,13 @@ typedef enum __attribute__ ((__packed__)) { typedef enum __attribute__ ((__packed__)) { PI_DEFAULT = 0, PI_PULLUP = 1, - PI_PULLDOWN = 2 + PI_PULLDOWN = 2, + /** + * bit 2 is used as inverted flag, so skip one here + */ + PI_INVERTED_DEFAULT = 4, + PI_INVERTED_PULLUP = 5, + PI_INVERTED_PULLDOWN = 6 } pin_input_mode_e; /** diff --git a/firmware/hw_layer/io_pins.cpp b/firmware/hw_layer/io_pins.cpp index 9bc517fe53..accf7a6bab 100644 --- a/firmware/hw_layer/io_pins.cpp +++ b/firmware/hw_layer/io_pins.cpp @@ -103,10 +103,13 @@ bool efiReadPin(brain_pin_e pin) { iomode_t getInputMode(pin_input_mode_e mode) { switch (mode) { case PI_PULLUP: + case PI_INVERTED_PULLUP: return PAL_MODE_INPUT_PULLUP; case PI_PULLDOWN: + case PI_INVERTED_PULLDOWN: return PAL_MODE_INPUT_PULLDOWN; case PI_DEFAULT: + case PI_INVERTED_DEFAULT: default: return PAL_MODE_INPUT; } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 697cd16be3..884116d848 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -362,8 +362,8 @@ custom output_pin_e 2 bits, U16, @OFFSET@, [0:8], $output_pin_e_list #define pin_output_mode_e_enum "default", "default inverted", "open collector", "open collector inverted" custom pin_output_mode_e 1 bits, U08, @OFFSET@, [0:1], @@pin_output_mode_e_enum@@ -#define pin_input_mode_e_enum "DEFAULT", "PULLUP", "PULLDOWN" -custom pin_input_mode_e 1 bits, U08, @OFFSET@, [0:1], @@pin_input_mode_e_enum@@ +#define pin_input_mode_e_enum "DEFAULT", "PULLUP", "PULLDOWN", "INVALID", "INVERTED DEFAULT", "INVERTED PULLUP", "INVERTED PULLDOWN" +custom pin_input_mode_e 1 bits, U08, @OFFSET@, [0:2], @@pin_input_mode_e_enum@@ #define gppwm_channel_e_enum "Zero", "TPS", "MAP", "CLT", "IAT", "Fuel Load", "Ignition Load", "Aux Temp 1", "Aux Temp 2", "Accel Pedal", "Battery Voltage", "VVT 1 I", "VVT 1 E", "VVT 2 I", "VVT 2 E", "Ethanol (Flex) %", "Aux Linear 1", "Aux Linear 2", "GPPWM Output 1", "GPPWM Output 2", "GPPWM Output 3", "GPPWM Output 4", "Lua Gauge 1", "Lua Gauge 2", "RPM", "Gear (detected)", "Baro pressure", "EGT 1", "EGT 2", "Aux Linear 3", "Aux Linear 4", "Vehicle speed", "Oil pressure", "Oil temp" custom gppwm_channel_e 1 bits, U08, @OFFSET@, [0:5], @@gppwm_channel_e_enum@@