fome-fw/firmware/controllers/algo/event_registry.h

61 lines
1.2 KiB
C
Raw Normal View History

2014-08-29 07:52:33 -07:00
/**
* @file event_registry.h
*
* @date Nov 27, 2013
2015-01-12 15:04:10 -08:00
* @author Andrey Belomutskiy, (c) 2012-2015
2014-08-29 07:52:33 -07:00
*/
#ifndef EVENT_REGISTRY_H_
#define EVENT_REGISTRY_H_
#include "global.h"
#include "signal_executor.h"
2015-01-01 15:04:13 -08:00
#include "fl_stack.h"
2014-08-29 07:52:33 -07:00
#define MAX_EVENT_COUNT 80
/**
* This structure defines an angle position within the trigger
*/
2015-01-12 17:07:40 -08:00
class event_trigger_position_s {
public:
2014-08-29 07:52:33 -07:00
/**
* That's trigger event index
*/
2014-09-24 09:03:00 -07:00
uint32_t eventIndex;
2015-01-13 05:04:00 -08:00
angle_t eventAngle;
2014-08-29 07:52:33 -07:00
/**
* Angle offset from the trigger event
*/
2015-01-13 05:04:00 -08:00
angle_t angleOffset;
2015-01-12 17:07:40 -08:00
};
2014-08-29 07:52:33 -07:00
typedef struct {
event_trigger_position_s position;
OutputSignal *actuator;
2014-11-12 06:03:14 -08:00
/**
* This is a performance optimization - it's more efficient to handle all
* injectors together if that's the case
*/
bool_t isSimultanious;
} InjectionEvent;
2014-08-29 07:52:33 -07:00
typedef struct IgnitionEvent_struct IgnitionEvent;
struct IgnitionEvent_struct {
2015-01-13 11:03:46 -08:00
NamedOutputPin *output;
2014-08-29 07:52:33 -07:00
scheduling_s signalTimerUp;
scheduling_s signalTimerDown;
event_trigger_position_s dwellPosition;
float advance;
event_trigger_position_s sparkPosition;
IgnitionEvent *next;
char *name;
};
2014-11-12 06:03:14 -08:00
typedef ArrayList<InjectionEvent, MAX_EVENT_COUNT> ActuatorEventList;
2014-08-29 07:52:33 -07:00
typedef ArrayList<IgnitionEvent, MAX_EVENT_COUNT> IgnitionEventList;
#endif /* EVENT_REGISTRY_H_ */