rusEFI
The most advanced open source ECU
|
Definition in file error_handling.cpp.
Functions | |
const char * | getCriticalErrorMessage (void) |
void | checkLastBootError () |
void | logHardFault (uint32_t type, uintptr_t faultAddress, port_extctx *ctx, uint32_t csfr) |
void | chDbgPanic3 (const char *msg, const char *file, int line) |
bool | warning (ObdCode code, const char *fmt,...) |
const char * | getWarningMessage (void) |
void | onLockHook (void) |
void | onUnlockHook (void) |
void | firmwareError (ObdCode code, const char *fmt,...) |
Variables | |
static critical_msg_t | warningBuffer |
static critical_msg_t | criticalErrorMessageBuffer |
int | warningEnabled |
bool | hasFirmwareErrorFlag = false |
const char * | dbg_panic_file |
int | dbg_panic_line |
WarningCodeState | unitTestWarningCodeState |
uint32_t | lastLockTime |
uint32_t | maxLockedDuration = 0 |
void chDbgPanic3 | ( | const char * | msg, |
const char * | file, | ||
int | line | ||
) |
Definition at line 105 of file error_handling.cpp.
void checkLastBootError | ( | ) |
Definition at line 30 of file error_handling.cpp.
Referenced by runRusEfi().
void firmwareError | ( | ObdCode | code, |
const char * | fmt, | ||
... | |||
) |
Something really bad had happened - firmware cannot function, we cannot run the engine We definitely use this critical error approach in case of invalid configuration. If user sets a self-contradicting configuration we have to just put a hard stop on this.
see also warning()
in case of simple error message let's reduce stack usage chvsnprintf could cause an overflow if we're already low
Definition at line 265 of file error_handling.cpp.
Referenced by TriggerWaveform::addEvent(), assertTimeIsLinear(), TriggerWaveform::calculateExpectedEventCounts(), calculateTriggerSynchPoint(), checkLastResetCause(), MultiChannelStateSequence::checkSwitchTimes(), AemXSeriesWideband::decodeRusefiStandard(), TriggerDecoderBase::decodeTriggerEvent(), doInitElectronicThrottle(), efiExtiEnablePin(), ensureArrayIsAscending(), SingleTimerExecutor::executeAllPendingActions(), fatalErrorForPresetApply(), findIndexMsg(), TriggerStimulatorHelper::findTriggerSyncPoint(), getAdcChannelBrainPin(), getAirmassModel(), getFiringOrderCylinderId(), getFiringOrderLength(), getFiringOrderTable(), getHwPin(), getIgnitionPinForIndex(), getInjectionModeDurationMultiplier(), getMapCfg(), getNumberOfInjections(), getNumberOfSparks(), getPortIndex(), getSpiDevice(), gpio_pin_markUsed(), PwmConfig::handleCycleStart(), TriggerCentral::handleShaftSignal(), EtbController::init(), initAuxValves(), initEgoSensor(), initHistogram(), initializeSkippedToothTrigger(), OutputPin::initPin(), look_up_rpm_can_id(), look_up_vss_can_id(), myerror(), onCliCaseError(), onCliDuplicateError(), onCliOverflowError(), FLStack< T, MAXSIZE >::pop(), portSetHardwareSchedulerTimer(), FLStack< T, MAXSIZE >::push(), recalculateAuxValveTiming(), EventQueue::remove(), resetConfigurationExt(), runBench(), SingleTimerExecutor::scheduleByTimestampNt(), setHardwareSchedulerTimer(), GppwmChannel::setOutput(), startCanPins(), swapOutputBuffers(), tachUpdate(), timerCallback(), timerValidationCallback(), turnOnTriggerInputPin(), InjectionEvent::update(), validateHardwareTimer(), validateThermistorConfig(), and wrapAngle().
const char* getCriticalErrorMessage | ( | void | ) |
Definition at line 25 of file error_handling.cpp.
Referenced by TunerStudio::handleCrcCommand(), handleTestCommand(), and updateDevConsoleState().
const char* getWarningMessage | ( | void | ) |
Definition at line 211 of file error_handling.cpp.
void logHardFault | ( | uint32_t | type, |
uintptr_t | faultAddress, | ||
port_extctx * | ctx, | ||
uint32_t | csfr | ||
) |
Definition at line 88 of file error_handling.cpp.
Referenced by HardFault_Handler_C(), MemManage_Handler_C(), and UsageFault_Handler_C().
void onLockHook | ( | void | ) |
this depends on chdebug.h patch #if CH_DBG_SYSTEM_STATE_CHECK == TRUE -#define _dbg_enter_lock() (ch.dbg.lock_cnt = (cnt_t)1) -#define _dbg_leave_lock() (ch.dbg.lock_cnt = (cnt_t)0) +#define _dbg_enter_lock() {(ch.dbg.lock_cnt = (cnt_t)1); ON_LOCK_HOOK;} +#define _dbg_leave_lock() {ON_UNLOCK_HOOK;(ch.dbg.lock_cnt = (cnt_t)0);} #endif
Definition at line 234 of file error_handling.cpp.
void onUnlockHook | ( | void | ) |
Definition at line 244 of file error_handling.cpp.
bool warning | ( | ObdCode | code, |
const char * | fmt, | ||
... | |||
) |
ObdCode::OBD_PCM_Processor_Fault is the general error code for now
Definition at line 165 of file error_handling.cpp.
Referenced by TriggerWaveform::addEvent(), assertPinAssigned(), TriggerStimulatorHelper::assertSyncPosition(), buildTimingMap(), check(), createLogFile(), CanTsListener::decodeFrame(), AemXSeriesWideband::decodeRusefiDiag(), Engine::efiWatchdog(), findIndexMsg(), fireSparkBySettingPinLow(), flexCallback(), getAdvance(), SpeedDensityAirmass::getAirmass(), getBaroCorrection(), getCrankingFuel3(), getFiringOrderCylinderId(), getInjectionOffset(), getInternalAdcValue(), getRunningAdvance(), IgnitionState::getSparkDwell(), IFuelComputer::getTCharge(), Pid::getUnclampedOutput(), TriggerCentral::handleShaftSignal(), handleVvtCamSignal(), hip_init(), hipThread(), TriggerWaveform::initializeTriggerWaveform(), interpolateMsg(), TriggerCentral::isToothExpectedNow(), mainTriggerCallback(), mapAveragingAdcCallback(), mapAveragingTriggerCallback(), PrimaryTriggerDecoder::onNotEnoughTeeth(), VvtTriggerDecoder::onNotEnoughTeeth(), SensorChecker::onSlowCallback(), PrimaryTriggerDecoder::onTooManyTeeth(), VvtTriggerDecoder::onTooManyTeeth(), onTriggerEventSparkLogic(), InjectionEvent::onTriggerTooth(), EngineState::periodicFastCallback(), prepareIgnitionSchedule(), readFromFlash(), scheduleSparkEvent(), HIP9011::setAngleWindowWidth(), setGlobalTriggerAngleOffset(), setHardwareSchedulerTimer(), OutputPin::setOnchipValue(), SimplePwm::setSimplePwmDutyCycle(), startDwellByTurningSparkPinHigh(), startSimplePwm(), MapAverager::stop(), InjectionEvent::update(), LimpManager::updateState(), validateBaroMap(), TriggerCentral::validateCamVvtCounters(), and CanTxMessage::~CanTxMessage().
|
static |
Definition at line 16 of file error_handling.cpp.
Referenced by firmwareError(), and getCriticalErrorMessage().
const char* dbg_panic_file |
Definition at line 22 of file error_handling.cpp.
Referenced by chDbgPanic3().
int dbg_panic_line |
Definition at line 23 of file error_handling.cpp.
Referenced by chDbgPanic3().
bool hasFirmwareErrorFlag = false |
Definition at line 20 of file error_handling.cpp.
Referenced by firmwareError(), and warning().
uint32_t lastLockTime |
Definition at line 217 of file error_handling.cpp.
Referenced by onLockHook(), and onUnlockHook().
uint32_t maxLockedDuration = 0 |
Maximum time before requesting lock and releasing lock at the end of critical section
Definition at line 221 of file error_handling.cpp.
Referenced by onUnlockHook(), printRuntimeStats(), resetMaxValues(), and updateTunerStudioState().
WarningCodeState unitTestWarningCodeState |
Definition at line 156 of file error_handling.cpp.
Referenced by warning().
|
static |
Definition at line 15 of file error_handling.cpp.
Referenced by firmwareError(), getWarningMessage(), and warning().
|
extern |