From 894e62f0a330a5da8ca3634ca846a9ba0f287ddf Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 12 May 2017 13:08:11 -0400 Subject: [PATCH] getter fix --- firmware/controllers/settings.cpp | 16 +++++++++------- .../autotest/src/com/rusefi/AutoTest.java | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 0a98f9d747..a2adb4ec1f 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -964,7 +964,7 @@ typedef struct { } plain_get_float_s; -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if ! EFI_UNIT_TEST || defined(__DOXYGEN__) plain_get_integer_s getI_plain[] = { // {"cranking_rpm", &engineConfiguration->cranking.rpm}, // {"cranking_injection_mode", setCrankingInjectionMode}, @@ -1000,6 +1000,7 @@ plain_get_integer_s getI_plain[] = { }; plain_get_float_s getF_plain[] = { + {"cranking_dwell", &engineConfiguration->ignitionDwellForCrankingMs}, {"idle_position", &boardConfiguration->manIdlePosition}, {"ignition_offset", &engineConfiguration->ignitionOffset}, {"injection_offset", &engineConfiguration->extraInjectionOffset}, @@ -1009,14 +1010,14 @@ plain_get_float_s getF_plain[] = { {"cranking_timing_angle", &engineConfiguration->crankingTimingAngle}, {"cranking_charge_angle", &engineConfiguration->crankingChargeAngle}, }; -#endif /* EFI_PROD_CODE */ +#endif /* EFI_UNIT_TEST */ static void getValue(const char *paramStr) { -#if EFI_PROD_CODE || defined(__DOXYGEN__) +#if ! EFI_UNIT_TEST || defined(__DOXYGEN__) { plain_get_integer_s *currentI = &getI_plain[0]; - while (currentI < currentI + sizeof(getI_plain)/sizeof(getI_plain[0])) { + while (currentI < getI_plain + sizeof(getI_plain)/sizeof(getI_plain[0])) { if (strEqualCaseInsensitive(paramStr, currentI->token)) { scheduleMsg(&logger, "%s value: %d", currentI->token, *currentI->value); return; @@ -1026,16 +1027,17 @@ static void getValue(const char *paramStr) { } plain_get_float_s *currentF = &getF_plain[0]; - while (currentF < currentF + sizeof(getF_plain)/sizeof(getF_plain[0])) { + while (currentF < getF_plain + sizeof(getF_plain)/sizeof(getF_plain[0])) { if (strEqualCaseInsensitive(paramStr, currentF->token)) { - scheduleMsg(&logger, "%s value: %f", currentF->token, *currentF->value); + float value = *currentF->value; + scheduleMsg(&logger, "%s value: %f", currentF->token, value); return; } currentF++; } -#endif /* EFI_PROD_CODE */ +#endif /* EFI_UNIT_TEST */ if (strEqualCaseInsensitive(paramStr, "isCJ125Enabled")) { diff --git a/java_console/autotest/src/com/rusefi/AutoTest.java b/java_console/autotest/src/com/rusefi/AutoTest.java index a366594697..64a3be9440 100644 --- a/java_console/autotest/src/com/rusefi/AutoTest.java +++ b/java_console/autotest/src/com/rusefi/AutoTest.java @@ -69,7 +69,7 @@ public class AutoTest { private static void testMazdaMiata2003() { setEngineType(47); -// sendCommand("get cranking_dwell"); // just test coverage + sendCommand("get cranking_dwell"); // just test coverage // sendCommand("get nosuchgettersdfsdfsdfsdf"); // just test coverage }