From e54abe82b165c5e41ef6ed0b3a4090de98ec941a Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sat, 22 Nov 2014 18:03:15 -0600 Subject: [PATCH] auto-sync --- .../tunerstudio/tunerstudio_configuration.h | 1 + .../controllers/algo/auto_generated_enums.cpp | 2 ++ .../controllers/algo/engine_configuration.cpp | 3 +++ firmware/controllers/algo/engine_configuration.h | 16 ++++++++++++++-- firmware/controllers/algo/io_pins.h | 1 + firmware/controllers/flash_main.h | 2 +- firmware/controllers/settings.cpp | 4 ++++ firmware/hw_layer/io_pins.c | 1 + 8 files changed, 27 insertions(+), 3 deletions(-) diff --git a/firmware/console/tunerstudio/tunerstudio_configuration.h b/firmware/console/tunerstudio/tunerstudio_configuration.h index 922753ac17..39307c68d3 100644 --- a/firmware/console/tunerstudio/tunerstudio_configuration.h +++ b/firmware/console/tunerstudio/tunerstudio_configuration.h @@ -69,6 +69,7 @@ typedef struct { unsigned int isCltError : 1; // bit 1 unsigned int isMapError : 1; // bit 2 unsigned int isIatError : 1; // bit 3 + unsigned int isAcSwitchEngaged : 1; // bit 4 int tsConfigVersion; egt_values_s egtValues; int unused3[3]; diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index eebfc6b25c..71058c515a 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -37,6 +37,8 @@ case GPIO_7: return "GPIO_7"; case FAN_RELAY: return "FAN_RELAY"; +case AC_RElAY: + return "AC_RElAY"; case INJECTOR_8_OUTPUT: return "INJECTOR_8_OUTPUT"; case GPIO_6: diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index ccaf8add77..bb42ed0562 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -297,6 +297,9 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_ // engineConfiguration->idleMode = IM_AUTO; engineConfiguration->idleMode = IM_MANUAL; + boardConfiguration->acRelayPin = GPIO_UNASSIGNED; + boardConfiguration->acRelayPinMode = OM_DEFAULT; + #if EFI_PROD_CODE engineConfiguration->digitalChartSize = 300; #else diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index 2e60fea390..8f8dcd6e70 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -144,6 +144,9 @@ typedef struct { brain_pin_e electronicThrottlePin1; pin_output_mode_e electronicThrottlePin1Mode; + /** + * Idle switch input signal + */ brain_pin_e idleSwitchPin; pin_input_mode_e idleSwitchPinMode; @@ -233,7 +236,11 @@ typedef struct { */ float idleSolenoidPwm; - int unusedbs[51]; + brain_pin_e acRelayPin; + pin_output_mode_e acRelayPinMode; + + + int unusedbs[39]; le_formula_t le_formulas[LE_COMMAND_COUNT]; @@ -497,7 +504,12 @@ typedef struct { int targetIdleRpm; - int unused3[92]; + /** + * A/C button input handled as analog input + */ + adc_channel_e acSwitchAdc; + + int unused3[91]; } engine_configuration_s; diff --git a/firmware/controllers/algo/io_pins.h b/firmware/controllers/algo/io_pins.h index c920145bf8..ed955e5420 100644 --- a/firmware/controllers/algo/io_pins.h +++ b/firmware/controllers/algo/io_pins.h @@ -124,6 +124,7 @@ typedef enum { FUEL_PUMP_RELAY, FAN_RELAY, O2_HEATER, + AC_RElAY, SPI_CS_1, SPI_CS_2, diff --git a/firmware/controllers/flash_main.h b/firmware/controllers/flash_main.h index 133bf0b7ff..d92c5a7b67 100644 --- a/firmware/controllers/flash_main.h +++ b/firmware/controllers/flash_main.h @@ -12,7 +12,7 @@ #include "engine_configuration.h" #include "engine.h" -#define FLASH_DATA_VERSION 5472 +#define FLASH_DATA_VERSION 5484 void readFromFlash(void); void initFlash(Engine *engine); diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 57b538890e..aad67229ad 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -332,6 +332,10 @@ static void printTemperatureInfo(void) { scheduleMsg(&logger, "fan=%s @ %s", boolToString(getOutputPinValue(FAN_RELAY)), hwPortname(boardConfiguration->fanPin)); + scheduleMsg(&logger, "A/C relay=%s @ %s", boolToString(getOutputPinValue(AC_RElAY)), + hwPortname(boardConfiguration->acRelayPin)); + + #if EFI_ANALOG_INPUTS scheduleMsg(&logger, "base cranking fuel %f", engineConfiguration->crankingSettings.baseCrankingFuel); #endif diff --git a/firmware/hw_layer/io_pins.c b/firmware/hw_layer/io_pins.c index 5c916f37ca..64039c5651 100644 --- a/firmware/hw_layer/io_pins.c +++ b/firmware/hw_layer/io_pins.c @@ -156,6 +156,7 @@ void initOutputPins(void) { outputPinRegisterExt2("fan relay", FAN_RELAY, boardConfiguration->fanPin, &DEFAULT_OUTPUT); outputPinRegisterExt2("o2 heater", O2_HEATER, boardConfiguration->o2heaterPin, &DEFAULT_OUTPUT); outputPinRegisterExt2("trg_err", LED_TRIGGER_ERROR, boardConfiguration->triggerErrorPin, &boardConfiguration->triggerErrorPinMode); + outputPinRegisterExt2("A/C relay", AC_RElAY, boardConfiguration->acRelayPin, &boardConfiguration->acRelayPinMode); initialLedsBlink();