auto-sync

This commit is contained in:
rusEfi 2016-06-13 16:03:13 -04:00
parent 6c2baaabc7
commit bc1849ed46
6 changed files with 43 additions and 8 deletions

View File

@ -34,6 +34,7 @@ void setToyota_jzs147EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
// temporary while I am fixing trigger bug
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
//set_trigger_type 16
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.customTotalToothCount = 36;
engineConfiguration->trigger.customSkippedToothCount = 2;

View File

@ -175,8 +175,10 @@ case TT_UNUSED:
return "TT_UNUSED";
case TT_NISSAN:
return "TT_NISSAN";
case TT_2JZ:
return "TT_2JZ";
case TT_2JZ_1_12:
return "TT_2JZ_1_12";
case TT_2JZ_3_34:
return "TT_2JZ_3_34";
case TT_ROVER_K:
return "TT_ROVER_K";
}

View File

@ -173,7 +173,7 @@ typedef enum {
TT_NISSAN = 24,
TT_2JZ = 25,
TT_2JZ_3_34 = 25,
TT_ROVER_K = 26,
@ -181,7 +181,10 @@ typedef enum {
TT_HONDA_CBR_600 = 28,
TT_UNUSED = 29, // this is used if we want to iterate over all trigger types
TT_2JZ_1_12 = 29,
TT_UNUSED = 30, // this is used if we want to iterate over all trigger types
Force_4b_trigger_type = ENUM_32_BITS,
} trigger_type_e;

View File

@ -522,8 +522,12 @@ void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMET
initialize36_2_2_2(triggerShape);
break;
case TT_2JZ:
initialize2jzGE(triggerShape);
case TT_2JZ_3_34:
initialize2jzGE3_34(triggerShape);
break;
case TT_2JZ_1_12:
initialize2jzGE1_12(triggerShape);
break;
case TT_NISSAN:

View File

@ -11,7 +11,31 @@
EXTERN_ENGINE;
void initialize2jzGE(TriggerShape *s) {
void initialize2jzGE1_12(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
float crankD = 360 / 12 / 2; // 15
float crankAngle = 10;
for (int i = 0; i < 2; i++) {
s->addEvent(crankAngle + crankD, T_SECONDARY, TV_RISE, -1, 721);
crankAngle += crankD;
s->addEvent(crankAngle + crankD, T_SECONDARY, TV_FALL, -1, 721); // 120
crankAngle += crankD;
} // 2 + 10
s->addEvent(75, T_PRIMARY, TV_RISE, -1, 721);
s->addEvent(720, T_PRIMARY, TV_FALL, -1, 721);
s->isSynchronizationNeeded = false;
}
void initialize2jzGE3_34(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
float camD = 720 / 6; // 120

View File

@ -10,6 +10,7 @@
#include "engine.h"
void initialize2jzGE(TriggerShape *s);
void initialize2jzGE1_12(TriggerShape *s);
void initialize2jzGE3_34(TriggerShape *s);
#endif /* CONTROLLERS_TRIGGER_TRIGGER_TOYOTA_H_ */