30#if EFI_MALFUNCTION_INDICATOR
36#define TEST_MIL_CODE FALSE
38#define MFI_LONG_BLINK 1500
39#define MFI_SHORT_BLINK 400
40#define MFI_BLINK_SEPARATOR 400
41#define MFI_CHECKENGINE_LIGHT 10000
44 for (
int iter = 0; iter < digit; iter++) {
47 chThdSleepMilliseconds(duration);
49 chThdSleepMilliseconds(MFI_BLINK_SEPARATOR);
66 for (
int iter = length - 1; iter >= 0; iter--) {
69 while (
code >= ourDigit) {
88#if EFI_SHAFT_POSITION_INPUT
91 chThdSleepMilliseconds(500);
99 for (
int p = 0; p < localErrorCopy.
count; p++) {
111 addError(ObdCode::OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
112 addError(ObdCode::OBD_Intake_Air_Temperature_Circuit_Malfunction);
TriggerCentral triggerCentral
RegisteredOutputPin checkEnginePin
void setValue(const char *msg, int logicValue, bool isForce=false)
Base class for a controller that needs to run periodically to perform work.
virtual void PeriodicTask(efitick_t nowNt)=0
Called periodically. Override this method to do work for your controller.
PrimaryTriggerDecoder triggerState
efitick_t mostRecentSyncTime
void addConsoleAction(const char *token, Void callback)
Register console action without parameters.
static EngineAccessor engine
static constexpr engine_configuration_s * engineConfiguration
UNUSED(samplingTimeSeconds)
void getErrorCodes(error_codes_set_s *copy)
Copies the current set of errors into the specified buffer.
void addError(ObdCode errorCode)
Adds an error code into the set of current errors. The error code is placed into the fixed-size data ...
This data structure holds current malfunction codes.
static MILController instance
static void blink_digits(int digit, int duration)
void initMalfunctionIndicator(void)
static void DisplayErrorCode(int length, int code)
static int DigitLength(int digit)
We can blink out OBD-II error codes using Malfunction Indicator Light (MIL)
bool isBrainPinValid(brain_pin_e brainPin)
output_pin_e malfunctionIndicatorPin
ObdCode error_codes[MAX_ERROR_CODES_COUNT]