diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index bb778790b1..731bf451df 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -35,6 +35,11 @@ #include "trigger_structure.h" #include "efiGpio.h" #include "engine.h" +#include "engine_math.h" + +#if EFI_ANALOG_CHART || defined(__DOXYGEN__) +#include "sensor_chart.h" +#endif static OutputPin triggerDecoderErrorPin; @@ -121,6 +126,28 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no prevSignal = curSignal; curSignal = signal; +#if EFI_ANALOG_CHART || defined(__DOXYGEN__) + if (boardConfiguration->sensorChartMode == SC_RPM_ACCEL) { + angle_t currentAngle = TRIGGER_SHAPE(eventAngles[currentCycle.current_index]); + // todo: make this '90' depend on cylinder count? + angle_t prevAngle = currentAngle - 90; + fixAngle(prevAngle); + int prevIndex = TRIGGER_SHAPE(triggerIndexByAngle[(int)prevAngle]); + // now let's get precise angle for that event + prevAngle = TRIGGER_SHAPE(eventAngles[prevIndex]); + uint32_t time = nowNt - timeOfLastEvent[prevIndex]; + angle_t angleDiff = currentAngle - prevAngle; + // todo: angle diff should be pre-calculated + fixAngle(angleDiff); + + float r = (angleDiff / 360.0) / (NT2US(time) / 60000000.0); + + scAddData(currentAngle, r); + instantRpmValue[currentCycle.current_index] = r; + } +#endif + + timeOfLastEvent[currentCycle.current_index] = nowNt; currentCycle.eventCount[triggerWheel]++; diff --git a/firmware/iar/ch.ewp b/firmware/iar/ch.ewp index 66d30fd557..2a806833b2 100644 --- a/firmware/iar/ch.ewp +++ b/firmware/iar/ch.ewp @@ -1934,6 +1934,12 @@ $PROJ_DIR$\..\config\engines\custom_engine.h + + $PROJ_DIR$\..\config\engines\daihatsu.cpp + + + $PROJ_DIR$\..\config\engines\daihatsu.h + $PROJ_DIR$\..\config\engines\dodge_neon.cpp @@ -2477,6 +2483,12 @@ $PROJ_DIR$\..\controllers\trigger\trigger_structure.h + + $PROJ_DIR$\..\controllers\trigger\trigger_subaru.cpp + + + $PROJ_DIR$\..\controllers\trigger\trigger_subaru.h + $PROJ_DIR$\..\controllers\alternatorController.cpp diff --git a/java_console/ui/src/com/rusefi/Launcher.java b/java_console/ui/src/com/rusefi/Launcher.java index 68710d8fe9..5c17fce9a9 100644 --- a/java_console/ui/src/com/rusefi/Launcher.java +++ b/java_console/ui/src/com/rusefi/Launcher.java @@ -32,7 +32,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; * @see com.rusefi.StartupFrame */ public class Launcher { - public static final int CONSOLE_VERSION = 20150907; + public static final int CONSOLE_VERSION = 20150912; public static final boolean SHOW_STIMULATOR = false; private static final String TAB_INDEX = "main_tab"; protected static final String PORT_KEY = "port";