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

64 lines
1.9 KiB
C
Raw Normal View History

2014-08-29 07:52:33 -07:00
/**
* @file ec2.h
*
* this is a mess because some code is still in C and some is
* already in C++. trigger structure is C++
* TODO: rename? merge? Do something with this file
*
* @date Apr 26, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef EC2_H_
#define EC2_H_
#include "engine_configuration.h"
#include "event_registry.h"
#include "trigger_structure.h"
2014-11-07 06:03:03 -08:00
class FuelSchedule {
public:
ActuatorEventList events;
2014-11-07 09:03:10 -08:00
void addFuelEvents(engine_configuration_s const *e, trigger_shape_s *s,
injection_mode_e mode);
void registerInjectionEvent(engine_configuration_s const *e, trigger_shape_s *s,
io_pin_e pin, float angle);
2014-11-07 06:03:03 -08:00
};
2014-08-29 07:52:33 -07:00
/**
* this part of the structure is separate just because so far
* these fields are not integrated with Tuner Studio. Step by step :)
*/
class engine_configuration2_s {
// todo: move these fields into Engine class, eliminate this class
public:
engine_configuration2_s();
2014-10-31 12:03:00 -07:00
// todo: this should go, too
2014-10-31 11:05:18 -07:00
engine_configuration_s *engineConfiguration;
2014-08-29 07:52:33 -07:00
trigger_shape_s triggerShape;
2014-11-07 06:03:03 -08:00
FuelSchedule crankingInjectionEvents;
FuelSchedule injectionEvents;
/**
* We are alternating two event lists in order to avoid a potential issue around revolution boundary
* when an event is scheduled within the next revolution.
*/
IgnitionEventList ignitionEvents[2];
2014-08-29 07:52:33 -07:00
};
2014-11-04 11:03:07 -08:00
void initializeIgnitionActions(float advance, float dwellAngle, engine_configuration_s *engineConfiguration,
engine_configuration2_s *engineConfiguration2, IgnitionEventList *list);
2014-08-29 07:52:33 -07:00
void setDefaultNonPersistentConfiguration(engine_configuration2_s *engineConfiguration2);
void printConfiguration(engine_configuration_s *engineConfiguration, engine_configuration2_s *engineConfiguration2);
2014-11-07 06:03:03 -08:00
void registerActuatorEventExt(engine_configuration_s const *engineConfiguration, trigger_shape_s * s, ActuatorEvent *e,
OutputSignal *actuator, float angleOffset);
2014-08-29 07:52:33 -07:00
#endif /* EC2_H_ */