diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index e04933eab5..d882c22b43 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -73,6 +73,17 @@ uint32_t triggerMaxDuration = 0; extern bool isInsideTriggerHandler; +void hwHandleVvtCamSignal(trigger_value_e front) { + + // startOfCycleNt + + if (ENGINE(isEngineChartEnabled)) { + // this is a performance optimization - array index is cheaper then invoking a method with 'switch' + addEngineSniffferEvent("VVT", front == TV_RISE ? WC_UP : WC_DOWN); + } + +} + void hwHandleShaftSignal(trigger_event_e signal) { triggerHanlderEntryTime = GET_TIMESTAMP(); isInsideTriggerHandler = true; diff --git a/firmware/controllers/trigger/trigger_central.h b/firmware/controllers/trigger/trigger_central.h index 372da922dc..b64b222deb 100644 --- a/firmware/controllers/trigger/trigger_central.h +++ b/firmware/controllers/trigger/trigger_central.h @@ -41,6 +41,7 @@ void triggerInfo(void); efitime_t getCrankEventCounter(DECLARE_ENGINE_PARAMETER_F); efitime_t getStartOfRevolutionIndex(DECLARE_ENGINE_PARAMETER_F); void hwHandleShaftSignal(trigger_event_e signal); +void hwHandleVvtCamSignal(trigger_value_e front); float getTriggerDutyCycle(int index); void initTriggerCentral(Logging *sharedLogger, Engine *engine); void printAllCallbacksHistogram(void); diff --git a/firmware/controllers/trigger/trigger_decoder.h b/firmware/controllers/trigger/trigger_decoder.h index 830aedacd5..bcc8646352 100644 --- a/firmware/controllers/trigger/trigger_decoder.h +++ b/firmware/controllers/trigger/trigger_decoder.h @@ -97,6 +97,7 @@ public: void resetRunningCounters(); uint32_t runningRevolutionCounter; + efitick_t startOfCycleNt; private: void resetCurrentCycleState(); @@ -106,7 +107,6 @@ private: uint32_t totalRevolutionCounter; bool isFirstEvent; efitime_t prevCycleDuration; - efitick_t startOfCycleNt; }; angle_t getEngineCycle(operation_mode_e operationMode); diff --git a/firmware/hw_layer/mmc_card.cpp b/firmware/hw_layer/mmc_card.cpp index cfc5c6c64c..23fcb3e34e 100644 --- a/firmware/hw_layer/mmc_card.cpp +++ b/firmware/hw_layer/mmc_card.cpp @@ -209,8 +209,8 @@ int { if (n != 0) { - const u_char *us1 = (const u_char *)s1; - const u_char *us2 = (const u_char *)s2; + const char *us1 = (const char *)s1; + const char *us2 = (const char *)s2; do { if (mytolower(*us1) != mytolower(*us2)) diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 45c1d88108..939b83552c 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -154,6 +154,13 @@ static void scheduleReboot(void) { unlockAnyContext(); } +/** + * Current engine configuration. On firmware start we assign empty configuration, then + * we copy actual configuration after reading settings. + * This is useful to compare old and new configurations in order to apply new settings. + * + * todo: place this field next to 'engineConfiguration'? + */ engine_configuration_s activeConfiguration; static void rememberCurrentConfiguration(void) { @@ -296,5 +303,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20160810; + return 20160819; }