refactoring: smarter C++ initialization
This commit is contained in:
parent
fdfd2244ce
commit
53231f7b49
|
@ -31,19 +31,8 @@ InjectionEvent::InjectionEvent() {
|
|||
memset(outputs, 0, sizeof(outputs));
|
||||
}
|
||||
|
||||
event_trigger_position_s::event_trigger_position_s() {
|
||||
eventIndex = 0;
|
||||
eventAngle = 0;
|
||||
angleOffset = 0;
|
||||
}
|
||||
|
||||
IgnitionEvent::IgnitionEvent() {
|
||||
name = NULL;
|
||||
next = NULL;
|
||||
memset(outputs, 0, sizeof(outputs));
|
||||
advance = NAN;
|
||||
sparkId = 0;
|
||||
cylinderIndex = 0;
|
||||
}
|
||||
|
||||
IgnitionOutputPin * IgnitionEvent::getOutputForLoggins() {
|
||||
|
|
|
@ -40,21 +40,21 @@ public:
|
|||
IgnitionOutputPin *outputs[MAX_OUTPUTS_FOR_IGNITION];
|
||||
scheduling_s signalTimerUp;
|
||||
scheduling_s signalTimerDown;
|
||||
angle_t advance;
|
||||
angle_t advance = NAN;
|
||||
floatms_t sparkDwell;
|
||||
uint32_t startOfDwell;
|
||||
event_trigger_position_s dwellPosition;
|
||||
event_trigger_position_s sparkPosition;
|
||||
IgnitionEvent *next;
|
||||
IgnitionEvent *next = NULL;
|
||||
/**
|
||||
* @see globalSparkIdCoutner
|
||||
*/
|
||||
int sparkId;
|
||||
int sparkId = 0;
|
||||
/**
|
||||
* [0, specs.cylindersCount)
|
||||
*/
|
||||
int cylinderIndex;
|
||||
char *name;
|
||||
int cylinderIndex = 0;
|
||||
char *name = NULL;
|
||||
#if EFI_UNIT_TEST
|
||||
Engine *engine;
|
||||
#endif
|
||||
|
|
|
@ -47,16 +47,15 @@
|
|||
*/
|
||||
class event_trigger_position_s {
|
||||
public:
|
||||
event_trigger_position_s();
|
||||
/**
|
||||
* That's trigger event index
|
||||
*/
|
||||
uint32_t eventIndex;
|
||||
angle_t eventAngle;
|
||||
uint32_t eventIndex = 0;
|
||||
angle_t eventAngle = 0;
|
||||
/**
|
||||
* Angle offset from the trigger event
|
||||
*/
|
||||
angle_t angleOffset;
|
||||
angle_t angleOffset = 0;
|
||||
};
|
||||
|
||||
#define TRIGGER_CHANNEL_COUNT 3
|
||||
|
|
Loading…
Reference in New Issue