From 7047fe83e1c7d80bb85eb1cc4b520dcbb9696aab Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sat, 23 Jul 2016 14:03:36 -0400 Subject: [PATCH] auto-sync --- .../controllers/algo/engine_configuration.cpp | 4 ++++ firmware/controllers/algo/obd_error_codes.h | 2 +- firmware/controllers/engine_controller.cpp | 4 ++++ firmware/controllers/sensors/thermistors.cpp | 4 ++-- win32_functional_tests/Makefile | 1 + win32_functional_tests/main.c | 2 ++ .../simulator/framework.cpp | 4 ---- .../simulator/rusEfiFunctionalTest.cpp | 23 +------------------ 8 files changed, 15 insertions(+), 29 deletions(-) diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 25483941dc..b47e42d35c 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -412,7 +412,11 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->iat.config.bias_resistor = 2700; +#if EFI_PROD_CODE engineConfiguration->warningPeriod = 10; +#else + engineConfiguration->warningPeriod = 0; +#endif engineConfiguration->step1rpm = 3000; engineConfiguration->step1timing = 10; diff --git a/firmware/controllers/algo/obd_error_codes.h b/firmware/controllers/algo/obd_error_codes.h index faa793ea01..765674031d 100644 --- a/firmware/controllers/algo/obd_error_codes.h +++ b/firmware/controllers/algo/obd_error_codes.h @@ -1724,7 +1724,7 @@ typedef enum { CUSTOM_OBD_52 = 6052, CUSTOM_OBD_53 = 6053, CUSTOM_OBD_54 = 6054, - CUSTOM_OBD_55 = 6035, + CUSTOM_OBD_55 = 6055, CUSTOM_OBD_56 = 6056, CUSTOM_OBD_57 = 6057, CUSTOM_OBD_58 = 6058, diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index a97dbd7214..564558e2a8 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -497,8 +497,12 @@ static void setVBattVoltage(float voltage) { } static void initMockVoltage(void) { + setCltVoltage(2); addConsoleActionF("set_mock_clt_voltage", setCltVoltage); + + setIatVoltage(2); addConsoleActionF("set_mock_iat_voltage", setIatVoltage); + addConsoleActionF("set_mock_maf_voltage", setMafVoltage); addConsoleActionF("set_mock_afr_voltage", setAfrVoltage); addConsoleActionF("set_mock_tps_voltage", setTpsVoltage); diff --git a/firmware/controllers/sensors/thermistors.cpp b/firmware/controllers/sensors/thermistors.cpp index 5ef1727cc3..abb8e3b7c0 100644 --- a/firmware/controllers/sensors/thermistors.cpp +++ b/firmware/controllers/sensors/thermistors.cpp @@ -109,7 +109,7 @@ float getCoolantTemperature(DECLARE_ENGINE_PARAMETER_F) { if (!isValidCoolantTemperature(temperature)) { efiAssert(engineConfiguration!=NULL, "NULL engineConfiguration", NAN); if (engineConfiguration->hasCltSensor) { - warning(CUSTOM_OBD_26, "unrealistic CLT %f", temperature); + warning(OBD_Engine_Coolant_Temperature_Circuit_Malfunction, "unrealistic CLT %f", temperature); } return LIMPING_MODE_CLT_TEMPERATURE; } @@ -172,7 +172,7 @@ float getIntakeAirTemperature(DECLARE_ENGINE_PARAMETER_F) { if (!isValidIntakeAirTemperature(temperature)) { efiAssert(engineConfiguration!=NULL, "NULL engineConfiguration", NAN); if (engineConfiguration->hasIatSensor) { - warning(CUSTOM_OBD_27, "unrealistic IAT %f", temperature); + warning(OBD_Intake_Air_Temperature_Circuit_Malfunction, "unrealistic IAT %f", temperature); } return LIMPING_MODE_IAT_TEMPERATURE; } diff --git a/win32_functional_tests/Makefile b/win32_functional_tests/Makefile index 70e68eac40..4515817df8 100644 --- a/win32_functional_tests/Makefile +++ b/win32_functional_tests/Makefile @@ -145,6 +145,7 @@ CPPSRC = $(UTILSRC_CPP) \ $(CONTROLLERS_ALGO_SRC_CPP) \ $(PROJECT_DIR)/controllers/settings.cpp \ $(PROJECT_DIR)/controllers/engine_controller.cpp \ + $(PROJECT_DIR)/controllers/error_handling.cpp \ $(PROJECT_DIR)/development/sensor_chart.cpp \ $(TRIGGER_SRC_CPP) \ $(TRIGGER_DECODERS_SRC_CPP) \ diff --git a/win32_functional_tests/main.c b/win32_functional_tests/main.c index 9b9df2eb18..3b790a5fd3 100644 --- a/win32_functional_tests/main.c +++ b/win32_functional_tests/main.c @@ -21,6 +21,8 @@ #define CONSOLE_WA_SIZE THD_WA_SIZE(4096) +bool main_loop_started = false; + static thread_t *cdtp; //static Thread *shelltp1; //static Thread *shelltp2; diff --git a/win32_functional_tests/simulator/framework.cpp b/win32_functional_tests/simulator/framework.cpp index 988490bdfd..6be2ae0fda 100644 --- a/win32_functional_tests/simulator/framework.cpp +++ b/win32_functional_tests/simulator/framework.cpp @@ -26,10 +26,6 @@ efitimesec_t getTimeNowSeconds(void) { return chTimeNow() / CH_FREQUENCY; } -bool isWarningNow(efitimesec_t now) { - return false; -} - int getRusEfiVersion(void) { return 239; } diff --git a/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp b/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp index a46b504868..df914c6e1c 100644 --- a/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp +++ b/win32_functional_tests/simulator/rusEfiFunctionalTest.cpp @@ -35,11 +35,6 @@ extern engine_configuration2_s * engineConfiguration2; extern WaveChart waveChart; -uint32_t maxLockTime = 0; - -// todo: move this field to trigger_central -bool isInsideTriggerHandler; - //persistent_config_container_s persistentState; //static engine_configuration2_s ec2; @@ -72,7 +67,7 @@ void rusEfiFunctionalTest(void) { printToWin32Console("TODO"); initIntermediateLoggingBuffer(); -// initErrorHandling(); + initErrorHandling(); initializeConsole(&sharedLogger); @@ -146,18 +141,6 @@ void logMsg(const char *format, ...) { // fclose(fp); } -static time_t timeOfPreviousWarning = -10; - -// todo: re-use primary firmware implementation? -int warning(obd_code_e code, const char *fmt, ...) { - int now = currentTimeMillis() / 1000; - if (absI(now - timeOfPreviousWarning) < 10) - return TRUE; // we just had another warning, let's not spam - timeOfPreviousWarning = now; - printf("Warning: %s\r\n", fmt); - return FALSE; -} - void firmwareError(const char *fmt, ...) { printf("firmwareError [%s]\r\n", fmt); @@ -173,7 +156,3 @@ void firmwareError(const char *fmt, ...) { SerialDriver * getConsoleChannel(void) { return (SerialDriver *)EFI_CONSOLE_UART_DEVICE; } - -void chDbgPanic3(const char *msg, const char * file, int line) { - onFatalError(msg, file, line); -}