2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file main_trigger_callback.h
|
|
|
|
* @brief Main logic header
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @date Feb 9, 2013
|
2020-01-07 21:02:40 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2019-12-23 17:19:13 -08:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2018-09-16 19:00:14 -07:00
|
|
|
#include "engine.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
#include "event_registry.h"
|
|
|
|
|
2021-04-21 11:28:48 -07:00
|
|
|
void initMainEventListener(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2020-10-03 23:09:12 -07:00
|
|
|
void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
|
2020-10-03 22:43:02 -07:00
|
|
|
|
2018-03-04 20:53:48 -08:00
|
|
|
void startPrimeInjectionPulse(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2018-03-04 19:32:02 -08:00
|
|
|
void startSimultaniousInjection(Engine *engine);
|
2018-03-04 19:45:20 -08:00
|
|
|
void endSimultaniousInjection(InjectionEvent *event);
|
2020-01-10 20:17:58 -08:00
|
|
|
void turnInjectionPinHigh(InjectionEvent *event);
|
|
|
|
void turnInjectionPinLow(InjectionEvent *event);
|
2016-09-26 18:03:18 -07:00
|
|
|
|
2017-12-23 11:15:35 -08:00
|
|
|
// reset injection switch counter if the engine started spinning
|
|
|
|
void updatePrimeInjectionPulseState(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2020-05-14 04:44:32 -07:00
|
|
|
|
|
|
|
// Internal use only - exposed for tests
|
|
|
|
void handleFuelInjectionEvent(int injEventIndex, InjectionEvent *event,
|
|
|
|
int rpm, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX);
|