live view is confused by conditional compilation fix #3773

This commit is contained in:
rusefillc 2022-01-11 14:10:30 -05:00
parent 87ff0b318d
commit 1c0919e885
4 changed files with 62 additions and 66 deletions

View File

@ -23,6 +23,8 @@ bit badTps
bit looksLikeRunning bit looksLikeRunning
bit looksLikeCoasting bit looksLikeCoasting
bit looksLikeCrankToIdle bit looksLikeCrankToIdle
bit useInstantRpmForIdle
bit isVerboseIAC
int targetRpmByClt int targetRpmByClt

View File

@ -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 // by class com.rusefi.output.CHeaderConsumer
// begin // begin
#pragma once #pragma once
@ -78,55 +78,55 @@ struct idle_state_s {
bool looksLikeCrankToIdle : 1 {}; bool looksLikeCrankToIdle : 1 {};
/** /**
offset 16 bit 15 */ offset 16 bit 15 */
bool unusedBit_19_15 : 1 {}; bool useInstantRpmForIdle : 1 {};
/** /**
offset 16 bit 16 */ offset 16 bit 16 */
bool unusedBit_19_16 : 1 {}; bool isVerboseIAC : 1 {};
/** /**
offset 16 bit 17 */ offset 16 bit 17 */
bool unusedBit_19_17 : 1 {}; bool unusedBit_21_17 : 1 {};
/** /**
offset 16 bit 18 */ offset 16 bit 18 */
bool unusedBit_19_18 : 1 {}; bool unusedBit_21_18 : 1 {};
/** /**
offset 16 bit 19 */ offset 16 bit 19 */
bool unusedBit_19_19 : 1 {}; bool unusedBit_21_19 : 1 {};
/** /**
offset 16 bit 20 */ offset 16 bit 20 */
bool unusedBit_19_20 : 1 {}; bool unusedBit_21_20 : 1 {};
/** /**
offset 16 bit 21 */ offset 16 bit 21 */
bool unusedBit_19_21 : 1 {}; bool unusedBit_21_21 : 1 {};
/** /**
offset 16 bit 22 */ offset 16 bit 22 */
bool unusedBit_19_22 : 1 {}; bool unusedBit_21_22 : 1 {};
/** /**
offset 16 bit 23 */ offset 16 bit 23 */
bool unusedBit_19_23 : 1 {}; bool unusedBit_21_23 : 1 {};
/** /**
offset 16 bit 24 */ offset 16 bit 24 */
bool unusedBit_19_24 : 1 {}; bool unusedBit_21_24 : 1 {};
/** /**
offset 16 bit 25 */ offset 16 bit 25 */
bool unusedBit_19_25 : 1 {}; bool unusedBit_21_25 : 1 {};
/** /**
offset 16 bit 26 */ offset 16 bit 26 */
bool unusedBit_19_26 : 1 {}; bool unusedBit_21_26 : 1 {};
/** /**
offset 16 bit 27 */ offset 16 bit 27 */
bool unusedBit_19_27 : 1 {}; bool unusedBit_21_27 : 1 {};
/** /**
offset 16 bit 28 */ offset 16 bit 28 */
bool unusedBit_19_28 : 1 {}; bool unusedBit_21_28 : 1 {};
/** /**
offset 16 bit 29 */ offset 16 bit 29 */
bool unusedBit_19_29 : 1 {}; bool unusedBit_21_29 : 1 {};
/** /**
offset 16 bit 30 */ offset 16 bit 30 */
bool unusedBit_19_30 : 1 {}; bool unusedBit_21_30 : 1 {};
/** /**
offset 16 bit 31 */ offset 16 bit 31 */
bool unusedBit_19_31 : 1 {}; bool unusedBit_21_31 : 1 {};
/** /**
* offset 20 * offset 20
*/ */
@ -139,4 +139,4 @@ struct idle_state_s {
}; };
// end // 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

View File

