better trigger definition API

This commit is contained in:
rusefi 2020-04-18 20:28:03 -04:00
parent 4d24fdd57d
commit 114b34a583
4 changed files with 18 additions and 10 deletions

View File

@ -90,17 +90,17 @@ void initialize_Mazda_Engine_z5_Shape(TriggerWaveform *s) {
void initializeMazdaMiataNb2Crank(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR);
float o = 160;
float o = 40;
s->tdcPosition = 60 + 655;
s->setTriggerSynchronizationGap2(0.35f, 0.98f);
// 384
s->addEvent720(o + 4 * 56.0f, T_PRIMARY, TV_FALL);
s->addEventAngle(o + 56.0f, T_PRIMARY, TV_FALL);
// 400
s->addEvent720(o + 4 * 60.0f, T_PRIMARY, TV_RISE);
s->addEvent720(o + 4 * 136.0f, T_PRIMARY, TV_FALL);
s->addEvent720(o + 4 * 140.0f, T_PRIMARY, TV_RISE);
s->addEventAngle(o + 60.0f, T_PRIMARY, TV_RISE);
s->addEventAngle(o + 136.0f, T_PRIMARY, TV_FALL);
s->addEventAngle(o + 140.0f, T_PRIMARY, TV_RISE);
}
static void initializeMazdaMiataNb1ShapeWithOffset(TriggerWaveform *s, float offset) {

View File

@ -11,5 +11,3 @@
#include "trigger_structure.h"
void initializeRoverK(TriggerWaveform *s);

View File

@ -190,8 +190,12 @@ void TriggerWaveform::calculateExpectedEventCounts(bool useOnlyRisingEdgeForTrig
}
void TriggerWaveform::addEvent720(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const stateParam) {
addEvent(angle / 720, channelIndex, stateParam);
void TriggerWaveform::addEvent720(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const state) {
addEvent(angle / 720, channelIndex, state);
}
void TriggerWaveform::addEventAngle(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const state) {
addEvent(angle / getCycleDuration(), channelIndex, state);
}
void TriggerWaveform::addEvent(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const stateParam) {

View File

@ -222,10 +222,16 @@ public:
/* 0..1 angle range */
void addEvent(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const state);
/* 0..720 angle range
* Deprecated?
* Deprecated!
*/
void addEvent720(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const state);
/**
* This version of 'addEvent...' family considers the angle duration of operationMode in this trigger
* For example, 0..180 for FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR
*/
void addEventAngle(angle_t angle, trigger_wheel_e const channelIndex, trigger_value_e const state);
/* 0..720 angle range
* Deprecated?
*/