From 5d5c80a8a12d48642c1c161403d9b4d83c938914 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 3 Nov 2018 13:17:58 -0400 Subject: [PATCH] CJ125 unit-tests coverage #617 --- firmware/hw_layer/HIP9011.cpp | 2 ++ firmware/hw_layer/pin_repository.h | 3 +-- firmware/hw_layer/sensors/CJ125.cpp | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/firmware/hw_layer/HIP9011.cpp b/firmware/hw_layer/HIP9011.cpp index ec8fb4261b..145f495dbf 100644 --- a/firmware/hw_layer/HIP9011.cpp +++ b/firmware/hw_layer/HIP9011.cpp @@ -250,7 +250,9 @@ static void intHoldCallback(trigger_event_e ckpEventType, uint32_t index DECLARE // todo: schedule this based on closest trigger event, same as ignition works scheduleByAngle(rpm, &startTimer[structIndex], engineConfiguration->knockDetectionWindowStart, (schfunc_t) &startIntegration, NULL, &engine->rpmCalculator); +#if EFI_PROD_CODE hipLastExecutionCount = lastExecutionCount; +#endif scheduleByAngle(rpm, &endTimer[structIndex], engineConfiguration->knockDetectionWindowEnd, (schfunc_t) &endIntegration, NULL, &engine->rpmCalculator); diff --git a/firmware/hw_layer/pin_repository.h b/firmware/hw_layer/pin_repository.h index 8647b648a0..406c0949ef 100644 --- a/firmware/hw_layer/pin_repository.h +++ b/firmware/hw_layer/pin_repository.h @@ -11,8 +11,7 @@ #ifndef PIN_REPOSITORY_H_ #define PIN_REPOSITORY_H_ -#include "ch.h" -#include "hal.h" +#include "global.h" #include "io_pins.h" #ifdef __cplusplus diff --git a/firmware/hw_layer/sensors/CJ125.cpp b/firmware/hw_layer/sensors/CJ125.cpp index 6d8cb39224..dbafa56705 100644 --- a/firmware/hw_layer/sensors/CJ125.cpp +++ b/firmware/hw_layer/sensors/CJ125.cpp @@ -287,8 +287,10 @@ static void cjCalibrate(void) { uint32_t storedLambda = get16bitFromVoltage(vUaCal); uint32_t storedHeater = get16bitFromVoltage(vUrCal); scheduleMsg(logger, "cj125: Done! Saving calibration data (%d %d).", storedLambda, storedHeater); +#if EFI_PROD_CODE backupRamSave(BACKUP_CJ125_CALIBRATION_LAMBDA, storedLambda); backupRamSave(BACKUP_CJ125_CALIBRATION_HEATER, storedHeater); +#endif state = CJ125_IDLE; }