示例#1
0
文件: cj125.cpp 项目: rusefi/rusefi
static void cjStart(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
	if (!CONFIGB(isCJ125Enabled)) {
		scheduleMsg(logger, "cj125 is disabled.");
		return;
	}
	
	globalInstance.cjIdentify();

	// Load calibration values
#if EFI_PROD_CODE
	uint32_t storedLambda = backupRamLoad(BACKUP_CJ125_CALIBRATION_LAMBDA);
	uint32_t storedHeater = backupRamLoad(BACKUP_CJ125_CALIBRATION_HEATER);
#else
	uint32_t storedLambda = 0;
	uint32_t storedHeater = 0;
#endif
	// if no calibration, try to calibrate now and store new values
	if (storedLambda == 0 || storedHeater == 0) {
		cjCalibrate();
	} else {
		scheduleMsg(logger, "cj125: Loading stored calibration data (%d %d)", storedLambda, storedHeater);
		globalInstance.vUaCal = getVoltageFrom16bit(storedLambda);
		globalInstance.vUrCal = getVoltageFrom16bit(storedHeater);
		// Start normal measurement mode
		globalInstance.cjSetMode(CJ125_MODE_NORMAL_17);
	}
	cjPrintData();

#if EFI_PROD_CODE
	// todo: testig solution
	lastSlowAdcCounter = getSlowAdcCounter();
#endif
}
示例#2
0
static int loadStepperPos() {
	return (int)backupRamLoad(BACKUP_STEPPER_POS) - 1;
}