From 078f50c5c4b1ce049c8f67946947699cd1f59a41 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 26 Feb 2015 10:07:06 -0600 Subject: [PATCH] auto-sync --- firmware/controllers/algo/engine.cpp | 7 ++++++- firmware/controllers/algo/engine.h | 6 +++--- firmware/controllers/algo/lcd_menu_tree.cpp | 3 ++- firmware/controllers/core/EfiWave.cpp | 2 ++ firmware/controllers/system/pwm_generator_logic.cpp | 2 ++ firmware/controllers/trigger/rpm_calculator.cpp | 1 + firmware/controllers/trigger/trigger_central.cpp | 1 + firmware/controllers/trigger/trigger_structure.cpp | 2 ++ firmware/hw_layer/adc_inputs.cpp | 1 + firmware/rusefi.cpp | 2 +- firmware/util/datalogging.cpp | 4 ++++ 11 files changed, 25 insertions(+), 6 deletions(-) diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 9974b6686e..75904a0827 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -60,6 +60,11 @@ Engine::Engine() { stopEngineRequestTimeNt = 0; isRunningPwmTest = false; isTestMode = false; + isSpinning = false; + + injectorLagMs = advance = dwellAngle = fuelMs = 0; + clutchDownState = clutchUpState = false; + memset(&m, 0, sizeof(m)); addConfigurationListener(invokeEnginePreCalculate); } @@ -95,7 +100,7 @@ static bool stopPin(NamedOutputPin *output) { return false; } -bool Engine::stopPins() { +bool_t Engine::stopPins() { bool result = false; for (int i = 0; i < engineConfiguration->specs.cylindersCount; i++) { result |= stopPin(&enginePins.coils[i]); diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 012a447ca9..8f2743e865 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -190,7 +190,7 @@ public: * This field is true if we are in 'cylinder cleanup' state right now * see isCylinderCleanupEnabled */ - bool isCylinderCleanupMode; + bool_t isCylinderCleanupMode; /** * pre-calculating this value is a performance optimization @@ -230,8 +230,8 @@ private: * 'running' means RPM are above crankingRpm * 'spinning' means the engine is not stopped */ - bool isSpinning; - bool stopPins(); + bool_t isSpinning; + bool_t stopPins(); }; /** diff --git a/firmware/controllers/algo/lcd_menu_tree.cpp b/firmware/controllers/algo/lcd_menu_tree.cpp index 807890b9f9..fab5fd2c3d 100644 --- a/firmware/controllers/algo/lcd_menu_tree.cpp +++ b/firmware/controllers/algo/lcd_menu_tree.cpp @@ -59,7 +59,8 @@ MenuItem::MenuItem(MenuItem * parent, const char *text) { MenuItem::MenuItem(MenuItem * parent, lcd_line_e lcdLine) { this->lcdLine = lcdLine; - this->text = NULL; + text = NULL; + topOfTheList = NULL; init(parent, NULL); } diff --git a/firmware/controllers/core/EfiWave.cpp b/firmware/controllers/core/EfiWave.cpp index 9fcf44dee0..c8eced492b 100644 --- a/firmware/controllers/core/EfiWave.cpp +++ b/firmware/controllers/core/EfiWave.cpp @@ -22,6 +22,8 @@ void single_wave_s::init(pin_state_t *pinStates) { } multi_wave_s::multi_wave_s() { + waves = NULL; + switchTimes = NULL; reset(); } diff --git a/firmware/controllers/system/pwm_generator_logic.cpp b/firmware/controllers/system/pwm_generator_logic.cpp index 094444ee0c..c6ca7ea39b 100644 --- a/firmware/controllers/system/pwm_generator_logic.cpp +++ b/firmware/controllers/system/pwm_generator_logic.cpp @@ -25,8 +25,10 @@ SimplePwm::SimplePwm() { PwmConfig::PwmConfig() { memset(&scheduling, 0, sizeof(scheduling)); + memset(&safe, 0, sizeof(safe)); scheduling.name = "PwmConfig"; periodNt = NAN; +// todo outputPins = NULL; phaseCount = 0; cycleCallback = NULL; stateChangeCallback = NULL; diff --git a/firmware/controllers/trigger/rpm_calculator.cpp b/firmware/controllers/trigger/rpm_calculator.cpp index f18382a52f..282c185f9b 100644 --- a/firmware/controllers/trigger/rpm_calculator.cpp +++ b/firmware/controllers/trigger/rpm_calculator.cpp @@ -43,6 +43,7 @@ RpmCalculator::RpmCalculator() { #if !EFI_PROD_CODE mockRpm = MOCK_UNDEFINED; #endif + rpmValue = 0; setRpmValue(0); // we need this initial to have not_running at first invocation diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index eb1c346b71..18fc89f155 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -93,6 +93,7 @@ void hwHandleShaftSignal(trigger_event_e signal) { #endif /* EFI_PROD_CODE */ TriggerCentral::TriggerCentral() { + nowNt = 0; memset(hwEventCounters, 0, sizeof(hwEventCounters)); clearCallbacks(&triggerListeneres); } diff --git a/firmware/controllers/trigger/trigger_structure.cpp b/firmware/controllers/trigger/trigger_structure.cpp index 4bb60b2392..e73d5df256 100644 --- a/firmware/controllers/trigger/trigger_structure.cpp +++ b/firmware/controllers/trigger/trigger_structure.cpp @@ -41,6 +41,8 @@ TriggerShape::TriggerShape() : isSynchronizationNeeded = false; invertOnAdd = false; tdcPosition = 0; + skippedToothCount = totalToothCount = 0; + syncRatioFrom = syncRatioTo = 0; } int TriggerShape::getSize() const { diff --git a/firmware/hw_layer/adc_inputs.cpp b/firmware/hw_layer/adc_inputs.cpp index 7d8c5fbd6d..3486c7c7ec 100644 --- a/firmware/hw_layer/adc_inputs.cpp +++ b/firmware/hw_layer/adc_inputs.cpp @@ -23,6 +23,7 @@ AdcDevice::AdcDevice(ADCConversionGroup* hwConfig) { this->hwConfig = hwConfig; channelCount = 0; conversionCount = 0; + errorsCount = 0; hwConfig->sqr1 = 0; hwConfig->sqr2 = 0; diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 2c68249c9a..ff2a691cd7 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -278,5 +278,5 @@ int getRusEfiVersion(void) { return 1; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE == 0) return 1; // this is here to make the compiler happy about the unused array - return 20150225; + return 20150226; } diff --git a/firmware/util/datalogging.cpp b/firmware/util/datalogging.cpp index a8472b249c..d1643287b7 100644 --- a/firmware/util/datalogging.cpp +++ b/firmware/util/datalogging.cpp @@ -387,6 +387,10 @@ void initIntermediateLoggingBuffer(void) { #endif /* ! EFI_UNIT_TEST */ Logging::Logging() { + name = NULL; + buffer = linePointer = NULL; + bufferSize = 0; + isInitialized = false; } Logging::Logging(char const *name, char *buffer, int bufferSize) {