refactoring

This commit is contained in:
rusefi 2017-05-25 22:28:04 -04:00
parent 1718186ee5
commit 9c40a9fb6e
5 changed files with 8 additions and 8 deletions

View File

@ -626,7 +626,7 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX)
/** /**
* This method initialized the main listener which actually runs injectors & ignition * This method initialized the main listener which actually runs injectors & ignition
*/ */
initMainEventListener(sharedLogger, engine); initMainEventListener(sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
} }
#endif /* EFI_ENGINE_CONTROL */ #endif /* EFI_ENGINE_CONTROL */

View File

@ -357,7 +357,7 @@ static ALWAYS_INLINE void handleFuel(const bool limitedFuel, uint32_t trgEventIn
efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#3"); efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#3");
efiAssertVoid(trgEventIndex < engine->engineCycleEventCount, "handleFuel/event index"); efiAssertVoid(trgEventIndex < engine->engineCycleEventCount, "handleFuel/event index");
if (!isInjectionEnabled(engineConfiguration) || limitedFuel) { if (!isInjectionEnabled(PASS_ENGINE_PARAMETER_SIGNATURE) || limitedFuel) {
return; return;
} }
if (engine->isCylinderCleanupMode) { if (engine->isCylinderCleanupMode) {
@ -535,7 +535,7 @@ static void showMainInfo(Engine *engine) {
#endif #endif
} }
void initMainEventListener(Logging *sharedLogger, Engine *engine) { void initMainEventListener(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
logger = sharedLogger; logger = sharedLogger;
efiAssertVoid(engine!=NULL, "null engine"); efiAssertVoid(engine!=NULL, "null engine");
initSparkLogic(logger); initSparkLogic(logger);
@ -545,7 +545,7 @@ void initMainEventListener(Logging *sharedLogger, Engine *engine) {
addConsoleActionP("maininfo", (VoidPtr) showMainInfo, engine); addConsoleActionP("maininfo", (VoidPtr) showMainInfo, engine);
printMsg(logger, "initMainLoop: %d", currentTimeMillis()); printMsg(logger, "initMainLoop: %d", currentTimeMillis());
if (!isInjectionEnabled(engine->engineConfiguration)) if (!isInjectionEnabled(PASS_ENGINE_PARAMETER_SIGNATURE))
printMsg(logger, "!!!!!!!!!!!!!!!!!!! injection disabled"); printMsg(logger, "!!!!!!!!!!!!!!!!!!! injection disabled");
#endif #endif

View File

@ -15,7 +15,7 @@
#include "event_registry.h" #include "event_registry.h"
#include "engine.h" #include "engine.h"
void initMainEventListener(Logging *sharedLogger, Engine *engine); void initMainEventListener(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex DECLARE_ENGINE_PARAMETER_SUFFIX); void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex DECLARE_ENGINE_PARAMETER_SUFFIX);
int isIgnitionTimingError(void); int isIgnitionTimingError(void);

View File

@ -21,9 +21,9 @@ IgnitionEventList::IgnitionEventList() {
isReady = false; isReady = false;
} }
int isInjectionEnabled(engine_configuration_s *engineConfiguration) { int isInjectionEnabled(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
// todo: is this worth a method? should this be inlined? // todo: is this worth a method? should this be inlined?
return engineConfiguration->isInjectionEnabled; return CONFIG(isInjectionEnabled);
} }
int isIgnitionTimingError(void) { int isIgnitionTimingError(void) {

View File

@ -10,7 +10,7 @@
#include "engine.h" #include "engine.h"
int isInjectionEnabled(engine_configuration_s *engineConfiguration); int isInjectionEnabled(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void handleSpark(bool limitedSpark, uint32_t trgEventIndex, int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); void handleSpark(bool limitedSpark, uint32_t trgEventIndex, int rpm DECLARE_ENGINE_PARAMETER_SUFFIX);
void initSparkLogic(Logging *sharedLogger); void initSparkLogic(Logging *sharedLogger);
void turnSparkPinHigh(IgnitionEvent *event); void turnSparkPinHigh(IgnitionEvent *event);