fome-fw/firmware/controllers/engine_cycle/spark_logic.h

30 lines
938 B
C
Raw Normal View History

2016-09-15 15:02:36 -07:00
/*
* @file spark_logic.h
*
* @date Sep 15, 2016
2020-01-07 21:02:40 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2016-09-15 15:02:36 -07:00
*/
2019-12-02 19:28:32 -08:00
#pragma once
2016-09-15 15:02:36 -07:00
#include "engine.h"
2017-05-25 19:28:04 -07:00
int isInjectionEnabled(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
2016-09-21 20:03:22 -07:00
void initSparkLogic(Logging *sharedLogger);
2016-11-01 18:03:07 -07:00
void turnSparkPinHigh(IgnitionEvent *event);
void fireSparkAndPrepareNextSchedule(IgnitionEvent *event);
2017-05-15 20:33:22 -07:00
int getNumberOfSparks(ignition_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX);
percent_t getCoilDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX);
2019-11-17 06:32:12 -08:00
void initializeIgnitionActions(DECLARE_ENGINE_PARAMETER_SIGNATURE);
2016-09-15 15:02:36 -07:00
2019-12-23 19:12:55 -08:00
int isIgnitionTimingError(void);
2019-12-02 19:28:32 -08:00
#define TRIGGER_EVENT_UNDEFINED -1
bool scheduleOrQueue(AngleBasedEvent *event,
uint32_t trgEventIndex,
efitick_t edgeTimestamp,
2019-12-02 19:28:32 -08:00
angle_t angle,
action_s action
DECLARE_ENGINE_PARAMETER_SUFFIX);