indicators for ign/inj faults

This commit is contained in:
Matthew Kennedy 2023-03-21 11:32:55 -07:00
parent f4e3414c0f
commit 081740c1d6
5 changed files with 17 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#define ts_show_sd_pins true
#define ts_show_vbatt false
#define ts_show_clt_iat_pullup false
#define ts_show_inj_fault true
#define show_test_presets false
#define show_Frankenso_presets false

View File

@ -33,6 +33,8 @@ bit isPedalError;
bit launchTriggered;
bit isTps2Error;
bit isIdleClosedLoop;
bit injectorFault;
bit ignitionFault;
uint16_t RPMValue;@@GAUGE_NAME_RPM@@;"RPM",1, 0, 0, 8000, 0

View File

@ -175,6 +175,8 @@ void SensorChecker::onSlowCallback() {
// only bother checking these if we have GPIO chips actually capable of reporting an error
#if BOARD_EXT_GPIOCHIPS > 0 && EFI_PROD_CODE
// Check injectors
bool anyInjectorHasProblem = false;
for (size_t i = 0; i < efi::size(enginePins.injectors); i++) {
InjectorOutputPin& pin = enginePins.injectors[i];
@ -190,10 +192,13 @@ void SensorChecker::onSlowCallback() {
char description[32];
pinDiag2string(description, efi::size(description), diag);
warning(code, "Injector %d fault: %s", i, description);
anyInjectorHasProblem |= true;
}
}
// Check ignition
bool anyIgnHasProblem = false;
for (size_t i = 0; i < efi::size(enginePins.injectors); i++) {
IgnitionOutputPin& pin = enginePins.coils[i];
@ -209,8 +214,13 @@ void SensorChecker::onSlowCallback() {
char description[32];
pinDiag2string(description, efi::size(description), diag);
warning(code, "Ignition %d fault: %s", i, description);
anyIgnHasProblem |= true;
}
}
engine->outputChannels.injectorFault = anyInjectorHasProblem;
engine->outputChannels.ignitionFault = anyIgnHasProblem;
#endif // BOARD_EXT_GPIOCHIPS > 0
}

View File

@ -1916,6 +1916,8 @@ end_struct
#define ts_show_sd_pins true
#define ts_show_injectionPinMode true
#define ts_show_ignitionPinMode true
#define ts_show_inj_fault false
#define ts_show_ign_fault false
! we need to improve this further - at the moment we need too many boards to prepend 'false'
#define show_test_presets true

View File

@ -1538,6 +1538,8 @@ gaugeCategory = GPPWM Outputs
indicator = { sd_logging_internal }, "No SD logging", "SD logging", white, black, green, black
indicator = { sd_msd }, "No SD USB", "SD USB", white, black, green, black
indicator = { etbRevLimitActive }, "No ETB RPM Limit", "ETB RPM Limit", white, black, yellow, black
indicator = { injectorFault }, "Inj HW OK", "Inj HW Fault", white, black, yellow, black @@if_ts_show_inj_fault
indicator = { ignitionFault }, "Ign HW OK", "Ign HW Fault", white, black, yellow, black @@if_ts_show_ign_fault
indicator = { wbo0_hasFault }, { WBO0: bitStringValue(wboFaultCodeList, faultCode)}, { WBO0: bitStringValue(wboFaultCodeList, faultCode)}, white, black, red, black