really not clear what is the best place for these classes
This commit is contained in:
parent
4e26bd2fd2
commit
2b59940161
|
@ -29,28 +29,8 @@
|
|||
#include "global_execution_queue.h"
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
||||
#define MAX_INJECTION_OUTPUT_COUNT INJECTION_PIN_COUNT
|
||||
#define FAST_CALLBACK_PERIOD_MS 20
|
||||
|
||||
/**
|
||||
* This class knows about when to inject fuel
|
||||
*/
|
||||
class FuelSchedule {
|
||||
public:
|
||||
FuelSchedule();
|
||||
/**
|
||||
* this method schedules all fuel events for an engine cycle
|
||||
*/
|
||||
void addFuelEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
bool addFuelEventsForCylinder(int cylinderIndex DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
InjectionEvent elements[MAX_INJECTION_OUTPUT_COUNT];
|
||||
bool isReady;
|
||||
|
||||
private:
|
||||
void clear();
|
||||
};
|
||||
|
||||
class RpmCalculator;
|
||||
|
||||
#define MAF_DECODING_CACHE_SIZE 256
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
#include "fl_stack.h"
|
||||
#include "trigger_structure.h"
|
||||
|
||||
#define MAX_INJECTION_OUTPUT_COUNT INJECTION_PIN_COUNT
|
||||
|
||||
|
||||
class Engine;
|
||||
|
||||
class InjectionEvent {
|
||||
|
@ -31,6 +34,28 @@ public:
|
|||
event_trigger_position_s injectionStart;
|
||||
};
|
||||
|
||||
/**
|
||||
* This class knows about when to inject fuel
|
||||
*/
|
||||
class FuelSchedule {
|
||||
public:
|
||||
FuelSchedule();
|
||||
/**
|
||||
* this method schedules all fuel events for an engine cycle
|
||||
*/
|
||||
void addFuelEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
bool addFuelEventsForCylinder(int cylinderIndex DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
/**
|
||||
* injection events, per cylinder
|
||||
*/
|
||||
InjectionEvent elements[MAX_INJECTION_OUTPUT_COUNT];
|
||||
bool isReady;
|
||||
|
||||
private:
|
||||
void clear();
|
||||
};
|
||||
|
||||
#define MAX_OUTPUTS_FOR_IGNITION 2
|
||||
|
||||
class IgnitionEvent {
|
||||
|
@ -74,6 +99,9 @@ public:
|
|||
|
||||
class IgnitionEventList {
|
||||
public:
|
||||
/**
|
||||
* ignition events, per cylinder
|
||||
*/
|
||||
IgnitionEvent elements[MAX_IGNITION_EVENT_COUNT];
|
||||
bool isReady = false;
|
||||
};
|
||||
|
|
|
@ -552,7 +552,7 @@ TEST(misc, testTriggerDecoder) {
|
|||
|
||||
extern fuel_Map3D_t fuelMap;
|
||||
|
||||
static void assertInjectionEvent(const char *msg, InjectionEvent *ev, int injectorIndex, int eventIndex, angle_t angleOffset, bool isOverlapping) {
|
||||
static void assertInjectionEvent(const char *msg, InjectionEvent *ev, int injectorIndex, int eventIndex, angle_t angleOffset, bool unused) {
|
||||
assertEqualsM4(msg, "inj index", injectorIndex, ev->outputs[0]->injectorIndex);
|
||||
assertEqualsM4(msg, " event index", eventIndex, ev->injectionStart.triggerEventIndex);
|
||||
assertEqualsM4(msg, " event offset", angleOffset, ev->injectionStart.angleOffsetFromTriggerEvent);
|
||||
|
|
Loading…
Reference in New Issue