rusefi-1/firmware/controllers/algo/event_registry.h

72 lines
1.5 KiB
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file event_registry.h
*
* @date Nov 27, 2013
2015-12-31 13:02:30 -08:00
* @author Andrey Belomutskiy, (c) 2012-2016
2015-07-10 06:01:56 -07:00
*/
#ifndef EVENT_REGISTRY_H_
#define EVENT_REGISTRY_H_
#include "global.h"
#include "signal_executor.h"
#include "fl_stack.h"
/**
* This structure defines an angle position within the trigger
*/
class event_trigger_position_s {
public:
event_trigger_position_s();
/**
* That's trigger event index
*/
uint32_t eventIndex;
angle_t eventAngle;
/**
* Angle offset from the trigger event
*/
angle_t angleOffset;
};
class InjectionEvent {
public:
InjectionEvent();
/**
2016-07-17 09:02:12 -07:00
* This is a performance optimization for IM_SIMULTANEOUS fuel strategy.
* It's more efficient to handle all injectors together if that's the case
2015-07-10 06:01:56 -07:00
*/
2016-01-11 14:01:33 -08:00
bool isSimultanious;
2016-09-03 21:03:27 -07:00
InjectorOutputPin *output;
2016-01-24 23:03:01 -08:00
int injectorIndex;
2016-08-28 15:01:46 -07:00
bool isOverlapping;
2016-01-24 23:03:01 -08:00
event_trigger_position_s injectionStart;
2015-07-10 06:01:56 -07:00
};
class IgnitionEvent {
public:
IgnitionEvent();
2016-11-01 18:03:07 -07:00
IgnitionOutputPin *output;
2015-07-10 06:01:56 -07:00
scheduling_s signalTimerUp;
scheduling_s signalTimerDown;
angle_t advance;
event_trigger_position_s dwellPosition;
event_trigger_position_s sparkPosition;
IgnitionEvent *next;
2016-11-01 18:03:07 -07:00
int sparkId;
2015-07-10 06:01:56 -07:00
char *name;
};
2016-08-29 19:02:57 -07:00
/**
* two wire batch mode would generate twice the number of cylinders events, that's the max
*/
2016-09-26 18:03:18 -07:00
#define MAX_INJECTION_OUTPUT_COUNT 2 * INJECTION_PIN_COUNT
2016-01-24 23:03:01 -08:00
#define MAX_IGNITION_EVENT_COUNT 80
2015-07-10 06:01:56 -07:00
2016-01-24 23:03:01 -08:00
typedef ArrayList<InjectionEvent, MAX_INJECTION_OUTPUT_COUNT> InjectionEventList;
2015-07-10 06:01:56 -07:00
2016-01-24 23:03:01 -08:00
typedef ArrayList<IgnitionEvent, MAX_IGNITION_EVENT_COUNT> IgnitionEventList;
2015-07-10 06:01:56 -07:00
#endif /* EVENT_REGISTRY_H_ */