add fuel/spark cut codes to TS indicators (#4592)
* add fuel/spark cut codes to TS indicators * fix list * only set clearReason if not cleared
This commit is contained in:
parent
c1d6a22335
commit
3a57c41c1b
|
@ -10,8 +10,6 @@
|
||||||
struct_no_prefix output_channels_s
|
struct_no_prefix output_channels_s
|
||||||
|
|
||||||
bit sd_present
|
bit sd_present
|
||||||
bit isIgnitionEnabledIndicator;
|
|
||||||
bit isInjectionEnabledIndicator;
|
|
||||||
bit sd_logging_internal
|
bit sd_logging_internal
|
||||||
bit unusedb4;
|
bit unusedb4;
|
||||||
bit unusedb5;
|
bit unusedb5;
|
||||||
|
|
|
@ -657,9 +657,6 @@ static void updateFlags() {
|
||||||
engine->outputChannels.isFanOn = enginePins.fanRelay.getLogicValue();
|
engine->outputChannels.isFanOn = enginePins.fanRelay.getLogicValue();
|
||||||
engine->outputChannels.isFan2On = enginePins.fanRelay2.getLogicValue();
|
engine->outputChannels.isFan2On = enginePins.fanRelay2.getLogicValue();
|
||||||
engine->outputChannels.isO2HeaterOn = enginePins.o2heater.getLogicValue();
|
engine->outputChannels.isO2HeaterOn = enginePins.o2heater.getLogicValue();
|
||||||
// todo: eliminate state copy logic by giving limpManager it's owm limp_manager.txt and leveraging LiveData
|
|
||||||
engine->outputChannels.isIgnitionEnabledIndicator = engine->limpManager.allowIgnition().value;
|
|
||||||
engine->outputChannels.isInjectionEnabledIndicator = engine->limpManager.allowInjection().value;
|
|
||||||
// todo: eliminate state copy logic by giving DfcoController it's owm xxx.txt and leveraging LiveData
|
// todo: eliminate state copy logic by giving DfcoController it's owm xxx.txt and leveraging LiveData
|
||||||
engine->outputChannels.dfcoActive = engine->module<DfcoController>()->cutFuel();
|
engine->outputChannels.dfcoActive = engine->module<DfcoController>()->cutFuel();
|
||||||
|
|
||||||
|
|
|
@ -226,6 +226,8 @@ static void handleFuel(uint32_t trgEventIndex, int rpm, efitick_t nowNt, float c
|
||||||
efiAssertVoid(CUSTOM_ERR_6628, trgEventIndex < getTriggerCentral()->engineCycleEventCount, "handleFuel/event index");
|
efiAssertVoid(CUSTOM_ERR_6628, trgEventIndex < getTriggerCentral()->engineCycleEventCount, "handleFuel/event index");
|
||||||
|
|
||||||
LimpState limitedFuelState = getLimpManager()->allowInjection();
|
LimpState limitedFuelState = getLimpManager()->allowInjection();
|
||||||
|
|
||||||
|
// todo: eliminate state copy logic by giving limpManager it's owm limp_manager.txt and leveraging LiveData
|
||||||
engine->outputChannels.fuelCutReason = (int8_t)limitedFuelState.reason;
|
engine->outputChannels.fuelCutReason = (int8_t)limitedFuelState.reason;
|
||||||
bool limitedFuel = !limitedFuelState.value;
|
bool limitedFuel = !limitedFuelState.value;
|
||||||
if (limitedFuel) {
|
if (limitedFuel) {
|
||||||
|
|
|
@ -434,6 +434,8 @@ void onTriggerEventSparkLogic(uint32_t trgEventIndex, int rpm, efitick_t edgeTim
|
||||||
}
|
}
|
||||||
|
|
||||||
LimpState limitedSparkState = engine->limpManager.allowIgnition();
|
LimpState limitedSparkState = engine->limpManager.allowIgnition();
|
||||||
|
|
||||||
|
// todo: eliminate state copy logic by giving limpManager it's owm limp_manager.txt and leveraging LiveData
|
||||||
engine->outputChannels.sparkCutReason = (int8_t)limitedSparkState.reason;
|
engine->outputChannels.sparkCutReason = (int8_t)limitedSparkState.reason;
|
||||||
bool limitedSpark = !limitedSparkState.value;
|
bool limitedSpark = !limitedSparkState.value;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
// Keep this list in sync with fuelIgnCutCodeList in rusefi.input!
|
||||||
enum class ClearReason : uint8_t {
|
enum class ClearReason : uint8_t {
|
||||||
None, // 0
|
None, // 0
|
||||||
Fatal,
|
Fatal,
|
||||||
|
@ -18,7 +19,9 @@ enum class ClearReason : uint8_t {
|
||||||
InjectorDutyCycle, // 10
|
InjectorDutyCycle, // 10
|
||||||
FloodClear, // 11
|
FloodClear, // 11
|
||||||
EnginePhase, // 12
|
EnginePhase, // 12
|
||||||
KickStart,
|
KickStart, // 13
|
||||||
|
|
||||||
|
// Keep this list in sync with fuelIgnCutCodeList in rusefi.input!
|
||||||
};
|
};
|
||||||
|
|
||||||
// Only allows clearing the value, but never resetting it.
|
// Only allows clearing the value, but never resetting it.
|
||||||
|
@ -32,8 +35,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear(ClearReason clearReason) {
|
void clear(ClearReason clearReason) {
|
||||||
m_value = false;
|
if (m_value) {
|
||||||
this->clearReason = clearReason;
|
m_value = false;
|
||||||
|
this->clearReason = clearReason;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
operator bool() const {
|
operator bool() const {
|
||||||
|
|
|
@ -234,6 +234,8 @@ enable2ndByteCanID = false
|
||||||
|
|
||||||
wboFaultCodeList = bits, U08, [0:3], "OK", "Unk", "Unk", "failed to heat", "overheat", "underheat", "no supply"
|
wboFaultCodeList = bits, U08, [0:3], "OK", "Unk", "Unk", "failed to heat", "overheat", "underheat", "no supply"
|
||||||
|
|
||||||
|
fuelIgnCutCodeList = bits, U08, [0:7], "None", "fatal error", "setting disabled", "RPM limit", "fault RPM limit", "boost cut", "oil pressure", "stop requested", "ETB problem", "launch control", "max injector duty", "flood clear", "engine sync", "kickstart"
|
||||||
|
|
||||||
[ConstantsExtensions]
|
[ConstantsExtensions]
|
||||||
; defaultValue is used to provide TunerStudio with a value to use in the case of
|
; defaultValue is used to provide TunerStudio with a value to use in the case of
|
||||||
; the constant not yet being initialized. This is primarily important if the
|
; the constant not yet being initialized. This is primarily important if the
|
||||||
|
@ -1400,8 +1402,8 @@ gaugeCategory = GPPWM Outputs
|
||||||
indicator = { isWarnNow }, "No warnings", "Warning", white, black, yellow, black
|
indicator = { isWarnNow }, "No warnings", "Warning", white, black, yellow, black
|
||||||
indicator = { checkEngine }, "No Check Engine", "Check Engine", white, black, red, black
|
indicator = { checkEngine }, "No Check Engine", "Check Engine", white, black, red, black
|
||||||
indicator = { isTriggerError}, "Trigger OK", "Trigger ERR", white, black, red, black
|
indicator = { isTriggerError}, "Trigger OK", "Trigger ERR", white, black, red, black
|
||||||
indicator = { isIgnitionEnabledIndicator }, "Ignition cut", "Ignition OK", yellow, black, white, black
|
indicator = { fuelCutReason != 0 }, "Injection OK", { Fuel cut: bitStringValue(fuelIgnCutCodeList, fuelCutReason)}, white, black, yellow, black
|
||||||
indicator = { isInjectionEnabledIndicator }, "Injection cut", "Injection OK", yellow, black, white, black
|
indicator = { sparkCutReason != 0 }, "Ignition OK", { Ign cut: bitStringValue(fuelIgnCutCodeList, sparkCutReason)}, white, black, yellow, black
|
||||||
|
|
||||||
; this is required so that the "config error" feature works in TS
|
; this is required so that the "config error" feature works in TS
|
||||||
; DO NOT CHANGE THIS LINE - TS is looking for an indicator with particular text/styling
|
; DO NOT CHANGE THIS LINE - TS is looking for an indicator with particular text/styling
|
||||||
|
@ -1416,7 +1418,6 @@ gaugeCategory = GPPWM Outputs
|
||||||
indicator = { isFanOn }, "Fan off", "Fan on", white, black, green, black
|
indicator = { isFanOn }, "Fan off", "Fan on", white, black, green, black
|
||||||
indicator = { isFan2On }, "Fan 2 off", "Fan 2 on", white, black, green, black
|
indicator = { isFan2On }, "Fan 2 off", "Fan 2 on", white, black, green, black
|
||||||
indicator = { isMainRelayOn }, "Main relay off", "Main relay on", white, black, green, black
|
indicator = { isMainRelayOn }, "Main relay off", "Main relay on", white, black, green, black
|
||||||
indicator = { fuelCutReason == 11 }, "No cleanup", "Cyl cleanup", white, black, yellow, black
|
|
||||||
; Line 2
|
; Line 2
|
||||||
; = expression, off-label, on-label, off-bg, off-fg, on-bg, on-fg
|
; = expression, off-label, on-label, off-bg, off-fg, on-bg, on-fg
|
||||||
indicator = { isFuelPumpOn }, "Fuel pump off", "Fuel pump on", white, black, green, black
|
indicator = { isFuelPumpOn }, "Fuel pump off", "Fuel pump on", white, black, green, black
|
||||||
|
|
Loading…
Reference in New Issue