diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 21c1f8018f..717263e258 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -24,9 +24,6 @@ #include "engine_math.h" #include "fsio_impl.h" #include "allsensors.h" -#if EFI_PROD_CODE -#include "HIP9011.h" -#endif #include "custom_engine.h" @@ -434,9 +431,6 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { boardConfiguration->isFastAdcEnabled = true; engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003; -#if EFI_HIP_9011 || defined(__DOXYGEN__) - setHip9011FrankensoPinout(); -#endif boardConfiguration->hip9011Gain = 0.3; float t = 0.5; diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index bf27cbe215..4be30f1d9d 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -525,7 +525,8 @@ static THD_WORKING_AREA(lcdThreadStack, UTILITY_THREAD_STACK_SIZE); */ static THD_WORKING_AREA(blinkingStack, 128); -static OutputPin communicationPin; +// move this into EnginePins? +OutputPin communicationPin; OutputPin warningPin; OutputPin runningPin; @@ -609,7 +610,9 @@ static void blinkingThread(void *arg) { } #endif - communicationPin.setValue(0); + if (!hasFirmwareError() && !hasFirmwareErrorFlag) { + communicationPin.setValue(0); + } warningPin.setValue(0); chThdSleepMilliseconds(delayMs); diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 3b0b8e667c..48bd673d36 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -38,6 +38,10 @@ #include "hip9011_lookup.h" +#if EFI_PROD_CODE +#include "HIP9011.h" +#endif + #include "custom_engine.h" #include "engine_template.h" #include "acura_rsx.h" @@ -813,6 +817,9 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { boardConfiguration->spi3sckPin = GPIOB_3; boardConfiguration->hip9011Gain = 1; +#if EFI_HIP_9011 || defined(__DOXYGEN__) + setHip9011FrankensoPinout(); +#endif boardConfiguration->sdCardCsPin = GPIOD_4; boardConfiguration->isSdCardEnabled = true; diff --git a/firmware/controllers/error_handling.cpp b/firmware/controllers/error_handling.cpp index 96219316f3..cfc3995d06 100644 --- a/firmware/controllers/error_handling.cpp +++ b/firmware/controllers/error_handling.cpp @@ -17,6 +17,8 @@ #include static MemoryStream warningStream; static MemoryStream firmwareErrorMessageStream; +extern OutputPin communicationPin; + #endif diff --git a/firmware/global.h b/firmware/global.h index ebe1af512f..c2734ff337 100644 --- a/firmware/global.h +++ b/firmware/global.h @@ -118,7 +118,8 @@ typedef VirtualTimer virtual_timer_t; */ #define ON_FATAL_ERROR() \ palWritePad(LED_ERROR_PORT, LED_ERROR_PIN, 1); \ - turnAllPinsOff(); + turnAllPinsOff(); \ + communicationPin.setValue(1); #endif /* GLOBAL_H_ */ diff --git a/firmware/hw_layer/HIP9011.cpp b/firmware/hw_layer/HIP9011.cpp index 3e15290b16..10c8393862 100644 --- a/firmware/hw_layer/HIP9011.cpp +++ b/firmware/hw_layer/HIP9011.cpp @@ -146,12 +146,13 @@ static void showHipInfo(void) { correctResponse, invalidResponse); scheduleMsg(logger, "CS@%s updateCount=%d", hwPortname(boardConfiguration->hip9011CsPin), settingUpdateCount); - scheduleMsg(logger, "hip %fv/last=%f@%s/max=%f spiCount=%d adv=%d", + const char * msg = spiCount == 0 ? "NOT GOOD" : "ok"; + scheduleMsg(logger, "hip %fv/last=%f@%s/max=%f spiCount=%d (%s) adv=%d", engine->knockVolts, getVoltage("hipinfo", engineConfiguration->hipOutputChannel), getPinNameByAdcChannel("hip", engineConfiguration->hipOutputChannel, pinNameBuffer), hipValueMax, - spiCount, boardConfiguration->useTpicAdvancedMode); + spiCount, msg, boardConfiguration->useTpicAdvancedMode); scheduleMsg(logger, "mosi=%s", hwPortname(getMosiPin(hipSpiDevice))); scheduleMsg(logger, "miso=%s", hwPortname(getMisoPin(hipSpiDevice))); scheduleMsg(logger, "sck=%s", hwPortname(getSckPin(hipSpiDevice))); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 6c4ace5109..2a5be12e5e 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -658,8 +658,8 @@ float[BARO_CORR_SIZE] baroCorrRpmBins;;"RPM", 1, 0, 0.0, 18000, baro_corr_table_t baroCorrTable; - #define pin_mode_e_enum "default", "INVALID", "INVALID", "INVALID", "mode4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "mode32", "mode33", "mode34", "mode35" -custom pin_mode_e 4 bits, U32, @OFFSET@, [0:3], @@pin_mode_e_enum@@ + #define pin_mode_e_enum "default", "INVALID", "INVALID", "INVALID", "opendrain", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "PULLUP", "mode33", "mode34", "mode35" +custom pin_mode_e 4 bits, U32, @OFFSET@, [0:5], @@pin_mode_e_enum@@ pin_mode_e spi2SckMode; pin_mode_e spi2MosiMode; diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 48add88fa8..a53e89bd15 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -249,5 +249,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20170123; + return 20170126; } diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 576536bb8f..28f2b547fb 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -42,7 +42,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Jan 26 13:13:15 EST 2017 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Jan 26 22:30:47 EST 2017 pageSize = 16376 page = 1 @@ -498,9 +498,9 @@ page = 1 baroCorrPressureBins = array, F32, 1644, [4], "kPa", 1, 0, 0.0, 200, 2 baroCorrRpmBins = array, F32, 1660, [4], "RPM", 1, 0, 0.0, 18000, 2 baroCorrTable = array, F32, 1676, [4x4],"%", 1, 0, 0, 999.0, 2 - spi2SckMode = bits, U32, 1740, [0:3], "default", "INVALID", "INVALID", "INVALID", "mode4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "mode32", "mode33", "mode34", "mode35" - spi2MosiMode = bits, U32, 1744, [0:3], "default", "INVALID", "INVALID", "INVALID", "mode4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "mode32", "mode33", "mode34", "mode35" - spi2MisoMode = bits, U32, 1748, [0:3], "default", "INVALID", "INVALID", "INVALID", "mode4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "mode32", "mode33", "mode34", "mode35" + spi2SckMode = bits, U32, 1740, [0:5], "default", "INVALID", "INVALID", "INVALID", "opendrain", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "PULLUP", "mode33", "mode34", "mode35" + spi2MosiMode = bits, U32, 1744, [0:5], "default", "INVALID", "INVALID", "INVALID", "opendrain", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "PULLUP", "mode33", "mode34", "mode35" + spi2MisoMode = bits, U32, 1748, [0:5], "default", "INVALID", "INVALID", "INVALID", "opendrain", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "PULLUP", "mode33", "mode34", "mode35" crankingTpsCoef = array, F32, 1752, [8], "%", 1, 0, 0.0, 700.0, 2 crankingTpsBins = array, F32, 1784, [8], "%", 1, 0, 0.0, 100.0, 2 tachPulseDuractionMs = scalar, F32, 1816, "ms", 1, 0, 0.0, 100.0, 2 diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 34fe5849a4..e8596b4ad7 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 rusefi_config.txt Thu Jan 26 13:13:15 EST 2017 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Jan 26 22:30:47 EST 2017 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int FSIO_ADC_COUNT = 4; @@ -1457,7 +1457,7 @@ public class Fields { public static final Field NOACCELAFTERHARDLIMITPERIODSECS = Field.create("NOACCELAFTERHARDLIMITPERIODSECS", 1636, FieldType.FLOAT); public static final Field MAPAVERAGINGSCHEDULINGATINDEX = Field.create("MAPAVERAGINGSCHEDULINGATINDEX", 1640, FieldType.INT); public static final Field BAROCORRTABLE = Field.create("BAROCORRTABLE", 1676, FieldType.INT); - public static final String[] pin_mode_e = {"default", "INVALID", "INVALID", "INVALID", "mode4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "mode32", "mode33", "mode34", "mode35"}; + public static final String[] pin_mode_e = {"default", "INVALID", "INVALID", "INVALID", "opendrain", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "mode12", "mode13", "mode14", "mode15", "mode16", "mode17", "mode18", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25", "mode26", "mode27", "mode28", "mode29", "mode30", "mode31", "PULLUP", "mode33", "mode34", "mode35"}; public static final Field SPI2SCKMODE = Field.create("SPI2SCKMODE", 1740, FieldType.INT, pin_mode_e); public static final Field SPI2MOSIMODE = Field.create("SPI2MOSIMODE", 1744, FieldType.INT, pin_mode_e); public static final Field SPI2MISOMODE = Field.create("SPI2MISOMODE", 1748, FieldType.INT, pin_mode_e);