From 840edd414913b73485cc7e86e60aa2738e7a78c5 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sun, 12 Feb 2017 02:02:24 -0500 Subject: [PATCH] auto-sync --- .../controllers/algo/engine_configuration.cpp | 3 +++ .../engine_configuration_generated_structures.h | 16 +++++++++++++--- firmware/controllers/algo/rusefi_generated.h | 4 +++- firmware/controllers/idle_thread.cpp | 6 ++++++ firmware/hw_layer/stepper.cpp | 7 ++++++- firmware/integration/rusefi_config.txt | 4 +++- firmware/tunerstudio/rusefi.ini | 8 ++++++-- firmware/tunerstudio/rusefi.input | 6 ++++-- .../models/src/com/rusefi/config/Fields.java | 8 ++++++-- 9 files changed, 50 insertions(+), 12 deletions(-) diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index b572e56037..d5e2a270ec 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -254,6 +254,9 @@ void prepareVoidConfiguration(engine_configuration_s *activeConfiguration) { boardConfiguration->joystickCPin = GPIO_UNASSIGNED; boardConfiguration->joystickDPin = GPIO_UNASSIGNED; + engineConfiguration->cj125ua = EFI_ADC_NONE; + engineConfiguration->cj125ur = EFI_ADC_NONE; + boardConfiguration->idle.stepperDirectionPin = GPIO_UNASSIGNED; boardConfiguration->idle.stepperStepPin = GPIO_UNASSIGNED; engineConfiguration->stepperEnablePin = GPIO_UNASSIGNED; diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 2912a363c5..1528107971 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 Sun Feb 05 22:20:28 EST 2017 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Feb 12 01:30:52 EST 2017 // begin #ifndef ENGINE_CONFIGURATION_GENERATED_H_ #define ENGINE_CONFIGURATION_GENERATED_H_ @@ -1822,9 +1822,19 @@ typedef struct { */ pin_mode_e stepperEnablePinMode; /** + * lampda input * offset 2768 */ - int unused[70]; + adc_channel_e cj125ua; + /** + * heater input + * offset 2772 + */ + adc_channel_e cj125ur; + /** + * offset 2776 + */ + int unused[68]; /** total size 3048*/ } engine_configuration_s; @@ -2039,4 +2049,4 @@ typedef struct { #endif // end -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Feb 05 22:20:28 EST 2017 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Feb 12 01:30:52 EST 2017 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 1630f2f79d..3b22f2c8d8 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -930,7 +930,9 @@ #define fuelClosedLoopAfrLowThreshold_offset 2756 #define fuelClosedLoopAfrHighThreshold_offset 2760 #define stepperEnablePinMode_offset 2764 -#define unused_offset 2768 +#define cj125ua_offset 2768 +#define cj125ur_offset 2772 +#define unused_offset 2776 #define le_formulas1_offset 3048 #define le_formulas2_offset 3248 #define le_formulas3_offset 3448 diff --git a/firmware/controllers/idle_thread.cpp b/firmware/controllers/idle_thread.cpp index 05ba54c1d1..50ca4be1ff 100644 --- a/firmware/controllers/idle_thread.cpp +++ b/firmware/controllers/idle_thread.cpp @@ -197,6 +197,12 @@ static msg_t ivThread(int param) { (void) param; chRegSetThreadName("IdleValve"); + /* + * Here we have idle logic thread - actual stepper movement is implemented in a separate + * working thread, + * @see stepper.cpp + */ + while (true) { chThdSleepMilliseconds(boardConfiguration->idleThreadPeriod); diff --git a/firmware/hw_layer/stepper.cpp b/firmware/hw_layer/stepper.cpp index b2857a4afe..19f3984784 100644 --- a/firmware/hw_layer/stepper.cpp +++ b/firmware/hw_layer/stepper.cpp @@ -17,7 +17,12 @@ static msg_t stThread(StepperMotor *motor) { palWritePad(motor->directionPort, motor->directionPin, false); - // let's park the motor in a known position to begin with + /** + * let's park the motor in a known position to begin with + * + * I believe it's safer to retract the valve for parking - at least on a bench I've seen valves + * disassembling themselves while pushing too far out. + */ for (int i = 0; i < motor->totalSteps; i++) { motor->pulse(); } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 4a26a22061..57fef31dbe 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -778,7 +778,9 @@ int16_t etbFreq;;"Hz", 1, 0, 0, 500, 10 float fuelClosedLoopAfrLowThreshold;;"ratio", 1, 0, 0, 100, 1 float fuelClosedLoopAfrHighThreshold;;"ratio", 1, 0, 0, 100, 1 pin_mode_e stepperEnablePinMode; - int[70] unused; + adc_channel_e cj125ua;lampda input + adc_channel_e cj125ur;heater input + int[68] unused; end_struct diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index db40ecf245..16504e6b0f 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 Feb 09 21:42:21 EST 2017 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Feb 12 01:30:52 EST 2017 pageSize = 16376 page = 1 @@ -655,7 +655,9 @@ page = 1 fuelClosedLoopAfrLowThreshold = scalar, F32, 2756, "ratio", 1, 0, 0, 100, 1 fuelClosedLoopAfrHighThreshold = scalar, F32, 2760, "ratio", 1, 0, 0, 100, 1 stepperEnablePinMode = bits, U32, 2764, [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" -;skipping unused offset 2768 + cj125ua = bits, U32, 2768, [0:4] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "Disabled", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" + cj125ur = bits, U32, 2772, [0:4] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "Disabled", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" +;skipping unused offset 2776 le_formulas1 = array, U08, 3048, [200],"char", 1, 0, 0.0, 3.0, 2 le_formulas2 = array, U08, 3248, [200],"char", 1, 0, 0.0, 3.0, 2 le_formulas3 = array, U08, 3448, [200],"char", 1, 0, 0.0, 3.0, 2 @@ -1940,6 +1942,8 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01" field = "ChipSelect pin", cj125CsPin field = "ChipSelect mode", cj125CsPinMode field = "SPI device", cj125SpiDevice + field = "UA input", cj125ua + field = "UR input", cj125ur dialog = spiFunction, "SPI settings" field = "!ECU reboot needed to apply these settings" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 4654d276c1..1e6c1a4d09 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1871,9 +1871,11 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01" dialog = cj125Function, "CJ125 Settings (wbo decoder)" field = "Enabled", isCJ125Enabled field = "!ECU reboot needed to apply these settings" - field = "ChipSelect pin", cj125CsPin - field = "ChipSelect mode", cj125CsPinMode + field = "ChipSelect pin", cj125CsPin, {isCJ125Enabled == 1} + field = "ChipSelect mode", cj125CsPinMode, {isCJ125Enabled == 1} field = "SPI device", cj125SpiDevice + field = "UA input", cj125ua, {isCJ125Enabled == 1} + field = "UR input", cj125ur, {isCJ125Enabled == 1} dialog = spiFunction, "SPI settings" field = "!ECU reboot needed to apply these settings" diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index be90992414..f02d4b202a 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 Feb 09 21:42:21 EST 2017 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Feb 12 01:30:52 EST 2017 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int FSIO_ADC_COUNT = 4; @@ -934,7 +934,9 @@ public class Fields { public static final int fuelClosedLoopAfrLowThreshold_offset = 2756; public static final int fuelClosedLoopAfrHighThreshold_offset = 2760; public static final int stepperEnablePinMode_offset = 2764; - public static final int unused_offset = 2768; + public static final int cj125ua_offset = 2768; + public static final int cj125ur_offset = 2772; + public static final int unused_offset = 2776; public static final int le_formulas1_offset = 3048; public static final int le_formulas2_offset = 3248; public static final int le_formulas3_offset = 3448; @@ -1606,6 +1608,8 @@ public class Fields { public static final Field FUELCLOSEDLOOPAFRLOWTHRESHOLD = Field.create("FUELCLOSEDLOOPAFRLOWTHRESHOLD", 2756, FieldType.FLOAT); public static final Field FUELCLOSEDLOOPAFRHIGHTHRESHOLD = Field.create("FUELCLOSEDLOOPAFRHIGHTHRESHOLD", 2760, FieldType.FLOAT); public static final Field STEPPERENABLEPINMODE = Field.create("STEPPERENABLEPINMODE", 2764, FieldType.INT, pin_mode_e); + public static final Field CJ125UA = Field.create("CJ125UA", 2768, FieldType.INT, adc_channel_e); + public static final Field CJ125UR = Field.create("CJ125UR", 2772, FieldType.INT, adc_channel_e); public static final Field LE_FORMULAS1 = Field.create("LE_FORMULAS1", 3048, FieldType.INT); public static final Field LE_FORMULAS2 = Field.create("LE_FORMULAS2", 3248, FieldType.INT); public static final Field LE_FORMULAS3 = Field.create("LE_FORMULAS3", 3448, FieldType.INT);