fome-fw/firmware/controllers/trigger/trigger_emulator_algo.h

34 lines
923 B
C
Raw Normal View History

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"
class Logging;
class PwmConfig;
class MultiChannelStateSequence;
void initTriggerEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
void startTriggerEmulatorPins();
void stopTriggerEmulatorPins();
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);
};
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);
bool needEvent(const int currentIndex, const int size, const MultiChannelStateSequence& mcss, int channelIndex);
2019-03-03 21:40:22 -08:00