extracting macro

This commit is contained in:
rusefi 2018-02-03 10:48:35 -05:00
parent 66afbe6489
commit 349aca993d
5 changed files with 5 additions and 8 deletions

View File

@ -506,7 +506,7 @@ void prepareShapes(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX); void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX);
void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_SUFFIX); void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_SUFFIX);
void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_SIGNATURE); void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void assertEngineReference(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void validateConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE); void validateConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
#endif /* H_ENGINE_H_ */ #endif /* H_ENGINE_H_ */

View File

@ -1282,7 +1282,7 @@ void applyNonPersistentConfiguration(Logging * logger DECLARE_ENGINE_PARAMETER_S
scheduleMsg(logger, "applyNonPersistentConfiguration()"); scheduleMsg(logger, "applyNonPersistentConfiguration()");
#endif #endif
assertEngineReference(PASS_ENGINE_PARAMETER_SIGNATURE); assertEngineReference();
#if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) #if EFI_ENGINE_CONTROL || defined(__DOXYGEN__)
engine->triggerCentral.triggerShape.initializeTriggerShape(logger PASS_ENGINE_PARAMETER_SUFFIX); engine->triggerCentral.triggerShape.initializeTriggerShape(logger PASS_ENGINE_PARAMETER_SUFFIX);

View File

@ -555,8 +555,3 @@ void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_SUFFIX) {
void setFlatInjectorLag(float value DECLARE_ENGINE_PARAMETER_SUFFIX) { void setFlatInjectorLag(float value DECLARE_ENGINE_PARAMETER_SUFFIX) {
setArrayValues(engineConfiguration->injector.battLagCorr, VBAT_INJECTOR_CURVE_SIZE, value); setArrayValues(engineConfiguration->injector.battLagCorr, VBAT_INJECTOR_CURVE_SIZE, value);
} }
// todo: make this a macro
void assertEngineReference(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
efiAssertVoid(engine != NULL, "engine is NULL");
}

View File

@ -16,6 +16,8 @@
void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_SUFFIX); void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_SUFFIX);
#define assertEngineReference() efiAssertVoid(engine != NULL, "engine is NULL")
#if EFI_ENABLE_ASSERTS #if EFI_ENABLE_ASSERTS
#define assertAngleRange(angle, msg) if(angle > 10000000 || angle < -10000000) { firmwareError(ERROR_ANGLE_RANGE, "angle range %s %.2f", msg, angle);angle = 0;} #define assertAngleRange(angle, msg) if(angle > 10000000 || angle < -10000000) { firmwareError(ERROR_ANGLE_RANGE, "angle range %s %.2f", msg, angle);angle = 0;}

View File

@ -156,7 +156,7 @@ static void scheduleReboot(void) {
void runRusEfi(void) { void runRusEfi(void) {
efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 512, "init s"); efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 512, "init s");
assertEngineReference(PASS_ENGINE_PARAMETER_SIGNATURE); assertEngineReference();
initIntermediateLoggingBuffer(); initIntermediateLoggingBuffer();
initErrorHandling(); initErrorHandling();