@ -269,28 +269,21 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos,
} }
float IdleController::getIdlePosition() { 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 * Here we have idle logic thread - actual stepper movement is implemented in a separate
* working thread, * working thread see stepper.cpp
* @see stepper.cpp
*/ */
getIdlePid()->iTermMin = engineConfiguration->idlerpmpid_iTermMin; getIdlePid()->iTermMin = engineConfiguration->idlerpmpid_iTermMin;
getIdlePid()->iTermMax = engineConfiguration->idlerpmpid_iTermMax; getIdlePid()->iTermMax = engineConfiguration->idlerpmpid_iTermMax;
// On failed sensor, use 0 deg C - should give a safe highish idle // On failed sensor, use 0 deg C - should give a safe highish idle
float clt = Sensor::getOrZero(SensorType::Clt); float clt = Sensor::getOrZero(SensorType::Clt);
auto tps = Sensor::get(SensorType::DriverThrottleIntent); auto tps = Sensor::get(SensorType::DriverThrottleIntent);
// this variable is here to make Live View happier
useInstantRpmForIdle = engineConfiguration->useInstantRpmForIdle;
float rpm; float rpm;
if (engineConfiguration->useInstantRpmForIdle) { if (useInstantRpmForIdle) {
rpm = engine->triggerCentral.triggerState.getInstantRpm(); rpm = engine->triggerCentral.triggerState.getInstantRpm();
} else { } else {
rpm = GET_RPM(); rpm = GET_RPM();
@ -310,7 +303,8 @@ float IdleController::getIdlePosition() {
bool isAutomaticIdle = tps.Valid && engineConfiguration->idleMode == IM_AUTO; 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)); efiPrintf("Idle state %s", getIdle_state_e(idleState));
getIdlePid()->showPidStatus("idle"); getIdlePid()->showPidStatus("idle");
} }

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated; 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 // by class com.rusefi.output.FileJavaFieldsConsumer
import com.rusefi.config.*; 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 LOOKSLIKERUNNING = Field.create("LOOKSLIKERUNNING", 16, FieldType.BIT, 12);
public static final Field LOOKSLIKECOASTING = Field.create("LOOKSLIKECOASTING", 16, FieldType.BIT, 13); 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 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 USEINSTANTRPMFORIDLE = Field.create("USEINSTANTRPMFORIDLE", 16, FieldType.BIT, 15);
public static final Field UNUSEDBIT_19_16 = Field.create("UNUSEDBIT_19_16", 16, FieldType.BIT, 16); public static final Field ISVERBOSEIAC = Field.create("ISVERBOSEIAC", 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_21_17 = Field.create("UNUSEDBIT_21_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_21_18 = Field.create("UNUSEDBIT_21_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_21_19 = Field.create("UNUSEDBIT_21_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_21_20 = Field.create("UNUSEDBIT_21_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_21_21 = Field.create("UNUSEDBIT_21_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_21_22 = Field.create("UNUSEDBIT_21_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_21_23 = Field.create("UNUSEDBIT_21_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_21_24 = Field.create("UNUSEDBIT_21_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_21_25 = Field.create("UNUSEDBIT_21_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_21_26 = Field.create("UNUSEDBIT_21_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_21_27 = Field.create("UNUSEDBIT_21_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_21_28 = Field.create("UNUSEDBIT_21_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_21_29 = Field.create("UNUSEDBIT_21_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_21_30 = Field.create("UNUSEDBIT_21_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 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 TARGETRPMBYCLT = Field.create("TARGETRPMBYCLT", 20, FieldType.INT);
public static final Field TARGETRPMACBUMP = Field.create("TARGETRPMACBUMP", 24, FieldType.INT); public static final Field TARGETRPMACBUMP = Field.create("TARGETRPMACBUMP", 24, FieldType.INT);
public static final Field[] VALUES = { public static final Field[] VALUES = {
@ -64,23 +64,23 @@ public class IdleState {
LOOKSLIKERUNNING, LOOKSLIKERUNNING,
LOOKSLIKECOASTING, LOOKSLIKECOASTING,
LOOKSLIKECRANKTOIDLE, LOOKSLIKECRANKTOIDLE,
UNUSEDBIT_19_15, USEINSTANTRPMFORIDLE,
UNUSEDBIT_19_16, ISVERBOSEIAC,
UNUSEDBIT_19_17, UNUSEDBIT_21_17,
UNUSEDBIT_19_18, UNUSEDBIT_21_18,
UNUSEDBIT_19_19, UNUSEDBIT_21_19,
UNUSEDBIT_19_20, UNUSEDBIT_21_20,
UNUSEDBIT_19_21, UNUSEDBIT_21_21,
UNUSEDBIT_19_22, UNUSEDBIT_21_22,
UNUSEDBIT_19_23, UNUSEDBIT_21_23,
UNUSEDBIT_19_24, UNUSEDBIT_21_24,
UNUSEDBIT_19_25, UNUSEDBIT_21_25,
UNUSEDBIT_19_26, UNUSEDBIT_21_26,
UNUSEDBIT_19_27, UNUSEDBIT_21_27,
UNUSEDBIT_19_28, UNUSEDBIT_21_28,
UNUSEDBIT_19_29, UNUSEDBIT_21_29,
UNUSEDBIT_19_30, UNUSEDBIT_21_30,
UNUSEDBIT_19_31, UNUSEDBIT_21_31,
TARGETRPMBYCLT, TARGETRPMBYCLT,
TARGETRPMACBUMP, TARGETRPMACBUMP,
}; };