From 0fc66f1598ad510fb1165f2389e958ebefb34b2c Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 10 Apr 2020 20:31:58 -0400 Subject: [PATCH 1/4] progress --- firmware/config/engines/mazda_miata_vvt.h | 13 +++++++++++++ firmware/controllers/settings.cpp | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/firmware/config/engines/mazda_miata_vvt.h b/firmware/config/engines/mazda_miata_vvt.h index a9462cfc02..cc72460947 100644 --- a/firmware/config/engines/mazda_miata_vvt.h +++ b/firmware/config/engines/mazda_miata_vvt.h @@ -14,9 +14,22 @@ void setMazdaMiataNbInjectorLag(DECLARE_CONFIG_PARAMETER_SIGNATURE); void setMazdaMiataNbTpsTps(DECLARE_CONFIG_PARAMETER_SIGNATURE); +/** + * Primary rusEfi test mule https://rusefi.com/forum/viewtopic.php?f=3&t=1095 + * MAZDA_MIATA_2003 + * set engine_type 47 + */ void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +/** + * race car - NA body and fuel system with NB2 engine + */ void setMazdaMiata2003EngineConfigurationNaFuelRail(DECLARE_CONFIG_PARAMETER_SIGNATURE); void setMazdaMiata2003EngineConfigurationBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE); void setMiataNB2_MRE_ETB(DECLARE_CONFIG_PARAMETER_SIGNATURE); + +/** + * OEM mechanical throttle body + * set engine_type 11 + */ void setMiataNB2_MRE_MTB(DECLARE_CONFIG_PARAMETER_SIGNATURE); diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index ec020483ca..4a29682c1e 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -687,6 +687,10 @@ static void setCj125HeaterPin(const char *pinName) { setIndividualPin(pinName, &engineConfiguration->wboHeaterPin, "cj125 heater"); } +static void setTriggerSyncPin(const char *pinName) { + setIndividualPin(pinName, &engineConfiguration->debugTriggerSync, "trigger sync"); +} + static void setStarterRelayPin(const char *pinName) { setIndividualPin(pinName, &engineConfiguration->starterRelayDisablePin, "starter disable relay"); } @@ -1441,6 +1445,7 @@ void initSettings(void) { addConsoleActionS("set_starter_relay_pin", setStarterRelayPin); addConsoleActionS("set_cj125_cs_pin", setCj125CsPin); addConsoleActionS("set_cj125_heater_pin", setCj125HeaterPin); + addConsoleActionS("set_trigger_sync_pin", setTriggerSyncPin); addConsoleActionS("set_can_rx_pin", setCanRxPin); addConsoleActionS("set_can_tx_pin", setCanTxPin); From 6b7958c7f0d988ecd5631afc9e9d304623d745d6 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 11 Apr 2020 01:05:49 -0400 Subject: [PATCH 2/4] thank you kon for your first contribution --- java_console/ui/src/com/rusefi/Launcher.java | 2 +- .../ui/src/com/rusefi/maintenance/FirmwareFlasher.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/java_console/ui/src/com/rusefi/Launcher.java b/java_console/ui/src/com/rusefi/Launcher.java index 31673f12d8..8af5cb01fb 100644 --- a/java_console/ui/src/com/rusefi/Launcher.java +++ b/java_console/ui/src/com/rusefi/Launcher.java @@ -49,7 +49,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; * @see EngineSnifferPanel */ public class Launcher { - public static final int CONSOLE_VERSION = 20200410; + public static final int CONSOLE_VERSION = 20200411; public static final String INI_FILE_PATH = System.getProperty("ini_file_path", ".."); public static final String INPUT_FILES_PATH = System.getProperty("input_files_path", ".."); public static final String TOOLS_PATH = System.getProperty("tools_path", "."); diff --git a/java_console/ui/src/com/rusefi/maintenance/FirmwareFlasher.java b/java_console/ui/src/com/rusefi/maintenance/FirmwareFlasher.java index 4131c8989b..9d2e2ea64b 100644 --- a/java_console/ui/src/com/rusefi/maintenance/FirmwareFlasher.java +++ b/java_console/ui/src/com/rusefi/maintenance/FirmwareFlasher.java @@ -19,9 +19,8 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig; * 2/4/15 */ public class FirmwareFlasher { - // Even on Windows openOCD insists on "/" for path separator - public static final String IMAGE_FILE = INPUT_FILES_PATH + File.separator + "rusefi.bin"; - public static final String IMAGE_NO_ASSERTS_FILE = INPUT_FILES_PATH + File.separator + "rusefi_no_asserts.bin"; + public static final String IMAGE_FILE = INPUT_FILES_PATH + "/" + "rusefi.bin"; + public static final String IMAGE_NO_ASSERTS_FILE = INPUT_FILES_PATH + "/" + "rusefi_no_asserts.bin"; /** * SWD ST-LINK/V2 mode */ From 44ef63e102976679d9e7ae557ac1bf92e963523a Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 11 Apr 2020 01:22:31 -0400 Subject: [PATCH 3/4] making magic constants a bit less fragile --- firmware/controllers/trigger/trigger_central.cpp | 5 +++++ firmware/integration/rusefi_config.txt | 3 +++ firmware/tunerstudio/rusefi.input | 2 +- .../models/src/com/rusefi/config/generated/Fields.java | 4 +++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 696bcb5209..c4f84f3d74 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -42,6 +42,11 @@ WaveChart waveChart; trigger_central_s::trigger_central_s() : hwEventCounters() { + static_assert(TRIGGER_TYPE_60_2 == TT_TOOTHED_WHEEL_60_2, "One we will have one source of this magic constant"); + static_assert(TRIGGER_TYPE_36_1 == TT_TOOTHED_WHEEL_36_1, "One we will have one source of this magic constant"); + + + } TriggerCentral::TriggerCentral() : trigger_central_s() { diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 39d73a5fb6..ed04cf5fe8 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -73,6 +73,9 @@ struct_no_prefix engine_configuration_s #define ETB_BIAS_CURVE_LENGTH 8 +#define TRIGGER_TYPE_60_2 8 +#define TRIGGER_TYPE_36_1 9 + #define MAP_ANGLE_SIZE 8 #define MAP_WINDOW_SIZE 8 diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index a081e0634d..7f786f37ca 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1569,7 +1569,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "VVT display inverted", vvtDisplayInverted field = "print verbose sync details to console",verboseTriggerSynchDetails field = "Do not print messages in case of sync error", silentTriggerError - field = "Enable noise filtering", useNoiselessTriggerDecoder, {trigger_type == 8 || trigger_type == 9} + field = "Enable noise filtering", useNoiselessTriggerDecoder, {trigger_type == @@TRIGGER_TYPE_60_2@@ || trigger_type == 9} dialog = triggerConfiguration panel = triggerConfiguration_settings, North panel = triggerConfiguration_IO, South diff --git a/java_console/models/src/com/rusefi/config/generated/Fields.java b/java_console/models/src/com/rusefi/config/generated/Fields.java index 0d6b10dad2..b36d4db53f 100644 --- a/java_console/models/src/com/rusefi/config/generated/Fields.java +++ b/java_console/models/src/com/rusefi/config/generated/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config.generated; -// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Fri Apr 10 17:27:25 EDT 2020 +// this file was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Apr 11 01:15:22 EDT 2020 // by class com.rusefi.output.FileJavaFieldsConsumer import com.rusefi.config.*; @@ -1292,6 +1292,8 @@ public class Fields { public static final int trigger_todoRemoveMeOneDay0_offset_hex = 210; public static final int trigger_todoRemoveMeOneDay1_offset = 528; public static final int trigger_todoRemoveMeOneDay1_offset_hex = 210; + public static final int TRIGGER_TYPE_36_1 = 9; + public static final int TRIGGER_TYPE_60_2 = 8; public static final int trigger_type_offset = 524; public static final int trigger_unusedBit_4_10_offset = 528; public static final int trigger_unusedBit_4_10_offset_hex = 210; From 72f66411133e00647de03fd6ab6bfee25fc22315 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 11 Apr 2020 01:52:16 -0400 Subject: [PATCH 4/4] making magic constants a bit less fragile --- firmware/tunerstudio/rusefi.input | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 7f786f37ca..a3c7cb6602 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1569,7 +1569,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "VVT display inverted", vvtDisplayInverted field = "print verbose sync details to console",verboseTriggerSynchDetails field = "Do not print messages in case of sync error", silentTriggerError - field = "Enable noise filtering", useNoiselessTriggerDecoder, {trigger_type == @@TRIGGER_TYPE_60_2@@ || trigger_type == 9} + field = "Enable noise filtering", useNoiselessTriggerDecoder, {trigger_type == @@TRIGGER_TYPE_60_2@@ || trigger_type == @@TRIGGER_TYPE_36_1@@} dialog = triggerConfiguration panel = triggerConfiguration_settings, North panel = triggerConfiguration_IO, South