diff --git a/firmware/config/engines/chevrolet_c20_1973.cpp b/firmware/config/engines/chevrolet_c20_1973.cpp index 3a60ff940a..97fa96e39d 100644 --- a/firmware/config/engines/chevrolet_c20_1973.cpp +++ b/firmware/config/engines/chevrolet_c20_1973.cpp @@ -14,6 +14,7 @@ */ #include "chevrolet_c20_1973.h" +#include "engine_math.h" EXTERN_ENGINE; @@ -36,6 +37,8 @@ void set1973c20(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->trigger.customTotalToothCount = 8; engineConfiguration->trigger.customSkippedToothCount = 0; + engineConfiguration->rpmHardLimit = 5000; + setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER); } diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index 63dcdeb00e..3c27dfabeb 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -42,6 +42,8 @@ //#define SERIAL_SPEED (8 * 115200) //#define SERIAL_SPEED (2 * 115200) +//todo: make this configurable via Tuner Studio +//todo: see uartConsoleSerialSpeed #define SERIAL_SPEED 115200 /** diff --git a/firmware/console/console_io.h b/firmware/console/console_io.h index 68a6e8ed91..cd9aa414fb 100644 --- a/firmware/console/console_io.h +++ b/firmware/console/console_io.h @@ -16,6 +16,7 @@ typedef void (*CommandHandler)(char *); #include "efifeatures.h" #include "datalogging.h" +// todo: make this pin configurable #define GET_CONSOLE_MODE_VALUE() palReadPad(CONSOLE_MODE_SWITCH_PORT, CONSOLE_MODE_SWITCH_PIN) #define SHOULD_INGORE_FLASH() (palReadPad(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN) == 0) diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 1c05c6f60c..694515c0d7 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -48,11 +48,12 @@ private: }; /** - * this part of the structure is separate just because so far - * these fields are not integrated with Tuner Studio. Step by step :) + * This structure is still separate from Engine simply because this goes into CCM memory and Engine is in main memory + * todo: re-arrange global variables to put something else into CCM so that this can go into main + * so that this could be mergeed into Engine + * todo: move these fields into Engine class, eliminate this class */ class engine_configuration2_s { - // todo: move these fields into Engine class, eliminate this class public: engine_configuration2_s(); diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 15cdca39e2..fa0d5af07a 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -248,6 +248,9 @@ void setDefaultBasePins(DECLARE_ENGINE_PARAMETER_F) { * * flash version of configuration failed CRC check or appears to be older then FLASH_DATA_VERSION * * 'rewriteconfig' command * * 'set_engine_type X' command + * + * This method should only change the state of the configuration data structure but should NOT change the state of + * anything else. */ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { #if (! EFI_UNIT_TEST) || defined(__DOXYGEN__) @@ -657,6 +660,8 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { boardConfiguration->isVerboseAlternator = false; boardConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED; + engineConfiguration->uartConsoleSerialSpeed = 115200; + engineConfiguration->mapAccelLength = 6; engineConfiguration->mapAccelEnrichmentThreshold = 5; // kPa diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index aea7ffbc6e..5706583614 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 rusefi_config.txt Tue Dec 08 10:02:06 EST 2015 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Dec 21 19:26:52 EST 2015 // begin #include "rusefi_types.h" typedef struct { @@ -1443,7 +1443,11 @@ typedef struct { /** * offset 2228 */ - int unused[197]; + uint32_t uartConsoleSerialSpeed; + /** + * offset 2232 + */ + int unused[196]; /** total size 3016*/ } engine_configuration_s; @@ -1592,4 +1596,4 @@ typedef struct { } persistent_config_s; // end -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Dec 08 10:02:06 EST 2015 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Dec 21 19:26:52 EST 2015 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index d0c888080c..53a5d60a16 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -725,7 +725,8 @@ #define fatalErrorPin_offset 2216 #define warninigPin_offset 2220 #define configResetPin_offset 2224 -#define unused_offset 2228 +#define uartConsoleSerialSpeed_offset 2228 +#define unused_offset 2232 #define le_formulas1_offset 3016 #define le_formulas2_offset 3216 #define le_formulas3_offset 3416 diff --git a/firmware/controllers/flash_main.cpp b/firmware/controllers/flash_main.cpp index 6f562e3c11..9f1daa8da5 100644 --- a/firmware/controllers/flash_main.cpp +++ b/firmware/controllers/flash_main.cpp @@ -106,7 +106,7 @@ static bool hasValidEngineType(engine_configuration_s *engineConfiguration) { } void readFromFlash(void) { - efiAssertVoid(getRemainingStack(chThdSelf()) > 256, "read f"); + efiAssertVoid(getRemainingStack(chThdSelf()) > 256, "read f"); printMsg(logger, "readFromFlash()"); flashRead(FLASH_ADDR, (char *) &persistentState, PERSISTENT_SIZE); diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 9a85b81ca0..655f379032 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -210,7 +210,7 @@ void applyNewHardwareSettings(void) { } void initHardware(Logging *l) { - efiAssertVoid(getRemainingStack(chThdSelf()) > 256, "init h"); + efiAssertVoid(getRemainingStack(chThdSelf()) > 256, "init h"); sharedLogger = l; engine_configuration_s *engineConfiguration = engine->engineConfiguration; efiAssertVoid(engineConfiguration!=NULL, "engineConfiguration"); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 3c6eee403f..5d80b58d2f 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -625,7 +625,8 @@ baro_corr_table_t baroCorrTable; brain_pin_e fatalErrorPin; brain_pin_e warninigPin; brain_pin_e configResetPin; - int[197] unused; + uint32_t uartConsoleSerialSpeed;;"BPs", 1, 0, 0,1000000, 0 + int[196] unused; end_struct diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index fe9c4340a1..4ce57a60e4 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -164,7 +164,7 @@ void applyNewConfiguration(void) { } void runRusEfi(void) { - efiAssertVoid(getRemainingStack(chThdSelf()) > 512, "init s"); + efiAssertVoid(getRemainingStack(chThdSelf()) > 512, "init s"); msObjectInit(&firmwareErrorMessageStream, errorMessageBuffer, sizeof(errorMessageBuffer), 0); diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index bdb23a0f68..de53d23d56 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -47,7 +47,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 Tue Dec 08 10:02:06 EST 2015 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Dec 21 19:26:52 EST 2015 pageSize = 16088 page = 1 @@ -520,7 +520,8 @@ page = 1 fatalErrorPin = bits, U32, 2216, [0:6], "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", "NONE", "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", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" warninigPin = bits, U32, 2220, [0:6], "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", "NONE", "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", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" configResetPin = bits, U32, 2224, [0:6], "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", "NONE", "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", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" -;skipping unused offset 2228 + uartConsoleSerialSpeed = scalar, U32, 2228, "BPs", 1, 0, 0,1000000, 0 +;skipping unused offset 2232 le_formulas1 = array, U08, 3016, [200],"char", 1, 0, 0.0, 3.0, 2 le_formulas2 = array, U08, 3216, [200],"char", 1, 0, 0.0, 3.0, 2 le_formulas3 = array, U08, 3416, [200],"char", 1, 0, 0.0, 3.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 08ad035cfe..cfc1c642b2 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 Tue Dec 01 20:29:19 EST 2015 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Dec 21 19:26:52 EST 2015 public class Fields { public static final Field ENGINETYPE = new Field("ENGINETYPE", 0, FieldType.INT); public static final Field HEADERMAGICVALUE = new Field("HEADERMAGICVALUE", 4, FieldType.INT); @@ -457,6 +457,7 @@ public class Fields { public static final Field FATALERRORPIN = new Field("FATALERRORPIN", 2216, FieldType.INT, brain_pin_e); public static final Field WARNINIGPIN = new Field("WARNINIGPIN", 2220, FieldType.INT, brain_pin_e); public static final Field CONFIGRESETPIN = new Field("CONFIGRESETPIN", 2224, FieldType.INT, brain_pin_e); + public static final Field UARTCONSOLESERIALSPEED = new Field("UARTCONSOLESERIALSPEED", 2228, FieldType.INT); public static final Field LE_FORMULAS1 = new Field("LE_FORMULAS1", 3016, FieldType.INT); public static final Field LE_FORMULAS2 = new Field("LE_FORMULAS2", 3216, FieldType.INT); public static final Field LE_FORMULAS3 = new Field("LE_FORMULAS3", 3416, FieldType.INT);