mirror of https://github.com/rusefi/rusefi.git
T2 (#5647)
* fix unit-tests * add cam/vvt support to trigger_emulator --------- Co-authored-by: andreika-git <andrei.home@gmail.com> Co-authored-by: rusefillc <sdfsdfqsf2334234234>
This commit is contained in:
parent
2507d4e467
commit
9c54180bf6
|
@ -43,7 +43,7 @@ TriggerEmulatorHelper::TriggerEmulatorHelper() {
|
|||
|
||||
static OutputPin emulatorOutputs[PWM_PHASE_MAX_WAVE_PER_PWM];
|
||||
|
||||
void TriggerEmulatorHelper::handleEmulatorCallback(const MultiChannelStateSequence& multiChannelStateSequence, int stateIndex) {
|
||||
void TriggerEmulatorHelper::handleEmulatorCallback(int ch, const MultiChannelStateSequence& multiChannelStateSequence, int stateIndex) {
|
||||
efitick_t stamp = getTimeNowNt();
|
||||
|
||||
// todo: code duplication with TriggerStimulatorHelper::feedSimulatedEvent?
|
||||
|
@ -131,7 +131,7 @@ static void emulatorApplyPinState(int stateIndex, PwmConfig *state) /* pwm_gen_c
|
|||
/**
|
||||
* this callback would invoke the input signal handlers directly
|
||||
*/
|
||||
helper.handleEmulatorCallback(
|
||||
helper.handleEmulatorCallback(0,
|
||||
*state->multiChannelStateSequence,
|
||||
stateIndex);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// 1 crank and CAMS_PER_BANK cam channels
|
||||
#define NUM_EMULATOR_CHANNELS (1 + CAMS_PER_BANK)
|
||||
|
||||
class PwmConfig;
|
||||
class MultiChannelStateSequence;
|
||||
|
||||
|
@ -24,7 +27,7 @@ void disableTriggerStimulator();
|
|||
class TriggerEmulatorHelper {
|
||||
public:
|
||||
TriggerEmulatorHelper();
|
||||
void handleEmulatorCallback(const MultiChannelStateSequence& mcss, int stateIndex);
|
||||
void handleEmulatorCallback(int ch, const MultiChannelStateSequence& mcss, int stateIndex);
|
||||
};
|
||||
|
||||
int getPreviousIndex(const int currentIndex, const int size);
|
||||
|
|
|
@ -21,7 +21,7 @@ TEST(miata, miata_na_tdc) {
|
|||
int time = getSimulatedEventTime(shape, i);
|
||||
eth.setTimeAndInvokeEventsUs(time);
|
||||
|
||||
emulatorHelper.handleEmulatorCallback(
|
||||
emulatorHelper.handleEmulatorCallback(0,
|
||||
shape.wave,
|
||||
i % shape.getSize());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue