Skip to content

Commit

Permalink
more docs related to trigger process
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefillc committed Nov 22, 2018
1 parent c77ab92 commit 2fa2213
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 4 deletions.
3 changes: 3 additions & 0 deletions firmware/controllers/algo/rusefi_enums.h
Expand Up @@ -293,6 +293,9 @@ typedef enum {
// do not forget to edit "#define trigger_type_e_enum" line in integration/rusefi_config.txt file to propogate new value to rusefi.ini TS project
// do not forget to invoke "gen_config.bat" once you make changes to integration/rusefi_config.txt
// todo: one day a hero would integrate some of these things into Makefile in order to reduce manual magic
//
// Another point: once you add a new trigger, run get_trigger_images.bat which would run rusefi_test.exe from unit_tests
//
TT_UNUSED = 43, // this is used if we want to iterate over all trigger types

Force_4_bytes_size_trigger_type = ENUM_32_BITS,
Expand Down
5 changes: 4 additions & 1 deletion firmware/controllers/trigger/trigger_central.cpp
Expand Up @@ -447,7 +447,10 @@ void printAllTriggers() {

FILE * fp = fopen (TRIGGERS_FILE_NAME, "w+");

fprintf(fp, "# Generated by rusEfi\n");
fprintf(fp, "# Generated by rusEfi unit test suite\n");
fprintf(fp, "# This file is used by TriggerImage tool\n");
fprintf(fp, "# See 'gen_trigger_images.bat'\n");

printTriggerDebug = true;
for (int triggerId = 1; triggerId < TT_UNUSED; triggerId++) {
trigger_type_e tt = (trigger_type_e) triggerId;
Expand Down
16 changes: 16 additions & 0 deletions firmware/gen_trigger_images.bat
@@ -1,4 +1,20 @@
rem This takes triggers.txt generated by unit_test binary and produces a bunch of .png files
rem these images are published at

cd ../unit_tests
make
if not exist build/rusefi_test.exe echo UNIT TEST COMPILATION FAILED
if not exist build/rusefi_test.exe exit -1

rem This is me using Cygwin on all my Windows devices
ls -l build/rusefi_test.exe


del triggers.txt
build\rusefi_test.exe
pwd

if not exist triggers.txt echo triggers.txt generation FAILED
if not exist triggers.txt exit -1

java -cp ../java_console_binary/rusefi_console.jar com.rusefi.TriggerImage
4 changes: 2 additions & 2 deletions java_console/models/src/com/rusefi/config/Fields.java
@@ -1,6 +1,6 @@
package com.rusefi.config;

// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Oct 30 04:58:47 EDT 2018
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Thu Nov 22 10:00:39 EST 2018
public class Fields {
public static final int LE_COMMAND_LENGTH = 200;
public static final int BLOCKING_FACTOR = 400;
Expand Down Expand Up @@ -1288,7 +1288,7 @@ public class Fields {
public static final Field TPSADCCHANNEL = Field.create("TPSADCCHANNEL", 520, FieldType.INT, adc_channel_e);
public static final Field OVERRIDECRANKINGIGNITION = Field.create("OVERRIDECRANKINGIGNITION", 524, FieldType.INT);
public static final Field SENSORCHARTFREQUENCY = Field.create("SENSORCHARTFREQUENCY", 528, FieldType.INT);
public static final String[] trigger_type_e = {"custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "Miata NB", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Honda 4+24+1", "Mitsubishi", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Honda 1+24", "Dodge Stratus", "36_2_2_2", "Nissan Primera", "2JZ", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "Dodge Neon 2003 crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "trg42", "trg43", "trg44", "trg45", "INVALID"};
public static final String[] trigger_type_e = {"custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "Miata NB", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Honda 4+24+1", "Mitsubishi", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Honda 1+24", "Dodge Stratus", "36_2_2_2", "Nissan Primera", "2JZ", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "Dodge Neon 2003 crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "trg43", "trg44", "trg45", "INVALID"};
public static final Field TRIGGER_TYPE = Field.create("TRIGGER_TYPE", 532, FieldType.INT, trigger_type_e);
public static final Field TRIGGER_UNUSEDCUSTOMISSYNCHRONIZATIONNEEDED = Field.create("TRIGGER_UNUSEDCUSTOMISSYNCHRONIZATIONNEEDED", 536, FieldType.BIT, 0);
public static final Field TRIGGER_UNUSEDCUSTOMNEEDSECONDTRIGGERINPUT = Field.create("TRIGGER_UNUSEDCUSTOMNEEDSECONDTRIGGERINPUT", 536, FieldType.BIT, 1);
Expand Down
14 changes: 13 additions & 1 deletion unit_tests/triggers.txt
@@ -1,4 +1,6 @@
# Generated by rusEfi
# Generated by rusEfi unit test suite
# This file is used by TriggerImage tool
# See 'gen_trigger_images.bat'
TRIGGERTYPE 1 10 TT_FORD_ASPIRE 0.00
# duty 0.50 0.38
event 0 1 0.00
Expand Down Expand Up @@ -2487,3 +2489,13 @@ event 0 1 0.00
event 1 0 120.00
event 2 1 180.00
event 3 0 660.00
TRIGGERTYPE 42 8 TT_MAZDA_Z5 0.00
# duty 0.36 0.00
event 0 0 0.00
event 1 1 120.00
event 2 0 180.00
event 3 1 300.00
event 4 0 360.00
event 5 1 480.00
event 6 0 558.00
event 7 1 660.00

0 comments on commit 2fa2213

Please sign in to comment.