void initAccelEnrichment(Logging *sharedLogger) { logger = sharedLogger; addConsoleActionI("set_tps_accel_len", setTpsAccelLen); addConsoleActionF("set_tps_accel_threshold", setTpsAccelThr); addConsoleActionF("set_tps_accel_multiplier", setTpsAccelMult); addConsoleActionF("set_tps_decel_threshold", setTpsDecelThr); addConsoleActionF("set_tps_decel_multiplier", setTpsDecelMult); addConsoleActionI("set_engine_load_accel_len", setEngineLoadAccelLen); addConsoleActionF("set_engine_load_accel_threshold", setEngineLoadAccelThr); addConsoleActionF("set_engine_load_accel_multiplier", setEngineLoadAccelMult); addConsoleActionF("set_engine_decel_threshold", setDecelThr); addConsoleActionF("set_engine_decel_multiplier", setDecelMult); addConsoleAction("accelinfo", accelInfo); updateAccelParameters(); }
static void periodicSlowCallback(Engine *engine) { efiAssertVoid(getRemainingStack(chThdSelf()) > 64, "lowStckOnEv"); #if EFI_PROD_CODE /** * We need to push current value into the 64 bit counter often enough so that we do not miss an overflow */ bool alreadyLocked = lockAnyContext(); updateAndSet(&halTime.state, hal_lld_get_counter_value()); if (!alreadyLocked) { unlockAnyContext(); } #endif if (!engine->rpmCalculator.isRunning()) { #if (EFI_PROD_CODE && EFI_ENGINE_CONTROL && EFI_INTERNAL_FLASH) || defined(__DOXYGEN__) writeToFlashIfPending(); #endif resetAccel(); } if (versionForConfigurationListeners.isOld()) { updateAccelParameters(); engine->engineState.warmupAfrPid.reset(); } engine->watchdog(); engine->updateSlowSensors(); #if (EFI_PROD_CODE && EFI_FSIO) || defined(__DOXYGEN__) runFsio(); #endif cylinderCleanupControl(engine); scheduleNextSlowInvocation(); }