making new scheduling API avalable
This commit is contained in:
parent
82fab0282c
commit
d007a7f902
|
@ -5,7 +5,7 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2019
|
* @author Andrey Belomutskiy, (c) 2012-2019
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "global.h"
|
#include "spark_logic.h"
|
||||||
#include "os_access.h"
|
#include "os_access.h"
|
||||||
#include "engine_math.h"
|
#include "engine_math.h"
|
||||||
|
|
||||||
|
@ -224,7 +224,11 @@ static bool assertNotInIgnitionList(AngleBasedEvent *head, AngleBasedEvent *elem
|
||||||
* @return true if event corresponds to current tooth and was time-based scheduler
|
* @return true if event corresponds to current tooth and was time-based scheduler
|
||||||
* false if event was put into queue for scheduling at a later tooth
|
* false if event was put into queue for scheduling at a later tooth
|
||||||
*/
|
*/
|
||||||
static bool scheduleOrQueue(AngleBasedEvent *event, uint32_t trgEventIndex, angle_t angle, schfunc_t callback, void *param DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
bool scheduleOrQueue(AngleBasedEvent *event,
|
||||||
|
uint32_t trgEventIndex,
|
||||||
|
angle_t angle,
|
||||||
|
schfunc_t callback,
|
||||||
|
void *param DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
event->position.setAngle(angle PASS_ENGINE_PARAMETER_SUFFIX);
|
event->position.setAngle(angle PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -240,7 +244,7 @@ static bool scheduleOrQueue(AngleBasedEvent *event, uint32_t trgEventIndex, angl
|
||||||
* time-based schedule. This case we would be firing events with best possible angle precision.
|
* time-based schedule. This case we would be firing events with best possible angle precision.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if (event->position.triggerEventIndex == trgEventIndex) {
|
if (trgEventIndex != TRIGGER_EVENT_UNDEFINED && event->position.triggerEventIndex == trgEventIndex) {
|
||||||
/**
|
/**
|
||||||
* Spark should be fired before the next trigger event - time-based delay is best precision possible
|
* Spark should be fired before the next trigger event - time-based delay is best precision possible
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2017
|
* @author Andrey Belomutskiy, (c) 2012-2017
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONTROLLERS_TRIGGER_SPARK_LOGIC_H_
|
#pragma once
|
||||||
#define CONTROLLERS_TRIGGER_SPARK_LOGIC_H_
|
|
||||||
|
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
|
@ -19,4 +18,9 @@ int getNumberOfSparks(ignition_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
percent_t getCoilDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX);
|
percent_t getCoilDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
void initializeIgnitionActions(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
void initializeIgnitionActions(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
#endif /* CONTROLLERS_TRIGGER_SPARK_LOGIC_H_ */
|
#define TRIGGER_EVENT_UNDEFINED -1
|
||||||
|
bool scheduleOrQueue(AngleBasedEvent *event,
|
||||||
|
uint32_t trgEventIndex,
|
||||||
|
angle_t angle,
|
||||||
|
schfunc_t callback,
|
||||||
|
void *param DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
Loading…
Reference in New Issue