diff --git a/firmware/controllers/algo/event_registry.cpp b/firmware/controllers/algo/event_registry.cpp index 52feca5945..c3d80b13d2 100644 --- a/firmware/controllers/algo/event_registry.cpp +++ b/firmware/controllers/algo/event_registry.cpp @@ -24,6 +24,10 @@ #include "main.h" #include "engine_math.h" +IgnitionEvent::IgnitionEvent() { + name = NULL; +} + //void registerActuatorEventWhat(ActuatorEventList *list, int eventIndex, OutputSignal *actuator, float angleOffset) { // ActuatorEvent *e = list->getNextActuatorEvent(); // if (e == NULL) diff --git a/firmware/controllers/algo/event_registry.h b/firmware/controllers/algo/event_registry.h index 15baf0db5b..7e506b835a 100644 --- a/firmware/controllers/algo/event_registry.h +++ b/firmware/controllers/algo/event_registry.h @@ -30,7 +30,8 @@ public: angle_t angleOffset; }; -typedef struct { +class InjectionEvent { +public: event_trigger_position_s position; OutputSignal *actuator; /** @@ -38,16 +39,16 @@ typedef struct { * injectors together if that's the case */ bool_t isSimultanious; -} InjectionEvent; +}; -typedef struct IgnitionEvent_struct IgnitionEvent; - -struct IgnitionEvent_struct { +class IgnitionEvent { +public: + IgnitionEvent(); NamedOutputPin *output; scheduling_s signalTimerUp; scheduling_s signalTimerDown; - event_trigger_position_s dwellPosition; float advance; + event_trigger_position_s dwellPosition; event_trigger_position_s sparkPosition; IgnitionEvent *next; char *name; diff --git a/firmware/controllers/system/event_queue.h b/firmware/controllers/system/event_queue.h index 8fb2495364..7306f376e0 100644 --- a/firmware/controllers/system/event_queue.h +++ b/firmware/controllers/system/event_queue.h @@ -24,7 +24,7 @@ bool assertNotInList(T *head, T*element) { { if (++counter > QUEUE_LENGTH_LIMIT) { firmwareError("Looped queue?"); - return FALSE; + return false; } if (current == element) { /** @@ -33,10 +33,10 @@ bool assertNotInList(T *head, T*element) { * by time with slow RPM the whole next fast revolution might be within the wait period */ warning(OBD_PCM_Processor_Fault, "re-adding element into event_queue: [%s]", element->name); - return TRUE; + return true; } } - return FALSE; + return false; } class EventQueue {