Skip to content

Commit

Permalink
turn on the CEL when the engine is stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Jan 8, 2025
1 parent 8f29a48 commit 2268520
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
1 change: 1 addition & 0 deletions firmware/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ or
### Added
- Support Miata NA CAS "CMP" signal as a cam input (if you've installed a 36-1 crank trigger on an NA, for example) #495
- Support 4 independent wideband O2 channels, and 4 fuel trim banks
- Flash error codes for some sensors using the check engine light #526

### Fixed
- Idle VE table's indicator dot properly tracks when using an idle VE Y-axis override
Expand Down
19 changes: 9 additions & 10 deletions firmware/controllers/gauges/malfunction_indicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,19 @@ class MILController : public PeriodicController<UTILITY_THREAD_STACK_SIZE> {

validateStack("MIL", ObdCode::STACK_USAGE_MIL, 128);
#if EFI_SHAFT_POSITION_INPUT
if (nowNt - engine->triggerCentral.triggerState.mostRecentSyncTime < MS2NT(500)) {
enginePins.checkEnginePin.setValue(1);
chThdSleepMilliseconds(500);
enginePins.checkEnginePin.setValue(0);
}

static error_codes_set_s localErrorCopy;
// todo: why do I not see this on a real vehicle? is this whole blinking logic not used?
getErrorCodes(&localErrorCopy);

for (int p = 0; p < localErrorCopy.count; p++) {
// Calculate how many digits in this integer and display error code from start to end
int code = (int)localErrorCopy.error_codes[p];
DisplayErrorCode(DigitLength(code), code);
if (localErrorCopy.count) {
for (int p = 0; p < localErrorCopy.count; p++) {
// Calculate how many digits in this integer and display error code from start to end
int code = (int)localErrorCopy.error_codes[p];
DisplayErrorCode(DigitLength(code), code);
}
} else {
// Turn on the CEL while the engine is stopped
enginePins.checkEnginePin.setValue(!engine->rpmCalculator.isRunning());
}
#endif // EFI_SHAFT_POSITION_INPUT
}
Expand Down
9 changes: 0 additions & 9 deletions firmware/controllers/trigger/trigger_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ bool TriggerDecoderBase::getShaftSynchronized() {
}

void TriggerDecoderBase::setShaftSynchronized(bool value) {
if (value) {
if (!shaft_is_synchronized) {
// just got synchronized
mostRecentSyncTime = getTimeNowNt();
}
} else {
// sync loss
mostRecentSyncTime = {};
}
shaft_is_synchronized = value;
}

Expand Down
1 change: 0 additions & 1 deletion firmware/controllers/trigger/trigger_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ class TriggerDecoderBase : public trigger_state_s {
* TRUE if we know where we are
*/
bool shaft_is_synchronized;
efitick_t mostRecentSyncTime;

Timer previousEventTimer;

Expand Down

0 comments on commit 2268520

Please sign in to comment.