2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file trigger_emulator_algo.h
|
|
|
|
*
|
|
|
|
* @date Mar 3, 2014
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2020-01-20 22:40:11 -08:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
#include "engine.h"
|
2020-04-24 11:00:06 -07:00
|
|
|
|
|
|
|
class Logging;
|
|
|
|
class PwmConfig;
|
|
|
|
class MultiChannelStateSequence;
|
|
|
|
|
|
|
|
void initTriggerEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
|
|
|
|
void setTriggerEmulatorRPM(int value DECLARE_ENGINE_PARAMETER_SUFFIX);
|
|
|
|
void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousConfiguration);
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
class TriggerEmulatorHelper {
|
|
|
|
public:
|
|
|
|
TriggerEmulatorHelper();
|
|
|
|
void handleEmulatorCallback(PwmConfig *state, int stateIndex);
|
|
|
|
};
|
|
|
|
|
2019-01-09 05:50:51 -08:00
|
|
|
void initTriggerEmulatorLogic(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-03-03 21:40:22 -08:00
|
|
|
int getPreviousIndex(const int currentIndex, const int size);
|
2019-12-03 22:11:10 -08:00
|
|
|
bool needEvent(const int currentIndex, const int size, MultiChannelStateSequence *multiChannelStateSequence, int channelIndex);
|
2019-03-03 21:40:22 -08:00
|
|
|
|