auto-sync

This commit is contained in:
rusEfi 2015-02-02 22:07:37 -06:00
parent e77ded7f76
commit f59fb7a9a0
6 changed files with 34 additions and 12 deletions

View File

@ -11,7 +11,7 @@
#include "honda_accord.h"
void setCustomEngineConfiguration(engine_configuration_s *engineConfiguration) {
// engineConfiguration->trigger.type =
engineConfiguration->trigger.type = TT_ONE_PLUS_ONE;
board_configuration_s * boardConfiguration = &engineConfiguration->bc;
setFrankenso_01_LCD(boardConfiguration);

View File

@ -1,4 +1,4 @@
// this section was generated by config_definition.jar on Mon Feb 02 11:59:15 EST 2015
// this section was generated by config_definition.jar on Mon Feb 02 22:40:26 EST 2015
// begin
#include "rusefi_types.h"
typedef struct {
@ -165,9 +165,11 @@ typedef struct {
*/
trigger_type_e type;
/**
* offset 4
*/
bool32_t customIsSynchronizationNeeded;
offset 4 bit 0 */
bool_t customIsSynchronizationNeeded : 1;
/**
offset 4 bit 1 */
bool_t customUseSecondChannel : 1;
/**
* offset 8
*/
@ -1128,4 +1130,4 @@ typedef struct {
} engine_configuration_s;
// end
// this section was generated by config_definition.jar on Mon Feb 02 11:59:15 EST 2015
// this section was generated by config_definition.jar on Mon Feb 02 22:40:26 EST 2015

View File

@ -255,6 +255,18 @@ void initializeSkippedToothTriggerShapeExt(TriggerShape *s, int totalTeethCount,
initializeSkippedToothTriggerShape(s, totalTeethCount, skippedCount, operationMode);
}
static void configureOnePlusOne(TriggerShape *s) {
s->reset(FOUR_STROKE_CAM_SENSOR);
s->addEvent(180, T_PRIMARY, TV_HIGH);
s->addEvent(360, T_PRIMARY, TV_LOW);
s->addEvent(540, T_SECONDARY, TV_HIGH);
s->addEvent(720, T_SECONDARY, TV_LOW);
s->isSynchronizationNeeded = false;
}
/**
* External logger is needed because at this point our logger is not yet initialized
*/
@ -307,6 +319,10 @@ void initializeTriggerShape(Logging *logger, engine_configuration_s const *engin
configureMazdaProtegeLx(triggerShape);
break;
case TT_ONE_PLUS_ONE:
configureOnePlusOne(triggerShape);
break;
case TT_MAZDA_SOHC_4:
configureMazdaProtegeSOHC(triggerShape);
break;

View File

@ -1,7 +1,6 @@
! this file defines the format of rusEfi persistent configuration structure
! this file is processed by ../java_tools/config_definition.jar tool
!
! comments start with '!'
!
! each field is declared as
@ -213,10 +212,11 @@ struct trigger_config_s @brief Trigger wheel(s) configuration
custom bool32_t 4 bits, U32, @OFFSET@, [0:0], "false", "true"
custom trigger_type_e 4 bits, U32, @OFFSET@, [0:3], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Escort GT", "60/2", "36/1", "Accord CD", "MITSU", "INVALID", "INVALID", "INVALID", "INVALID"
custom trigger_type_e 4 bits, U32, @OFFSET@, [0:4], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 4+1", "1+1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
trigger_type_e type;
bool32_t customIsSynchronizationNeeded;
bit customIsSynchronizationNeeded;
bit customUseSecondChannel;
int customTotalToothCount;;"number", 1, 0.0, 0, 1000.0, 2
int customSkippedToothCount;;"number", 1, 0.0, 0, 1000.0, 2

View File

@ -37,7 +37,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated by ConfigDefinition.jar on Mon Feb 02 11:59:15 EST 2015
; this section was generated by ConfigDefinition.jar on Mon Feb 02 22:40:27 EST 2015
pageSize = 11832
page = 1
@ -126,8 +126,9 @@ page = 1
tpsAdcChannel = bits, U32, 1016, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5"
;skipping overrideCrankingIgnition offset 1020
analogChartFrequency = scalar, S32, 1024, "index", 1, 0, 0, 300, 0 ; size 4
trigger_type = bits, U32, 1028, [0:3], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Escort GT", "60/2", "36/1", "Accord CD", "MITSU", "INVALID", "INVALID", "INVALID", "INVALID"
trigger_customIsSynchronizationNeeded = bits, U32, 1032, [0:0], "false", "true"
trigger_type = bits, U32, 1028, [0:4], "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 4+1", "1+1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
trigger_customIsSynchronizationNeeded= bits, U32, 1032, [0:0], "false", "true"
trigger_customUseSecondChannel= bits, U32, 1032, [1:1], "false", "true"
trigger_customTotalToothCount = scalar, S32, 1036, "number", 1, 0.0, 0, 1000.0, 2
trigger_customSkippedToothCount = scalar, S32, 1040, "number", 1, 0.0, 0, 1000.0, 2
trigger_customSyncRatioFrom = scalar, F32, 1044, "number", 1, 0.0, 0, 1000.0, 2

View File

@ -521,6 +521,9 @@ void testTriggerDecoder(void) {
testTriggerDecoder2("testFordEscortGt", FORD_ESCORT_GT, 0, 0.8096, 0.3844);
testTriggerDecoder2("testMiniCooper", MINI_COOPER_R50, 121, 0.5222, 0.4959);
testTriggerDecoder2("testRoverV8", ROVER_V8, 0, 0.4861, 0);
testTriggerDecoder2("test1+1", CUSTOM_ENGINE, 0, 0.7500, 0.2500);
testTriggerDecoder2("testCitroen", CITROEN_TU3JP, 0, 0.4833, 0);
testTriggerDecoder2("testAccordCd 3w", HONDA_ACCORD_CD, 12, 0.8146, 0.5000);
testTriggerDecoder2("testAccordCd 2w", HONDA_ACCORD_CD_TWO_WIRES, 10, 0.8146, 0.5);