From 1c0919e885506582910124c373212f91966d33b6 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Tue, 11 Jan 2022 14:10:30 -0500 Subject: [PATCH] live view is confused by conditional compilation fix #3773 --- firmware/controllers/actuators/idle_state.txt | 2 + .../actuators/idle_state_generated.h | 38 +++++----- .../controllers/actuators/idle_thread.cpp | 18 ++--- .../rusefi/config/generated/IdleState.java | 70 +++++++++---------- 4 files changed, 62 insertions(+), 66 deletions(-) diff --git a/firmware/controllers/actuators/idle_state.txt b/firmware/controllers/actuators/idle_state.txt index c94a90c710..7088b6baaa 100644 --- a/firmware/controllers/actuators/idle_state.txt +++ b/firmware/controllers/actuators/idle_state.txt @@ -23,6 +23,8 @@ bit badTps bit looksLikeRunning bit looksLikeCoasting bit looksLikeCrankToIdle +bit useInstantRpmForIdle +bit isVerboseIAC int targetRpmByClt diff --git a/firmware/controllers/actuators/idle_state_generated.h b/firmware/controllers/actuators/idle_state_generated.h index ec2ef054f0..c6854f944d 100644 --- a/firmware/controllers/actuators/idle_state_generated.h +++ b/firmware/controllers/actuators/idle_state_generated.h @@ -1,4 +1,4 @@ -// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/actuators/idle_state.txt Mon Jan 10 21:12:38 EST 2022 +// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/actuators/idle_state.txt Tue Jan 11 14:08:37 EST 2022 // by class com.rusefi.output.CHeaderConsumer // begin #pragma once @@ -78,55 +78,55 @@ struct idle_state_s { bool looksLikeCrankToIdle : 1 {}; /** offset 16 bit 15 */ - bool unusedBit_19_15 : 1 {}; + bool useInstantRpmForIdle : 1 {}; /** offset 16 bit 16 */ - bool unusedBit_19_16 : 1 {}; + bool isVerboseIAC : 1 {}; /** offset 16 bit 17 */ - bool unusedBit_19_17 : 1 {}; + bool unusedBit_21_17 : 1 {}; /** offset 16 bit 18 */ - bool unusedBit_19_18 : 1 {}; + bool unusedBit_21_18 : 1 {}; /** offset 16 bit 19 */ - bool unusedBit_19_19 : 1 {}; + bool unusedBit_21_19 : 1 {}; /** offset 16 bit 20 */ - bool unusedBit_19_20 : 1 {}; + bool unusedBit_21_20 : 1 {}; /** offset 16 bit 21 */ - bool unusedBit_19_21 : 1 {}; + bool unusedBit_21_21 : 1 {}; /** offset 16 bit 22 */ - bool unusedBit_19_22 : 1 {}; + bool unusedBit_21_22 : 1 {}; /** offset 16 bit 23 */ - bool unusedBit_19_23 : 1 {}; + bool unusedBit_21_23 : 1 {}; /** offset 16 bit 24 */ - bool unusedBit_19_24 : 1 {}; + bool unusedBit_21_24 : 1 {}; /** offset 16 bit 25 */ - bool unusedBit_19_25 : 1 {}; + bool unusedBit_21_25 : 1 {}; /** offset 16 bit 26 */ - bool unusedBit_19_26 : 1 {}; + bool unusedBit_21_26 : 1 {}; /** offset 16 bit 27 */ - bool unusedBit_19_27 : 1 {}; + bool unusedBit_21_27 : 1 {}; /** offset 16 bit 28 */ - bool unusedBit_19_28 : 1 {}; + bool unusedBit_21_28 : 1 {}; /** offset 16 bit 29 */ - bool unusedBit_19_29 : 1 {}; + bool unusedBit_21_29 : 1 {}; /** offset 16 bit 30 */ - bool unusedBit_19_30 : 1 {}; + bool unusedBit_21_30 : 1 {}; /** offset 16 bit 31 */ - bool unusedBit_19_31 : 1 {}; + bool unusedBit_21_31 : 1 {}; /** * offset 20 */ @@ -139,4 +139,4 @@ struct idle_state_s { }; // end -// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/actuators/idle_state.txt Mon Jan 10 21:12:38 EST 2022 +// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/actuators/idle_state.txt Tue Jan 11 14:08:37 EST 2022 diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 9e91da8154..8f2d40b4ad 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -269,28 +269,21 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos, } float IdleController::getIdlePosition() { - // Simplify hardware CI: we borrow the idle valve controller as a PWM source for various stimulation tasks - // The logic in this function is solidly unit tested, so it's not necessary to re-test the particulars on real hardware. - #ifdef HARDWARE_CI - return engineConfiguration->manIdlePosition; - #endif - /* * Here we have idle logic thread - actual stepper movement is implemented in a separate - * working thread, - * @see stepper.cpp + * working thread see stepper.cpp */ - getIdlePid()->iTermMin = engineConfiguration->idlerpmpid_iTermMin; getIdlePid()->iTermMax = engineConfiguration->idlerpmpid_iTermMax; - // On failed sensor, use 0 deg C - should give a safe highish idle float clt = Sensor::getOrZero(SensorType::Clt); auto tps = Sensor::get(SensorType::DriverThrottleIntent); + // this variable is here to make Live View happier + useInstantRpmForIdle = engineConfiguration->useInstantRpmForIdle; float rpm; - if (engineConfiguration->useInstantRpmForIdle) { + if (useInstantRpmForIdle) { rpm = engine->triggerCentral.triggerState.getInstantRpm(); } else { rpm = GET_RPM(); @@ -310,7 +303,8 @@ float IdleController::getIdlePosition() { bool isAutomaticIdle = tps.Valid && engineConfiguration->idleMode == IM_AUTO; - if (engineConfiguration->isVerboseIAC && isAutomaticIdle) { + isVerboseIAC = engineConfiguration->isVerboseIAC && isAutomaticIdle; + if (isVerboseIAC) { efiPrintf("Idle state %s", getIdle_state_e(idleState)); getIdlePid()->showPidStatus("idle"); } diff --git a/java_console/models/src/main/java/com/rusefi/config/generated/IdleState.java b/java_console/models/src/main/java/com/rusefi/config/generated/IdleState.java index 35858b244c..66ee1bcadb 100644 --- a/java_console/models/src/main/java/com/rusefi/config/generated/IdleState.java +++ b/java_console/models/src/main/java/com/rusefi/config/generated/IdleState.java @@ -1,6 +1,6 @@ package com.rusefi.config.generated; -// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/actuators/idle_state.txt Mon Jan 10 21:12:38 EST 2022 +// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/actuators/idle_state.txt Tue Jan 11 14:08:37 EST 2022 // by class com.rusefi.output.FileJavaFieldsConsumer import com.rusefi.config.*; @@ -25,23 +25,23 @@ public class IdleState { public static final Field LOOKSLIKERUNNING = Field.create("LOOKSLIKERUNNING", 16, FieldType.BIT, 12); public static final Field LOOKSLIKECOASTING = Field.create("LOOKSLIKECOASTING", 16, FieldType.BIT, 13); public static final Field LOOKSLIKECRANKTOIDLE = Field.create("LOOKSLIKECRANKTOIDLE", 16, FieldType.BIT, 14); - public static final Field UNUSEDBIT_19_15 = Field.create("UNUSEDBIT_19_15", 16, FieldType.BIT, 15); - public static final Field UNUSEDBIT_19_16 = Field.create("UNUSEDBIT_19_16", 16, FieldType.BIT, 16); - public static final Field UNUSEDBIT_19_17 = Field.create("UNUSEDBIT_19_17", 16, FieldType.BIT, 17); - public static final Field UNUSEDBIT_19_18 = Field.create("UNUSEDBIT_19_18", 16, FieldType.BIT, 18); - public static final Field UNUSEDBIT_19_19 = Field.create("UNUSEDBIT_19_19", 16, FieldType.BIT, 19); - public static final Field UNUSEDBIT_19_20 = Field.create("UNUSEDBIT_19_20", 16, FieldType.BIT, 20); - public static final Field UNUSEDBIT_19_21 = Field.create("UNUSEDBIT_19_21", 16, FieldType.BIT, 21); - public static final Field UNUSEDBIT_19_22 = Field.create("UNUSEDBIT_19_22", 16, FieldType.BIT, 22); - public static final Field UNUSEDBIT_19_23 = Field.create("UNUSEDBIT_19_23", 16, FieldType.BIT, 23); - public static final Field UNUSEDBIT_19_24 = Field.create("UNUSEDBIT_19_24", 16, FieldType.BIT, 24); - public static final Field UNUSEDBIT_19_25 = Field.create("UNUSEDBIT_19_25", 16, FieldType.BIT, 25); - public static final Field UNUSEDBIT_19_26 = Field.create("UNUSEDBIT_19_26", 16, FieldType.BIT, 26); - public static final Field UNUSEDBIT_19_27 = Field.create("UNUSEDBIT_19_27", 16, FieldType.BIT, 27); - public static final Field UNUSEDBIT_19_28 = Field.create("UNUSEDBIT_19_28", 16, FieldType.BIT, 28); - public static final Field UNUSEDBIT_19_29 = Field.create("UNUSEDBIT_19_29", 16, FieldType.BIT, 29); - public static final Field UNUSEDBIT_19_30 = Field.create("UNUSEDBIT_19_30", 16, FieldType.BIT, 30); - public static final Field UNUSEDBIT_19_31 = Field.create("UNUSEDBIT_19_31", 16, FieldType.BIT, 31); + public static final Field USEINSTANTRPMFORIDLE = Field.create("USEINSTANTRPMFORIDLE", 16, FieldType.BIT, 15); + public static final Field ISVERBOSEIAC = Field.create("ISVERBOSEIAC", 16, FieldType.BIT, 16); + public static final Field UNUSEDBIT_21_17 = Field.create("UNUSEDBIT_21_17", 16, FieldType.BIT, 17); + public static final Field UNUSEDBIT_21_18 = Field.create("UNUSEDBIT_21_18", 16, FieldType.BIT, 18); + public static final Field UNUSEDBIT_21_19 = Field.create("UNUSEDBIT_21_19", 16, FieldType.BIT, 19); + public static final Field UNUSEDBIT_21_20 = Field.create("UNUSEDBIT_21_20", 16, FieldType.BIT, 20); + public static final Field UNUSEDBIT_21_21 = Field.create("UNUSEDBIT_21_21", 16, FieldType.BIT, 21); + public static final Field UNUSEDBIT_21_22 = Field.create("UNUSEDBIT_21_22", 16, FieldType.BIT, 22); + public static final Field UNUSEDBIT_21_23 = Field.create("UNUSEDBIT_21_23", 16, FieldType.BIT, 23); + public static final Field UNUSEDBIT_21_24 = Field.create("UNUSEDBIT_21_24", 16, FieldType.BIT, 24); + public static final Field UNUSEDBIT_21_25 = Field.create("UNUSEDBIT_21_25", 16, FieldType.BIT, 25); + public static final Field UNUSEDBIT_21_26 = Field.create("UNUSEDBIT_21_26", 16, FieldType.BIT, 26); + public static final Field UNUSEDBIT_21_27 = Field.create("UNUSEDBIT_21_27", 16, FieldType.BIT, 27); + public static final Field UNUSEDBIT_21_28 = Field.create("UNUSEDBIT_21_28", 16, FieldType.BIT, 28); + public static final Field UNUSEDBIT_21_29 = Field.create("UNUSEDBIT_21_29", 16, FieldType.BIT, 29); + public static final Field UNUSEDBIT_21_30 = Field.create("UNUSEDBIT_21_30", 16, FieldType.BIT, 30); + public static final Field UNUSEDBIT_21_31 = Field.create("UNUSEDBIT_21_31", 16, FieldType.BIT, 31); public static final Field TARGETRPMBYCLT = Field.create("TARGETRPMBYCLT", 20, FieldType.INT); public static final Field TARGETRPMACBUMP = Field.create("TARGETRPMACBUMP", 24, FieldType.INT); public static final Field[] VALUES = { @@ -64,23 +64,23 @@ public class IdleState { LOOKSLIKERUNNING, LOOKSLIKECOASTING, LOOKSLIKECRANKTOIDLE, - UNUSEDBIT_19_15, - UNUSEDBIT_19_16, - UNUSEDBIT_19_17, - UNUSEDBIT_19_18, - UNUSEDBIT_19_19, - UNUSEDBIT_19_20, - UNUSEDBIT_19_21, - UNUSEDBIT_19_22, - UNUSEDBIT_19_23, - UNUSEDBIT_19_24, - UNUSEDBIT_19_25, - UNUSEDBIT_19_26, - UNUSEDBIT_19_27, - UNUSEDBIT_19_28, - UNUSEDBIT_19_29, - UNUSEDBIT_19_30, - UNUSEDBIT_19_31, + USEINSTANTRPMFORIDLE, + ISVERBOSEIAC, + UNUSEDBIT_21_17, + UNUSEDBIT_21_18, + UNUSEDBIT_21_19, + UNUSEDBIT_21_20, + UNUSEDBIT_21_21, + UNUSEDBIT_21_22, + UNUSEDBIT_21_23, + UNUSEDBIT_21_24, + UNUSEDBIT_21_25, + UNUSEDBIT_21_26, + UNUSEDBIT_21_27, + UNUSEDBIT_21_28, + UNUSEDBIT_21_29, + UNUSEDBIT_21_30, + UNUSEDBIT_21_31, TARGETRPMBYCLT, TARGETRPMACBUMP, };