From 7296593448e24c4b07f6ff899c5c01c25cd8b3aa Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 16 Nov 2021 01:15:29 -0800 Subject: [PATCH] remove engine pointer passing (#3556) * some * more * more * the last?! --- firmware/bootloader/src/main.cpp | 4 +- .../hellen/hellen-nb1/board_configuration.cpp | 2 +- .../hellen121nissan/board_configuration.cpp | 2 +- .../hellen121vag/board_configuration.cpp | 6 +- .../hellen/hellen128/board_configuration.cpp | 2 +- .../hellen154hyundai/board_configuration.cpp | 2 +- .../board_configuration.cpp | 2 +- .../hellen/hellen72/board_configuration.cpp | 2 +- .../hellen/hellen81/board_configuration.cpp | 2 +- .../hellen88bmw/board_configuration.cpp | 2 +- .../microrusefi/board_configuration.cpp | 2 +- .../boards/prometheus/board_configuration.cpp | 6 +- .../boards/proteus/board_configuration.cpp | 2 +- .../subaru_eg33/board_configuration.cpp | 4 +- firmware/config/engines/GY6_139QMB.cpp | 14 +- firmware/config/engines/GY6_139QMB.h | 2 +- firmware/config/engines/bmw_m73.cpp | 16 +- firmware/config/engines/bmw_m73.h | 10 +- firmware/config/engines/bmw_m73_mre.cpp | 4 +- firmware/config/engines/bmw_n73.cpp | 2 +- firmware/config/engines/bmw_n73.h | 2 +- .../config/engines/chevrolet_camaro_4.cpp | 6 +- firmware/config/engines/chevrolet_camaro_4.h | 2 +- .../config/engines/citroenBerlingoTU3JP.cpp | 8 +- .../config/engines/citroenBerlingoTU3JP.h | 2 +- firmware/config/engines/custom_engine.cpp | 64 ++-- firmware/config/engines/custom_engine.h | 40 +-- firmware/config/engines/dodge_neon.cpp | 18 +- firmware/config/engines/dodge_neon.h | 6 +- firmware/config/engines/dodge_ram.cpp | 4 +- firmware/config/engines/dodge_ram.h | 2 +- firmware/config/engines/engine_template.cpp | 4 +- firmware/config/engines/engine_template.h | 2 +- .../config/engines/ford_1995_inline_6.cpp | 6 +- firmware/config/engines/ford_1995_inline_6.h | 2 +- firmware/config/engines/ford_aspire.cpp | 14 +- firmware/config/engines/ford_aspire.h | 2 +- firmware/config/engines/ford_festiva.cpp | 14 +- firmware/config/engines/ford_festiva.h | 2 +- firmware/config/engines/honda_600.cpp | 14 +- firmware/config/engines/honda_600.h | 2 +- firmware/config/engines/honda_accord.cpp | 10 +- firmware/config/engines/honda_accord.h | 4 +- firmware/config/engines/honda_k_dbc.cpp | 4 +- firmware/config/engines/honda_k_dbc.h | 4 +- firmware/config/engines/hyundai.cpp | 4 +- firmware/config/engines/hyundai.h | 4 +- firmware/config/engines/m111.cpp | 2 +- firmware/config/engines/m111.h | 2 +- firmware/config/engines/mazda_miata.cpp | 10 +- firmware/config/engines/mazda_miata.h | 4 +- firmware/config/engines/mazda_miata_1_6.cpp | 62 ++-- firmware/config/engines/mazda_miata_1_6.h | 14 +- .../config/engines/mazda_miata_base_maps.cpp | 10 +- .../config/engines/mazda_miata_base_maps.h | 12 +- .../engines/mazda_miata_custom_hunchback.cpp | 6 +- firmware/config/engines/mazda_miata_na8.cpp | 4 +- firmware/config/engines/mazda_miata_na8.h | 2 +- firmware/config/engines/mazda_miata_vvt.cpp | 78 ++--- firmware/config/engines/mazda_miata_vvt.h | 26 +- firmware/config/engines/me7pnp.cpp | 12 +- firmware/config/engines/me7pnp.h | 2 +- firmware/config/engines/mercedes.cpp | 16 +- firmware/config/engines/mercedes.h | 6 +- firmware/config/engines/mitsubishi.cpp | 6 +- firmware/config/engines/mitsubishi.h | 2 +- firmware/config/engines/nissan_primera.cpp | 6 +- firmware/config/engines/nissan_primera.h | 4 +- firmware/config/engines/nissan_vq.cpp | 8 +- firmware/config/engines/nissan_vq.h | 6 +- firmware/config/engines/sachs.cpp | 8 +- firmware/config/engines/sachs.h | 2 +- firmware/config/engines/subaru.cpp | 6 +- firmware/config/engines/subaru.h | 8 +- firmware/config/engines/test_engine.cpp | 24 +- firmware/config/engines/test_engine.h | 10 +- firmware/config/engines/toyota_jzs147.cpp | 14 +- firmware/config/engines/toyota_jzs147.h | 4 +- firmware/config/engines/vw.cpp | 22 +- firmware/config/engines/vw.h | 10 +- firmware/config/engines/vw_b6.cpp | 6 +- firmware/config/engines/vw_b6.h | 2 +- firmware/console/binary/tooth_logger.cpp | 20 +- firmware/console/binary/tooth_logger.h | 8 +- firmware/console/binary/tunerstudio.cpp | 10 +- firmware/console/binary/tunerstudio.h | 6 +- firmware/console/status_loop.cpp | 30 +- firmware/console/status_loop.h | 2 +- firmware/controllers/actuators/ac_control.cpp | 6 +- firmware/controllers/actuators/ac_control.h | 4 +- .../actuators/alternator_controller.cpp | 2 +- .../controllers/actuators/boost_control.cpp | 6 +- .../controllers/actuators/boost_control.h | 4 +- firmware/controllers/actuators/dc_motors.cpp | 2 +- firmware/controllers/actuators/dc_motors.h | 2 +- .../actuators/electronic_throttle.cpp | 48 +-- .../actuators/electronic_throttle.h | 24 +- .../controllers/actuators/fan_control.cpp | 8 +- firmware/controllers/actuators/fan_control.h | 2 +- .../controllers/actuators/gppwm/gppwm.cpp | 4 +- firmware/controllers/actuators/gppwm/gppwm.h | 2 +- .../actuators/gppwm/gppwm_channel.cpp | 8 +- .../controllers/actuators/idle_hardware.cpp | 12 +- .../controllers/actuators/idle_hardware.h | 4 +- .../controllers/actuators/idle_thread.cpp | 64 ++-- firmware/controllers/actuators/idle_thread.h | 14 +- firmware/controllers/actuators/vvt.cpp | 4 +- .../controllers/algo/accel_enrichment.cpp | 16 +- firmware/controllers/algo/accel_enrichment.h | 12 +- firmware/controllers/algo/advance_map.cpp | 22 +- firmware/controllers/algo/advance_map.h | 10 +- .../algo/airmass/alphan_airmass.cpp | 1 - .../algo/airmass/speed_density_airmass.cpp | 2 +- .../algo/airmass/speed_density_base.cpp | 2 +- .../algo/airmass/speed_density_base.h | 2 +- .../algo/defaults/default_base_engine.cpp | 6 +- .../algo/defaults/default_cranking.cpp | 2 +- .../algo/defaults/default_fuel.cpp | 32 +- .../algo/defaults/default_ignition.cpp | 16 +- firmware/controllers/algo/defaults/defaults.h | 8 +- firmware/controllers/algo/dynoview.cpp | 10 +- firmware/controllers/algo/dynoview.h | 8 +- firmware/controllers/algo/engine.cpp | 94 +++--- firmware/controllers/algo/engine.h | 36 +-- firmware/controllers/algo/engine2.cpp | 44 +-- .../controllers/algo/engine_configuration.cpp | 286 +++++++++--------- .../controllers/algo/engine_configuration.h | 32 +- firmware/controllers/algo/engine_parts.h | 6 +- firmware/controllers/algo/engine_state.h | 6 +- firmware/controllers/algo/event_registry.h | 6 +- .../controllers/algo/fuel/fuel_computer.cpp | 4 +- .../controllers/algo/fuel/fuel_computer.h | 2 +- firmware/controllers/algo/fuel_math.cpp | 70 ++--- firmware/controllers/algo/fuel_math.h | 30 +- firmware/controllers/algo/launch_control.cpp | 4 +- firmware/controllers/algo/launch_control.h | 2 +- firmware/controllers/algo/wall_fuel.cpp | 2 +- firmware/controllers/algo/wall_fuel.h | 2 +- firmware/controllers/buttonshift.cpp | 10 +- firmware/controllers/buttonshift.h | 4 +- firmware/controllers/can/can_dash.cpp | 4 +- firmware/controllers/can/can_rx.cpp | 2 +- firmware/controllers/can/can_rx.h | 2 +- firmware/controllers/can/can_vss.cpp | 2 +- firmware/controllers/can/obd2.cpp | 2 +- firmware/controllers/core/engine_ptr.h | 39 +-- firmware/controllers/core/fsio_core.cpp | 8 +- firmware/controllers/core/fsio_core.h | 4 +- firmware/controllers/core/fsio_impl.cpp | 32 +- firmware/controllers/core/fsio_impl.h | 18 +- firmware/controllers/engine_controller.cpp | 80 ++--- firmware/controllers/engine_controller.h | 22 +- .../controllers/engine_controller_misc.cpp | 24 +- .../controllers/engine_cycle/aux_valves.cpp | 10 +- .../controllers/engine_cycle/aux_valves.h | 4 +- .../engine_cycle/fuel_schedule.cpp | 18 +- .../engine_cycle/high_pressure_fuel_pump.cpp | 2 +- .../engine_cycle/high_pressure_fuel_pump.h | 2 +- .../controllers/engine_cycle/knock_logic.cpp | 4 +- .../engine_cycle/main_trigger_callback.cpp | 84 +++-- .../engine_cycle/main_trigger_callback.h | 12 +- .../engine_cycle/map_averaging.cpp | 26 +- .../controllers/engine_cycle/map_averaging.h | 6 +- .../engine_cycle/rpm_calculator.cpp | 40 ++- .../controllers/engine_cycle/rpm_calculator.h | 10 +- .../controllers/engine_cycle/spark_logic.cpp | 67 ++-- .../controllers/engine_cycle/spark_logic.h | 11 +- firmware/controllers/flash_main.cpp | 12 +- .../controllers/gauges/lcd_controller.cpp | 4 +- firmware/controllers/gauges/tachometer.cpp | 4 +- firmware/controllers/gauges/tachometer.h | 4 +- firmware/controllers/gear_controller.cpp | 4 +- firmware/controllers/gear_controller.h | 2 +- firmware/controllers/lua/lua_hooks.cpp | 8 +- .../controllers/math/closed_loop_fuel.cpp | 14 +- firmware/controllers/math/closed_loop_fuel.h | 4 +- .../math/closed_loop_fuel_cell.cpp | 6 +- .../controllers/math/closed_loop_fuel_cell.h | 6 +- firmware/controllers/math/engine_math.cpp | 56 ++-- firmware/controllers/math/engine_math.h | 26 +- firmware/controllers/math/speed_density.cpp | 6 +- firmware/controllers/math/speed_density.h | 4 +- firmware/controllers/sensors/allsensors.cpp | 8 +- firmware/controllers/sensors/allsensors.h | 6 +- firmware/controllers/sensors/ego.cpp | 16 +- firmware/controllers/sensors/ego.h | 8 +- firmware/controllers/sensors/map.cpp | 22 +- firmware/controllers/sensors/map.h | 6 +- firmware/controllers/sensors/vr_pwm.cpp | 8 +- firmware/controllers/sensors/vr_pwm.h | 4 +- firmware/controllers/settings.cpp | 66 ++-- firmware/controllers/settings.h | 2 +- firmware/controllers/start_stop.cpp | 2 +- firmware/controllers/start_stop.h | 2 +- firmware/controllers/system/efi_gpio.cpp | 6 +- firmware/controllers/system/efi_gpio.h | 8 +- .../trigger/decoders/trigger_chrysler.cpp | 2 +- .../trigger/decoders/trigger_nissan.cpp | 8 +- .../trigger/decoders/trigger_structure.cpp | 16 +- .../trigger/decoders/trigger_structure.h | 6 +- .../controllers/trigger/trigger_central.cpp | 92 +++--- .../controllers/trigger/trigger_central.h | 24 +- .../controllers/trigger/trigger_decoder.cpp | 17 +- .../controllers/trigger/trigger_decoder.h | 13 +- .../trigger/trigger_emulator_algo.cpp | 24 +- .../trigger/trigger_emulator_algo.h | 10 +- firmware/development/engine_emulator.cpp | 6 +- firmware/development/engine_emulator.h | 2 +- firmware/development/hw_layer/poten.cpp | 2 +- firmware/development/hw_layer/poten.h | 2 +- firmware/development/logic_analyzer.cpp | 2 +- firmware/development/logic_analyzer.h | 2 +- firmware/global.h | 3 - firmware/globalaccess.h | 2 - firmware/hw_layer/adc/adc_inputs.cpp | 10 +- firmware/hw_layer/algo/adc_math.h | 4 +- .../digital_input/trigger/trigger_input.cpp | 18 +- .../digital_input/trigger/trigger_input.h | 12 +- .../trigger/trigger_input_comp.cpp | 8 +- firmware/hw_layer/drivers/can/can_hw.cpp | 6 +- firmware/hw_layer/drivers/can/can_hw.h | 6 +- firmware/hw_layer/drivers/lcd/HD44780.cpp | 2 +- .../hw_layer/drivers/serial/serial_hw.cpp | 6 +- firmware/hw_layer/drivers/serial/serial_hw.h | 6 +- firmware/hw_layer/hardware.cpp | 54 ++-- firmware/hw_layer/hardware.h | 10 +- firmware/hw_layer/io_pins.cpp | 8 +- firmware/hw_layer/io_pins.h | 8 +- firmware/hw_layer/pin_repository.cpp | 16 +- firmware/hw_layer/pin_repository.h | 6 +- firmware/hw_layer/sensors/accelerometer.cpp | 8 +- firmware/hw_layer/sensors/accelerometer.h | 8 +- firmware/hw_layer/sensors/cj125.cpp | 56 ++-- firmware/hw_layer/sensors/cj125.h | 8 +- firmware/hw_layer/sensors/cj125_logic.cpp | 18 +- firmware/hw_layer/sensors/cj125_logic.h | 14 +- firmware/hw_layer/sensors/gps_uart.cpp | 2 +- firmware/hw_layer/sensors/hip9011_logic.cpp | 4 +- firmware/hw_layer/trigger_input_adc.cpp | 8 +- firmware/init/init.h | 32 +- firmware/init/sensor/init_aux.cpp | 2 +- firmware/init/sensor/init_baro.cpp | 2 +- firmware/init/sensor/init_flex.cpp | 2 +- firmware/init/sensor/init_fluid_pressure.cpp | 2 +- firmware/init/sensor/init_fuel_level.cpp | 2 +- firmware/init/sensor/init_lambda.cpp | 6 +- firmware/init/sensor/init_maf.cpp | 2 +- firmware/init/sensor/init_map.cpp | 14 +- firmware/init/sensor/init_sensors.cpp | 62 ++-- firmware/init/sensor/init_thermistors.cpp | 2 +- firmware/init/sensor/init_tps.cpp | 2 +- .../sensor/init_turbocharger_speed_sensor.cpp | 4 +- firmware/init/sensor/init_vbatt.cpp | 2 +- .../init/sensor/init_vehicle_speed_sensor.cpp | 4 +- firmware/rusefi.cpp | 14 +- .../main/java/com/rusefi/tools/tune/TS2C.java | 2 +- .../ui/livedata/LiveDataParserTest.java | 2 +- simulator/simulator/boards.cpp | 4 +- simulator/simulator/rusEfiFunctionalTest.cpp | 10 +- unit_tests/boards.cpp | 4 +- unit_tests/engine_test_helper.cpp | 52 ++-- unit_tests/engine_test_helper.h | 2 +- unit_tests/global.h | 2 - unit_tests/logicdata_csv_reader.cpp | 5 +- .../injection_mode_transition.cpp | 2 +- .../tests/ignition_injection/test_fuelCut.cpp | 14 +- .../ignition_injection/test_fuel_computer.cpp | 4 +- .../ignition_injection/test_fuel_map.cpp | 34 +-- .../ignition_injection/test_fuel_math.cpp | 38 +-- .../test_fuel_wall_wetting.cpp | 12 +- .../test_ignition_scheduling.cpp | 2 +- .../test_injector_model.cpp | 20 +- .../ignition_injection/test_multispark.cpp | 48 +-- .../test_one_cylinder_logic.cpp | 2 +- .../test_startOfCrankingPrimingPulse.cpp | 2 +- unit_tests/tests/lua/test_lua_with_engine.cpp | 2 +- unit_tests/tests/sensor/test_cj125.cpp | 6 +- unit_tests/tests/sensor/test_sensor_init.cpp | 30 +- .../test_turbocharger_speed_converter.cpp | 2 +- .../sensor/test_vehicle_speed_converter.cpp | 2 +- unit_tests/tests/test_accel_enrichment.cpp | 62 ++-- unit_tests/tests/test_boost.cpp | 10 +- unit_tests/tests/test_change_engine_type.cpp | 6 +- unit_tests/tests/test_dynoview.cpp | 8 +- unit_tests/tests/test_engine_math.cpp | 18 +- unit_tests/tests/test_etb.cpp | 40 +-- unit_tests/tests/test_fan_control.cpp | 24 +- unit_tests/tests/test_gppwm.cpp | 2 +- unit_tests/tests/test_hardware_reinit.cpp | 4 +- unit_tests/tests/test_idle_controller.cpp | 32 +- unit_tests/tests/test_knock.cpp | 4 +- unit_tests/tests/test_launch.cpp | 24 +- unit_tests/tests/test_limp.cpp | 8 +- unit_tests/tests/test_logic_expression.cpp | 26 +- unit_tests/tests/test_sensors.cpp | 8 +- unit_tests/tests/test_start_stop.cpp | 12 +- unit_tests/tests/test_stft.cpp | 6 +- unit_tests/tests/test_tacho.cpp | 2 +- unit_tests/tests/test_tunerstudio.cpp | 6 +- unit_tests/tests/test_vvt.cpp | 4 +- unit_tests/tests/trigger/test_2jz_vvt.cpp | 6 +- .../tests/trigger/test_all_triggers.cpp | 2 +- .../tests/trigger/test_cam_vvt_input.cpp | 24 +- .../trigger/test_fasterEngineSpinningUp.cpp | 16 +- .../trigger/test_injection_scheduling.cpp | 2 +- unit_tests/tests/trigger/test_issue_898.cpp | 1 - .../tests/trigger/test_miata_na_tdc.cpp | 2 +- .../tests/trigger/test_nissan_vq_vvt.cpp | 15 +- .../tests/trigger/test_override_gaps.cpp | 2 +- unit_tests/tests/trigger/test_quad_cam.cpp | 18 +- .../trigger/test_real_cranking_miata_na6.cpp | 2 +- .../tests/trigger/test_real_volkswagen.cpp | 4 +- .../tests/trigger/test_rpm_multiplier.cpp | 2 +- .../tests/trigger/test_symmetrical_crank.cpp | 2 +- .../tests/trigger/test_trigger_decoder.cpp | 76 ++--- .../tests/trigger/test_trigger_noiseless.cpp | 8 +- 316 files changed, 2053 insertions(+), 2125 deletions(-) diff --git a/firmware/bootloader/src/main.cpp b/firmware/bootloader/src/main.cpp index 01ccc60fe3..ff3bfea6b0 100644 --- a/firmware/bootloader/src/main.cpp +++ b/firmware/bootloader/src/main.cpp @@ -36,10 +36,10 @@ int main(void) { halInit(); chSysInit(); // set base pin configuration based on the board - setDefaultBasePins(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultBasePins(); /* at the moment SD card is not needed by bootloader // set SD card configuration also - setDefaultSdCardParameters(PASS_ENGINE_PARAMETER_SIGNATURE); + setDefaultSdCardParameters(); */ // start UART diff --git a/firmware/config/boards/hellen/hellen-nb1/board_configuration.cpp b/firmware/config/boards/hellen/hellen-nb1/board_configuration.cpp index 303f6cf3fe..ea094a674a 100644 --- a/firmware/config/boards/hellen/hellen-nb1/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen-nb1/board_configuration.cpp @@ -142,7 +142,7 @@ void setBoardDefaultConfiguration(void) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.firingOrder = FO_1_3_4_2; diff --git a/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp b/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp index 648ed98acc..5015a148f7 100644 --- a/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp @@ -153,7 +153,7 @@ void setBoardDefaultConfiguration(void) { engineConfiguration->vvtCamSensorUseRise = true; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); // Bosch VQ40 VR56 VK56 0280158007 diff --git a/firmware/config/boards/hellen/hellen121vag/board_configuration.cpp b/firmware/config/boards/hellen/hellen121vag/board_configuration.cpp index 1b1bd6d7f4..d06fd62120 100644 --- a/firmware/config/boards/hellen/hellen121vag/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen121vag/board_configuration.cpp @@ -141,7 +141,7 @@ void setBoardDefaultConfiguration(void) { engineConfiguration->etbIo[0].controlPin = GPIOA_8; // ETB_EN out_io12 CONFIG(etb_use_two_wires) = true; - setBoschVAGETB(PASS_CONFIG_PARAMETER_SIGNATURE); + setBoschVAGETB(); engineConfiguration->isSdCardEnabled = true; @@ -170,7 +170,7 @@ void setBoardDefaultConfiguration(void) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); strcpy(CONFIG(engineMake), ENGINE_MAKE_VAG); strcpy(CONFIG(engineCode), "base"); @@ -182,7 +182,7 @@ void setBoardDefaultConfiguration(void) { engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; engineConfiguration->injectionMode = IM_SIMULTANEOUS;//IM_BATCH;// IM_SEQUENTIAL; - setHellenDefaultVrThresholds(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellenDefaultVrThresholds(); engineConfiguration->vrThreshold[0].pin = H144_OUT_PWM6; hellenWbo(); } diff --git a/firmware/config/boards/hellen/hellen128/board_configuration.cpp b/firmware/config/boards/hellen/hellen128/board_configuration.cpp index 7427cc5e95..86b3894f6f 100644 --- a/firmware/config/boards/hellen/hellen128/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen128/board_configuration.cpp @@ -150,7 +150,7 @@ void setBoardDefaultConfiguration(void) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.firingOrder = FO_1_3_4_2; diff --git a/firmware/config/boards/hellen/hellen154hyundai/board_configuration.cpp b/firmware/config/boards/hellen/hellen154hyundai/board_configuration.cpp index 2dabf9af98..09f32567a8 100644 --- a/firmware/config/boards/hellen/hellen154hyundai/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen154hyundai/board_configuration.cpp @@ -164,7 +164,7 @@ void setBoardDefaultConfiguration(void) { engineConfiguration->vvtCamSensorUseRise = true; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure; diff --git a/firmware/config/boards/hellen/hellen64_miataNA6_94/board_configuration.cpp b/firmware/config/boards/hellen/hellen64_miataNA6_94/board_configuration.cpp index b0d862b75b..dde6858efb 100644 --- a/firmware/config/boards/hellen/hellen64_miataNA6_94/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen64_miataNA6_94/board_configuration.cpp @@ -147,7 +147,7 @@ void setBoardDefaultConfiguration(void) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.firingOrder = FO_1_3_4_2; diff --git a/firmware/config/boards/hellen/hellen72/board_configuration.cpp b/firmware/config/boards/hellen/hellen72/board_configuration.cpp index 8e3d88bdd1..a963f4f630 100644 --- a/firmware/config/boards/hellen/hellen72/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen72/board_configuration.cpp @@ -156,7 +156,7 @@ void setBoardDefaultConfiguration(void) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.firingOrder = FO_1_3_4_2; diff --git a/firmware/config/boards/hellen/hellen81/board_configuration.cpp b/firmware/config/boards/hellen/hellen81/board_configuration.cpp index d976301301..01558860c6 100644 --- a/firmware/config/boards/hellen/hellen81/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen81/board_configuration.cpp @@ -158,7 +158,7 @@ void setBoardDefaultConfiguration(void) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.firingOrder = FO_1_3_4_2; diff --git a/firmware/config/boards/hellen/hellen88bmw/board_configuration.cpp b/firmware/config/boards/hellen/hellen88bmw/board_configuration.cpp index 96d3d458fc..58e242ba77 100644 --- a/firmware/config/boards/hellen/hellen88bmw/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen88bmw/board_configuration.cpp @@ -151,7 +151,7 @@ void setBoardDefaultConfiguration(void) { engineConfiguration->vvtCamSensorUseRise = true; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); // Bosch VQ40 VR56 VK56 0280158007 diff --git a/firmware/config/boards/microrusefi/board_configuration.cpp b/firmware/config/boards/microrusefi/board_configuration.cpp index 8938b174c6..33592b4947 100644 --- a/firmware/config/boards/microrusefi/board_configuration.cpp +++ b/firmware/config/boards/microrusefi/board_configuration.cpp @@ -226,7 +226,7 @@ void setBoardDefaultConfiguration(void) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.firingOrder = FO_1_3_4_2; diff --git a/firmware/config/boards/prometheus/board_configuration.cpp b/firmware/config/boards/prometheus/board_configuration.cpp index 3a1861ac65..62358f7b0a 100644 --- a/firmware/config/boards/prometheus/board_configuration.cpp +++ b/firmware/config/boards/prometheus/board_configuration.cpp @@ -17,11 +17,11 @@ static bool is469 = false; #endif -static void setPrometheusDefaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void setPrometheusDefaults() { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR/*FOUR_STROKE_CAM_SENSOR*/); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; //engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); CONFIG(useCicPidForIdle) = true; @@ -250,7 +250,7 @@ void setBoardDefaultConfiguration(void) { //!!!!!!!!!!!!!!! #if 1 - setPrometheusDefaults(PASS_ENGINE_PARAMETER_SIGNATURE); + setPrometheusDefaults(); #endif //!!!!!!!!!!!!!!!!!!! diff --git a/firmware/config/boards/proteus/board_configuration.cpp b/firmware/config/boards/proteus/board_configuration.cpp index f1ce4746a7..6d5bb6fd41 100644 --- a/firmware/config/boards/proteus/board_configuration.cpp +++ b/firmware/config/boards/proteus/board_configuration.cpp @@ -188,7 +188,7 @@ void setBoardDefaultConfiguration(void) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->specs.cylindersCount = 8; engineConfiguration->specs.firingOrder = FO_1_8_7_2_6_5_4_3; diff --git a/firmware/config/boards/subaru_eg33/board_configuration.cpp b/firmware/config/boards/subaru_eg33/board_configuration.cpp index 432e75931e..1917f36c20 100644 --- a/firmware/config/boards/subaru_eg33/board_configuration.cpp +++ b/firmware/config/boards/subaru_eg33/board_configuration.cpp @@ -254,9 +254,9 @@ void setBoardDefaultConfiguration(void) { //engineConfiguration->isEngineChartEnabled = false; if (engineConfiguration->fuelAlgorithm == LM_REAL_MAF) - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); if (engineConfiguration->fuelAlgorithm == LM_ALPHA_N) - setAlgorithm(LM_ALPHA_N PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_ALPHA_N); } /* Schematic RefDef DA3 */ diff --git a/firmware/config/engines/GY6_139QMB.cpp b/firmware/config/engines/GY6_139QMB.cpp index 7b62ea6bfa..06db98146d 100644 --- a/firmware/config/engines/GY6_139QMB.cpp +++ b/firmware/config/engines/GY6_139QMB.cpp @@ -16,19 +16,19 @@ #include "GY6_139QMB.h" #include "advance_map.h" -static void setDefault139qmbMaps(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setTimingLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); - setTimingRpmBin(1000, 11000 PASS_CONFIG_PARAMETER_SUFFIX); +static void setDefault139qmbMaps() { + setTimingLoadBin(1.2, 4.4); + setTimingRpmBin(1000, 11000); } -void setGy6139qmbDefaultEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefault139qmbMaps(PASS_CONFIG_PARAMETER_SIGNATURE); +void setGy6139qmbDefaultEngineConfiguration() { + setDefault139qmbMaps(); // engineConfiguration->map.sensor.type = MT_3V_SENSOR; - setEgoSensor(ES_NarrowBand PASS_CONFIG_PARAMETER_SUFFIX); + setEgoSensor(ES_NarrowBand); engineConfiguration->rpmHardLimit = 9000; engineConfiguration->cranking.rpm = 1100; - setTargetRpmCurve(2000 PASS_CONFIG_PARAMETER_SUFFIX); + setTargetRpmCurve(2000); engineConfiguration->analogInputDividerCoefficient = 1; engineConfiguration->globalTriggerAngleOffset = 45; engineConfiguration->sensorChartMode = SC_MAP; diff --git a/firmware/config/engines/GY6_139QMB.h b/firmware/config/engines/GY6_139QMB.h index 36137a5bb9..e39a0e750c 100644 --- a/firmware/config/engines/GY6_139QMB.h +++ b/firmware/config/engines/GY6_139QMB.h @@ -9,5 +9,5 @@ #pragma once #include "engine_configuration.h" -void setGy6139qmbDefaultEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setGy6139qmbDefaultEngineConfiguration(); diff --git a/firmware/config/engines/bmw_m73.cpp b/firmware/config/engines/bmw_m73.cpp index c952d86f7b..8b4d3939b2 100644 --- a/firmware/config/engines/bmw_m73.cpp +++ b/firmware/config/engines/bmw_m73.cpp @@ -84,7 +84,7 @@ #include "proteus_meta.h" #endif -void m73engine(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void m73engine() { // 13641435991 injector engineConfiguration->injector.flow = 180; // cc/min, who knows if this number is real - no good source of info @@ -116,15 +116,15 @@ void m73engine(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // BMW_M73_F -void setBMW_M73_TwoCoilUnitTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setBMW_M73_TwoCoilUnitTest() { // twoCoil configuration without unit tests ETB setup drama - m73engine(PASS_CONFIG_PARAMETER_SIGNATURE); + m73engine(); } // BMW_M73_M // set engine_type 24 -void setEngineBMW_M73_Manhattan(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - m73engine(PASS_CONFIG_PARAMETER_SIGNATURE); +void setEngineBMW_M73_Manhattan() { + m73engine(); /** Nucleo boards - first step is to confirm that I can blink via each pin @@ -242,8 +242,8 @@ GPIOA_6 * */ #if HW_PROTEUS -void setEngineBMW_M73_Proteus(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - m73engine(PASS_CONFIG_PARAMETER_SIGNATURE); +void setEngineBMW_M73_Proteus() { + m73engine(); // 12 injectors defined in boards/proteus/board_configuration.cpp // set_analog_input_pin pps pa4 @@ -274,7 +274,7 @@ void setEngineBMW_M73_Proteus(DECLARE_CONFIG_PARAMETER_SIGNATURE) { CONFIG(startStopButtonPin) = GPIOE_12; CONFIG(startStopButtonMode) = PI_PULLUP; - setProteusHitachiEtbDefaults(PASS_CONFIG_PARAMETER_SIGNATURE); + setProteusHitachiEtbDefaults(); CONFIG(useETBforIdleControl) = true; } diff --git a/firmware/config/engines/bmw_m73.h b/firmware/config/engines/bmw_m73.h index 1825c2bb64..1f6b3ff952 100644 --- a/firmware/config/engines/bmw_m73.h +++ b/firmware/config/engines/bmw_m73.h @@ -9,12 +9,12 @@ #include "engine_configuration.h" -void m73engine(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void m73engine(); -void setBMW_M73_TwoCoilUnitTest(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setBMW_M73_TwoCoilUnitTest(); // set engine_type 24 -void setEngineBMW_M73_Manhattan(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setEngineBMW_M73_Manhattan(); // set engine_type 63 -void setEngineBMW_M73_Proteus(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setEngineBMW_M73_Proteus(); -void setEngineBMW_M73_microRusEfi(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setEngineBMW_M73_microRusEfi(); diff --git a/firmware/config/engines/bmw_m73_mre.cpp b/firmware/config/engines/bmw_m73_mre.cpp index 03934eb6a3..3abe19c7b3 100644 --- a/firmware/config/engines/bmw_m73_mre.cpp +++ b/firmware/config/engines/bmw_m73_mre.cpp @@ -65,7 +65,7 @@ #include "bmw_m73.h" #include "fsio_impl.h" -void setEngineBMW_M73_microRusEfi(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setEngineBMW_M73_microRusEfi() { // 13641435991 injector engineConfiguration->injector.flow = 180; // cc/min, who knows if this number is real - no good source of info @@ -84,7 +84,7 @@ void setEngineBMW_M73_microRusEfi(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // enable ETB // set_rpn_expression 8 "0" - // TODO LUA setFsio(7, GPIOC_8, "0" PASS_CONFIG_PARAMETER_SUFFIX); + // TODO LUA setFsio(7, GPIOC_8, "0"); CONFIG(debugMode) = DBG_ELECTRONIC_THROTTLE_PID; diff --git a/firmware/config/engines/bmw_n73.cpp b/firmware/config/engines/bmw_n73.cpp index d5b5d4681d..57712404aa 100644 --- a/firmware/config/engines/bmw_n73.cpp +++ b/firmware/config/engines/bmw_n73.cpp @@ -7,7 +7,7 @@ #include "bmw_n73.h" -void setEngineProteusBMW_N73_GDI(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setEngineProteusBMW_N73_GDI() { } diff --git a/firmware/config/engines/bmw_n73.h b/firmware/config/engines/bmw_n73.h index 0f2d307d43..588fbc4718 100644 --- a/firmware/config/engines/bmw_n73.h +++ b/firmware/config/engines/bmw_n73.h @@ -9,4 +9,4 @@ #include "engine_configuration.h" -void setEngineProteusBMW_N73_GDI(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setEngineProteusBMW_N73_GDI(); diff --git a/firmware/config/engines/chevrolet_camaro_4.cpp b/firmware/config/engines/chevrolet_camaro_4.cpp index 2826b93889..272fd47f7c 100644 --- a/firmware/config/engines/chevrolet_camaro_4.cpp +++ b/firmware/config/engines/chevrolet_camaro_4.cpp @@ -13,11 +13,11 @@ #include "chevrolet_camaro_4.h" #include "custom_engine.h" -void setCamaro4(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setCamaro4() { + setFrankensoConfiguration(); - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->specs.displacement = 5.7; engineConfiguration->specs.cylindersCount = 8; diff --git a/firmware/config/engines/chevrolet_camaro_4.h b/firmware/config/engines/chevrolet_camaro_4.h index 7e05f5efa6..21d8afbf64 100644 --- a/firmware/config/engines/chevrolet_camaro_4.h +++ b/firmware/config/engines/chevrolet_camaro_4.h @@ -8,5 +8,5 @@ #pragma once #include "engine_configuration.h" -void setCamaro4(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setCamaro4(); diff --git a/firmware/config/engines/citroenBerlingoTU3JP.cpp b/firmware/config/engines/citroenBerlingoTU3JP.cpp index 0bf7b6d7a3..c4a0307235 100644 --- a/firmware/config/engines/citroenBerlingoTU3JP.cpp +++ b/firmware/config/engines/citroenBerlingoTU3JP.cpp @@ -14,8 +14,8 @@ #include "citroenBerlingoTU3JP.h" #include "custom_engine.h" -void setCitroenBerlingoTU3JPConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setCitroenBerlingoTU3JPConfiguration() { + setDefaultFrankensoConfiguration(); /** * Base engine setting @@ -37,8 +37,8 @@ void setCitroenBerlingoTU3JPConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * Algorithm Alpha-N setting */ - setAlgorithm(LM_ALPHA_N PASS_CONFIG_PARAMETER_SUFFIX); - setTimingRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_ALPHA_N); + setTimingRpmBin(800, 7000); /** * Outputs diff --git a/firmware/config/engines/citroenBerlingoTU3JP.h b/firmware/config/engines/citroenBerlingoTU3JP.h index b1e2f32fc2..d1006f1035 100644 --- a/firmware/config/engines/citroenBerlingoTU3JP.h +++ b/firmware/config/engines/citroenBerlingoTU3JP.h @@ -8,5 +8,5 @@ #pragma once #include "engine_configuration.h" -void setCitroenBerlingoTU3JPConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setCitroenBerlingoTU3JPConfiguration(); diff --git a/firmware/config/engines/custom_engine.cpp b/firmware/config/engines/custom_engine.cpp index a22f8f1dff..c38e0e8433 100644 --- a/firmware/config/engines/custom_engine.cpp +++ b/firmware/config/engines/custom_engine.cpp @@ -83,8 +83,8 @@ void disableLCD(engine_configuration_s *engineConfiguration) { } // todo: should this be part of more default configurations? -void setFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setFrankensoConfiguration() { + setDefaultFrankensoConfiguration(); engineConfiguration->trigger.type = TT_ONE_PLUS_ONE; setFrankenso_01_LCD(engineConfiguration); @@ -149,7 +149,7 @@ void setFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->injectionPins[3] = EFI_INJECTOR_PIN3; // #4 #endif /* EFI_INJECTOR_PIN3 */ - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); #if EFI_PWM_TESTER engineConfiguration->injectionPins[4] = GPIOC_8; // #5 @@ -195,8 +195,8 @@ void setFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * set engine_type 49 */ -void setFrankensoBoardTestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setFrankensoBoardTestConfiguration() { + setFrankensoConfiguration(); engineConfiguration->triggerSimulatorFrequency = 300; engineConfiguration->cranking.rpm = 100; @@ -244,8 +244,8 @@ void setFrankensoBoardTestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // ETB_BENCH_ENGINE // set engine_type 58 -void setEtbTestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setEtbTestConfiguration() { + setDefaultFrankensoConfiguration(); // VAG test ETB // set tps_min 54 engineConfiguration->tpsMin = 54; @@ -272,8 +272,8 @@ void setEtbTestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { CONFIG(etbIo[0].controlPin) = GPIOE_14; #if EFI_ELECTRONIC_THROTTLE_BODY - setBoschVNH2SP30Curve(PASS_CONFIG_PARAMETER_SIGNATURE); -// setDefaultEtbParameters(PASS_CONFIG_PARAMETER_SIGNATURE); + setBoschVNH2SP30Curve(); +// setDefaultEtbParameters(); #endif /* EFI_ELECTRONIC_THROTTLE_BODY */ engineConfiguration->tps1_1AdcChannel = EFI_ADC_2; // PA2 @@ -299,7 +299,7 @@ void setEtbTestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } #if EFI_UNIT_TEST -void setIssue898(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setIssue898() { engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA; } #endif /* EFI_UNIT_TEST */ @@ -307,7 +307,7 @@ void setIssue898(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // TLE8888_BENCH_ENGINE // todo: remove this? this was used to play with "secret" red boards prior to MRE reality // set engine_type 59 -void setTle8888TestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setTle8888TestConfiguration() { engineConfiguration->specs.cylindersCount = 8; engineConfiguration->specs.firingOrder = FO_1_8_7_2_6_5_4_3; engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; @@ -347,7 +347,7 @@ void setTle8888TestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // SF PF11 #if defined(STM32_HAS_GPIOF) && STM32_HAS_GPIOF #if EFI_FSIO - // todo lua setFsio(14, GPIOF_13, "1" PASS_CONFIG_PARAMETER_SUFFIX); + // todo lua setFsio(14, GPIOF_13, "1"); #endif /* EFI_FSIO */ CONFIG(etbIo[0].directionPin1) = GPIOF_15; CONFIG(etbIo[0].directionPin2) = GPIOF_14; @@ -363,7 +363,7 @@ void setTle8888TestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // IN2 PE4 // SF PE3 #if EFI_FSIO - // todo lua setFsio(15, GPIOE_6, "1" PASS_CONFIG_PARAMETER_SUFFIX); + // todo lua setFsio(15, GPIOE_6, "1"); #endif CONFIG(etbIo[0].directionPin1) = GPIOE_2; CONFIG(etbIo[0].directionPin2) = GPIOE_4; @@ -398,7 +398,7 @@ void setTle8888TestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * This configuration is used for MRE board Quality Assurance validation * todo: inline */ -static void mreBoardOldTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void mreBoardOldTest() { #if (BOARD_TLE8888_COUNT > 0) engineConfiguration->debugMode = DBG_TLE8888; @@ -515,7 +515,7 @@ static void mreBoardOldTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * PROTEUS_QC_TEST_BOARD * set engine_type 42 */ -void proteusBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void proteusBoardTest() { engineConfiguration->specs.cylindersCount = 12; engineConfiguration->specs.firingOrder = FO_1_2_3_4_5_6_7_8_9_10_11_12; engineConfiguration->triggerSimulatorFrequency = 600; @@ -562,11 +562,11 @@ void proteusBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #endif // EFI_PROD_CODE - setProteusHitachiEtbDefaults(PASS_CONFIG_PARAMETER_SIGNATURE); + setProteusHitachiEtbDefaults(); } #endif // HW_PROTEUS -void mreBCM(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void mreBCM() { for (int i = 0; i < MAX_CYLINDER_COUNT;i++) { engineConfiguration->ignitionPins[i] = GPIO_UNASSIGNED; engineConfiguration->injectionPins[i] = GPIO_UNASSIGNED; @@ -576,7 +576,7 @@ void mreBCM(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } -void mreSecondaryCan(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void mreSecondaryCan() { engineConfiguration->tps1_1AdcChannel = EFI_ADC_NONE; engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE; engineConfiguration->clt.adcChannel = EFI_ADC_NONE; @@ -622,8 +622,8 @@ end * MRE_BOARD_NEW_TEST * set engine_type 31 */ -void mreBoardNewTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - mreBoardOldTest(PASS_CONFIG_PARAMETER_SIGNATURE); +void mreBoardNewTest() { + mreBoardOldTest(); engineConfiguration->specs.cylindersCount = 12; engineConfiguration->specs.firingOrder = FO_1_2_3_4_5_6_7_8_9_10_11_12; @@ -689,7 +689,7 @@ void mreBoardNewTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } -void setBoschHDEV_5_injectors(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setBoschHDEV_5_injectors() { // This is the configuration for bosch HDEV 5 injectors // all times in microseconds/us CONFIG(mc33_hvolt) = 65; @@ -707,10 +707,10 @@ void setBoschHDEV_5_injectors(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * set engine_type 108 */ -void setVrThresholdTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setVrThresholdTest() { engineConfiguration->trigger.type = TT_HONDA_1_24; - setHellenDefaultVrThresholds(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellenDefaultVrThresholds(); engineConfiguration->vrThreshold[0].pin = GPIOB_4; engineConfiguration->triggerInputPins[0] = GPIOA_5; @@ -720,7 +720,7 @@ void setVrThresholdTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * set engine_type 107 */ -void setRotary(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setRotary() { engineConfiguration->specs.cylindersCount = 2; engineConfiguration->specs.firingOrder = FO_1_2; @@ -743,7 +743,7 @@ void setRotary(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * set engine_type 103 */ -void setTest33816EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setTest33816EngineConfiguration() { // grey // default spi3mosiPin PB5 @@ -782,16 +782,16 @@ void setTest33816EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { CONFIG(isSdCardEnabled) = false; CONFIG(mc33816spiDevice) = SPI_DEVICE_3; - setBoschHDEV_5_injectors(PASS_CONFIG_PARAMETER_SIGNATURE); + setBoschHDEV_5_injectors(); } -void setHellen72etb(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellen72etb() { CONFIG(etbIo[0].directionPin1) = GPIOC_6; CONFIG(etbIo[0].directionPin2) = GPIOC_7; engineConfiguration->etb_use_two_wires = true; } -void setHellenDefaultVrThresholds(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellenDefaultVrThresholds() { for (int i = 0;ivrThreshold[i].rpmBins, 600 / RPM_1_BYTE_PACKING_MULT, 7000 / RPM_1_BYTE_PACKING_MULT, 100 / RPM_1_BYTE_PACKING_MULT); setLinearCurve(engineConfiguration->vrThreshold[i].values, PACK_PERCENT_BYTE_MULT * 0.6, PACK_PERCENT_BYTE_MULT * 1.2, PACK_PERCENT_BYTE_MULT * 0.1); @@ -801,7 +801,7 @@ void setHellenDefaultVrThresholds(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * set engine_type 6 */ -void proteusHarley(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void proteusHarley() { strcpy(engineConfiguration->scriptSettingName[0], "compReleaseRpm"); engineConfiguration->scriptSetting[0] = 300; strcpy(engineConfiguration->scriptSettingName[1], "compReleaseDur"); @@ -833,7 +833,7 @@ end #endif } -void proteusLuaDemo(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void proteusLuaDemo() { #if HW_PROTEUS engineConfiguration->tpsMin = 889; engineConfiguration->tpsMax = 67; @@ -959,7 +959,7 @@ end } #if HW_HELLEN -void setHellen144LedPins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellen144LedPins() { #ifdef EFI_COMMUNICATION_PIN engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN; #else @@ -969,7 +969,7 @@ void setHellen144LedPins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->warningLedPin = GPIOE_8; } -void setHellen176LedPins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellen176LedPins() { #ifdef EFI_COMMUNICATION_PIN engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN; #else diff --git a/firmware/config/engines/custom_engine.h b/firmware/config/engines/custom_engine.h index 72399eeffa..f4ee989319 100644 --- a/firmware/config/engines/custom_engine.h +++ b/firmware/config/engines/custom_engine.h @@ -8,35 +8,35 @@ #pragma once #include "engine_configuration.h" -void setHellenDefaultVrThresholds(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHellenDefaultVrThresholds(); +void setFrankensoConfiguration(); void setFrankenso_01_LCD(engine_configuration_s *engineConfiguration); void disableLCD(engine_configuration_s *engineConfiguration); void runSchedulingPrecisionTestIfNeeded(void); -void setFrankensoBoardTestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setEtbTestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setTle8888TestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setFrankensoBoardTestConfiguration(); +void setEtbTestConfiguration(); +void setTle8888TestConfiguration(); -void setIssue898(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setTestQuadCam(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setIssue898(); +void setTestQuadCam(); -void mreBoardNewTest(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void mreSecondaryCan(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void mreBCM(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void mreBoardNewTest(); +void mreSecondaryCan(); +void mreBCM(); /** * PROTEUS_QC_TEST_BOARD * set engine_type 42 */ -void proteusBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void proteusLuaDemo(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void proteusHarley(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void proteusBoardTest(); +void proteusLuaDemo(); +void proteusHarley(); -void setTest33816EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setBoschHDEV_5_injectors(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setHellen72etb(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setRotary(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setVrThresholdTest(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setTest33816EngineConfiguration(); +void setBoschHDEV_5_injectors(); +void setHellen72etb(); +void setRotary(); +void setVrThresholdTest(); -void setHellen144LedPins(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setHellen176LedPins(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHellen144LedPins(); +void setHellen176LedPins(); diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index e80f8fb7a4..b3320dbca5 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -82,8 +82,8 @@ static const uint8_t veDodgeNeon2003Table[16][16] = { }; -void setDodgeNeon1995EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setDodgeNeon1995EngineConfiguration() { + setDefaultFrankensoConfiguration(); engineConfiguration->trigger.type = TT_DODGE_NEON_1995; @@ -113,7 +113,7 @@ void setDodgeNeon1995EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * that's 1995 config */ - setWholeTimingTable_d(12 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable_d(12); // set cranking_injection_mode 0 engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; @@ -180,8 +180,8 @@ void setDodgeNeon1995EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->clt.config = {0, 30, 100, 32500, 7550, 700, 2700}; } -void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setDodgeNeonNGCEngineConfiguration() { + setDefaultFrankensoConfiguration(); engineConfiguration->trigger.type = TT_DODGE_NEON_2003_CAM; setFrankenso_01_LCD(engineConfiguration); setFrankenso0_1_joystick(engineConfiguration); @@ -206,7 +206,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * fuel 2.8 * */ - //setWholeTimingTable_d(12 PASS_CONFIG_PARAMETER_SUFFIX); + //setWholeTimingTable_d(12); #if IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT copyTable(config->ignitionTable, fromODB); #endif @@ -226,9 +226,9 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setLinearCurve(config->ignitionLoadBins, 20, 120, 1); - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); - setFuelTablesLoadBin(20, 120 PASS_CONFIG_PARAMETER_SUFFIX); + setFuelTablesLoadBin(20, 120); engineConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED; @@ -359,7 +359,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // engineConfiguration->tunerStudioSerialSpeed = 9600; engineConfiguration->tunerStudioSerialSpeed = 19200; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); //temp engineConfiguration->alternatorControlPin = GPIOD_5; engineConfiguration->targetVBatt = 14.0; diff --git a/firmware/config/engines/dodge_neon.h b/firmware/config/engines/dodge_neon.h index 1db07f5e1f..6622ce46d7 100644 --- a/firmware/config/engines/dodge_neon.h +++ b/firmware/config/engines/dodge_neon.h @@ -9,12 +9,12 @@ #pragma once #include "engine_configuration.h" -void setDodgeNeon1995EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setDodgeNeon1995EngineConfiguration(); -void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setDodgeNeonNGCEngineConfiguration(); /** * testing or broken CAM sensor option */ -void setDodgeNeonNGCEngineConfigurationCrankBased(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setDodgeNeonNGCEngineConfigurationCrankBased(); diff --git a/firmware/config/engines/dodge_ram.cpp b/firmware/config/engines/dodge_ram.cpp index 8e53b9d143..f434bc1a22 100644 --- a/firmware/config/engines/dodge_ram.cpp +++ b/firmware/config/engines/dodge_ram.cpp @@ -12,8 +12,8 @@ #include "dodge_ram.h" #include "custom_engine.h" -void setDodgeRam1996(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setDodgeRam1996() { + setFrankensoConfiguration(); setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR); engineConfiguration->trigger.type = TT_DODGE_RAM; diff --git a/firmware/config/engines/dodge_ram.h b/firmware/config/engines/dodge_ram.h index ea24f98a52..cf0d54e969 100644 --- a/firmware/config/engines/dodge_ram.h +++ b/firmware/config/engines/dodge_ram.h @@ -9,5 +9,5 @@ #include "engine_configuration.h" -void setDodgeRam1996(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setDodgeRam1996(); diff --git a/firmware/config/engines/engine_template.cpp b/firmware/config/engines/engine_template.cpp index 7e83ae5516..634a74d7a6 100644 --- a/firmware/config/engines/engine_template.cpp +++ b/firmware/config/engines/engine_template.cpp @@ -8,6 +8,6 @@ #include "engine_template.h" #include "custom_engine.h" -void setEngineTemplateConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setEngineTemplateConfiguration() { + setFrankensoConfiguration(); } diff --git a/firmware/config/engines/engine_template.h b/firmware/config/engines/engine_template.h index f19a308101..8e42cd38ee 100644 --- a/firmware/config/engines/engine_template.h +++ b/firmware/config/engines/engine_template.h @@ -9,4 +9,4 @@ #include "engine_configuration.h" -void setEngineTemplateConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setEngineTemplateConfiguration(); diff --git a/firmware/config/engines/ford_1995_inline_6.cpp b/firmware/config/engines/ford_1995_inline_6.cpp index 44b5ddf35f..8dd39e8f63 100644 --- a/firmware/config/engines/ford_1995_inline_6.cpp +++ b/firmware/config/engines/ford_1995_inline_6.cpp @@ -18,8 +18,8 @@ /** * @brief Default values for persistent properties */ -void setFordInline6(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setFordInline6() { + setDefaultFrankensoConfiguration(); engineConfiguration->specs.cylindersCount = 6; @@ -35,7 +35,7 @@ void setFordInline6(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * 0.5ms dweel time just to be sure it would fit within camshaft revolution, dwell is not controlled by us anyway */ - setConstantDwell(0.5 PASS_CONFIG_PARAMETER_SUFFIX); + setConstantDwell(0.5); /** * We treat the trigger as 6/0 toothed wheel diff --git a/firmware/config/engines/ford_1995_inline_6.h b/firmware/config/engines/ford_1995_inline_6.h index dfc6cc1a89..383011f1fd 100644 --- a/firmware/config/engines/ford_1995_inline_6.h +++ b/firmware/config/engines/ford_1995_inline_6.h @@ -9,4 +9,4 @@ #include "engine_configuration.h" -void setFordInline6(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setFordInline6(); diff --git a/firmware/config/engines/ford_aspire.cpp b/firmware/config/engines/ford_aspire.cpp index d994fc8b53..83c651e425 100644 --- a/firmware/config/engines/ford_aspire.cpp +++ b/firmware/config/engines/ford_aspire.cpp @@ -37,17 +37,17 @@ static const int8_t default_aspire_timing_table[16][16] = { }; #endif -static void setDefaultAspireMaps(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setTimingLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); - setTimingRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); +static void setDefaultAspireMaps() { + setTimingLoadBin(1.2, 4.4); + setTimingRpmBin(800, 7000); #if IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT copyTable(config->ignitionTable, default_aspire_timing_table); #endif } -void setFordAspireEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setFordAspireEngineConfiguration() { + setDefaultFrankensoConfiguration(); engineConfiguration->tpsMin = 100; engineConfiguration->tpsMax = 750; @@ -73,13 +73,13 @@ void setFordAspireEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->globalTriggerAngleOffset = 175; engineConfiguration->extraInjectionOffset = 54 + 360; - setDefaultAspireMaps(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultAspireMaps(); // set_cranking_rpm 550 engineConfiguration->cranking.rpm = 550; // set cranking_timing_angle 37 engineConfiguration->crankingTimingAngle = -37; - setSingleCoilDwell(PASS_CONFIG_PARAMETER_SIGNATURE); + setSingleCoilDwell(); engineConfiguration->ignitionMode = IM_ONE_COIL; setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR); engineConfiguration->useOnlyRisingEdgeForTrigger = true; diff --git a/firmware/config/engines/ford_aspire.h b/firmware/config/engines/ford_aspire.h index 870790edcb..42ad9678b0 100644 --- a/firmware/config/engines/ford_aspire.h +++ b/firmware/config/engines/ford_aspire.h @@ -13,4 +13,4 @@ #include "engine_configuration.h" -void setFordAspireEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setFordAspireEngineConfiguration(); diff --git a/firmware/config/engines/ford_festiva.cpp b/firmware/config/engines/ford_festiva.cpp index 375894e692..6bf1e4134a 100644 --- a/firmware/config/engines/ford_festiva.cpp +++ b/firmware/config/engines/ford_festiva.cpp @@ -64,8 +64,8 @@ static const uint8_t racingFestivaVeTable[16][16] = { * pin 1I/W9 - extra +5v * set engine_type 14 */ -void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - common079721_2351(PASS_CONFIG_PARAMETER_SIGNATURE); +void setFordEscortGt() { + common079721_2351(); engineConfiguration->trigger.type = TT_MAZDA_DOHC_1_4; @@ -76,7 +76,7 @@ void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->globalFuelCorrection = 0.75; engineConfiguration->specs.displacement = 1.839; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); static const float veRpmBins[] = { @@ -123,14 +123,14 @@ void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) { */ engineConfiguration->map.sensor.hwChannel = EFI_ADC_4; - setEgoSensor(ES_Innovate_MTX_L PASS_CONFIG_PARAMETER_SUFFIX); + setEgoSensor(ES_Innovate_MTX_L); engineConfiguration->afr.hwChannel = EFI_ADC_2; // Frankenso analog #5 // PA2 // set_idle_position 10 engineConfiguration->manIdlePosition = 10; engineConfiguration->crankingIACposition = 65; - setWholeIatCorrTimingTable(0 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeIatCorrTimingTable(0); // set global_trigger_offset_angle -37 @@ -141,10 +141,10 @@ void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->crankingTimingAngle = 3; setLinearCurve(config->ignitionLoadBins, 20, 105, 5); - setWholeTimingTable_d(10 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable_d(10); setTable(config->lambdaTable, 0.92f); - setSingleCoilDwell(PASS_CONFIG_PARAMETER_SIGNATURE); + setSingleCoilDwell(); engineConfiguration->ignitionMode = IM_ONE_COIL; engineConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN; diff --git a/firmware/config/engines/ford_festiva.h b/firmware/config/engines/ford_festiva.h index aa58c9de3c..3e504db35b 100644 --- a/firmware/config/engines/ford_festiva.h +++ b/firmware/config/engines/ford_festiva.h @@ -8,4 +8,4 @@ #pragma once #include "engine_configuration.h" -void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setFordEscortGt(); diff --git a/firmware/config/engines/honda_600.cpp b/firmware/config/engines/honda_600.cpp index b232ea0884..11a7ebb995 100644 --- a/firmware/config/engines/honda_600.cpp +++ b/firmware/config/engines/honda_600.cpp @@ -34,17 +34,17 @@ static const uint8_t default_custom_timing_table[16][16] = { }; #endif -static void setDefaultCustomMaps(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setTimingLoadBin(0,100 PASS_CONFIG_PARAMETER_SUFFIX); - setTimingRpmBin(0,7000 PASS_CONFIG_PARAMETER_SUFFIX); +static void setDefaultCustomMaps() { + setTimingLoadBin(0,100); + setTimingRpmBin(0,7000); #if IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT copyTable(config->ignitionTable, default_custom_timing_table); #endif } -void setHonda600(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setHonda600() { + setDefaultFrankensoConfiguration(); engineConfiguration->trigger.type = TT_HONDA_CBR_600; engineConfiguration->fuelAlgorithm = LM_ALPHA_N; @@ -128,8 +128,8 @@ void setHonda600(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->injectionPins[2] = GPIOB_7; // #3 engineConfiguration->injectionPins[3] = GPIOB_8; // #4 - setDefaultCustomMaps(PASS_CONFIG_PARAMETER_SIGNATURE); - setAlgorithm(LM_ALPHA_N PASS_CONFIG_PARAMETER_SUFFIX); + setDefaultCustomMaps(); + setAlgorithm(LM_ALPHA_N); engineConfiguration->injectionPins[4] = GPIO_UNASSIGNED; engineConfiguration->injectionPins[5] = GPIO_UNASSIGNED; diff --git a/firmware/config/engines/honda_600.h b/firmware/config/engines/honda_600.h index ec46c70dd8..a03824aedc 100644 --- a/firmware/config/engines/honda_600.h +++ b/firmware/config/engines/honda_600.h @@ -8,5 +8,5 @@ #pragma once #include "engine_configuration.h" -void setHonda600(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHonda600(); diff --git a/firmware/config/engines/honda_accord.cpp b/firmware/config/engines/honda_accord.cpp index f58db7dec5..89070237a8 100644 --- a/firmware/config/engines/honda_accord.cpp +++ b/firmware/config/engines/honda_accord.cpp @@ -33,7 +33,7 @@ #include "advance_map.h" #include "custom_engine.h" -static void setHondaAccordConfigurationCommon(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setHondaAccordConfigurationCommon() { engineConfiguration->map.sensor.type = MT_DENSO183; // set ignition_mode 0 @@ -51,9 +51,9 @@ static void setHondaAccordConfigurationCommon(DECLARE_CONFIG_PARAMETER_SIGNATURE // Keihin 06164-P0A-A00 engineConfiguration->injector.flow = 248; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); - buildTimingMap(35 PASS_CONFIG_PARAMETER_SUFFIX); + buildTimingMap(35); /** * 18K Ohm @ -20C @@ -159,7 +159,7 @@ static void setHondaAccordConfigurationCommon(DECLARE_CONFIG_PARAMETER_SIGNATURE engineConfiguration->idle.solenoidFrequency = 500; } -void setHondaAccordConfiguration1_24(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHondaAccordConfiguration1_24() { engineConfiguration->trigger.type = TT_HONDA_1_24; - setHondaAccordConfigurationCommon(PASS_CONFIG_PARAMETER_SIGNATURE); + setHondaAccordConfigurationCommon(); } diff --git a/firmware/config/engines/honda_accord.h b/firmware/config/engines/honda_accord.h index 49c6606b2b..34832fc295 100644 --- a/firmware/config/engines/honda_accord.h +++ b/firmware/config/engines/honda_accord.h @@ -8,7 +8,7 @@ #pragma once #include "engine_configuration.h" -void setHondaAccordConfigurationTwoWires(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHondaAccordConfigurationTwoWires(); /** * https://technet.ff-squad.com/wiring.obd1.htm @@ -18,4 +18,4 @@ void setHondaAccordConfigurationTwoWires(DECLARE_CONFIG_PARAMETER_SIGNATURE); * middle = 4 total, 1/cyl * inner CID cylinder ID = 1 total, 1/cam */ -void setHondaAccordConfiguration1_24(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHondaAccordConfiguration1_24(); diff --git a/firmware/config/engines/honda_k_dbc.cpp b/firmware/config/engines/honda_k_dbc.cpp index ed1f4b565c..21a17fe956 100644 --- a/firmware/config/engines/honda_k_dbc.cpp +++ b/firmware/config/engines/honda_k_dbc.cpp @@ -15,7 +15,7 @@ * K24A4 engine * PROTEUS_HONDA_ELEMENT_2003 */ -void setProteusHondaElement2003(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setProteusHondaElement2003() { engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.firingOrder = FO_1_3_4_2; engineConfiguration->specs.displacement = 2.4; @@ -90,6 +90,6 @@ void setProteusHondaElement2003(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #endif // HW_PROTEUS } -void setProteusHondaOBD2A(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setProteusHondaOBD2A() { } diff --git a/firmware/config/engines/honda_k_dbc.h b/firmware/config/engines/honda_k_dbc.h index 4a6a226f20..fcf116dc14 100644 --- a/firmware/config/engines/honda_k_dbc.h +++ b/firmware/config/engines/honda_k_dbc.h @@ -9,5 +9,5 @@ #include "engine_configuration.h" -void setProteusHondaElement2003(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setProteusHondaOBD2A(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setProteusHondaElement2003(); +void setProteusHondaOBD2A(); diff --git a/firmware/config/engines/hyundai.cpp b/firmware/config/engines/hyundai.cpp index 04d9df8e09..32c1153886 100644 --- a/firmware/config/engines/hyundai.cpp +++ b/firmware/config/engines/hyundai.cpp @@ -8,7 +8,7 @@ #include "hyundai.h" #include "map.h" -void setGenesisCoupeBK1(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setGenesisCoupeBK1() { // 2010-2012 315cc at 43.5psi // fuel system is fixed pressure 55psi engineConfiguration->injector.flow = 354.19; // https://www.google.com/search?q=315*sqrt%2855%2F43.5%29 @@ -16,7 +16,7 @@ void setGenesisCoupeBK1(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } -void setGenesisCoupeBK2(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setGenesisCoupeBK2() { // 2013+ 450cc at 43.5 // fuel system is fixed pressure 85psi // flow rate P2 = flow rate P1 * sqrt(P2/P1) diff --git a/firmware/config/engines/hyundai.h b/firmware/config/engines/hyundai.h index fc0c1b6d6f..b73a12097a 100644 --- a/firmware/config/engines/hyundai.h +++ b/firmware/config/engines/hyundai.h @@ -9,6 +9,6 @@ #include "engine_configuration.h" -void setGenesisCoupeBK1(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setGenesisCoupeBK1(); -void setGenesisCoupeBK2(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setGenesisCoupeBK2(); diff --git a/firmware/config/engines/m111.cpp b/firmware/config/engines/m111.cpp index fc25ed5195..0170ce6fc0 100644 --- a/firmware/config/engines/m111.cpp +++ b/firmware/config/engines/m111.cpp @@ -8,6 +8,6 @@ #include "m111.h" -void setM111EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setM111EngineConfiguration() { } diff --git a/firmware/config/engines/m111.h b/firmware/config/engines/m111.h index e9b9289afd..bd8a44cfde 100644 --- a/firmware/config/engines/m111.h +++ b/firmware/config/engines/m111.h @@ -12,4 +12,4 @@ /** * set engine_type 68 */ -void setM111EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setM111EngineConfiguration(); diff --git a/firmware/config/engines/mazda_miata.cpp b/firmware/config/engines/mazda_miata.cpp index 532a605601..2d0435788f 100644 --- a/firmware/config/engines/mazda_miata.cpp +++ b/firmware/config/engines/mazda_miata.cpp @@ -73,7 +73,7 @@ static const uint8_t miataNA8_maf_advance_table[16][16] = { {/*0 engineLoad=1.2 +29, /*12 5760.0*/+28, /*13 6173.0*/+28, /*14 6586.0*/+27, /*15 7000.0*/+27 } }; #endif -static void commonMiataNa(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void commonMiataNa() { engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA; engineConfiguration->engineChartSize = 100; @@ -106,8 +106,8 @@ static void commonMiataNa(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setCommonNTCSensor(&engineConfiguration->iat, 2700); } -void common079721_2351(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void common079721_2351() { + setDefaultFrankensoConfiguration(); engineConfiguration->engineChartSize = 300; @@ -143,8 +143,8 @@ void common079721_2351(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * Tom tomiata, Frankenstein board */ -void setFrankensteinMiata1996(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - commonMiataNa(PASS_CONFIG_PARAMETER_SIGNATURE); +void setFrankensteinMiata1996() { + commonMiataNa(); engineConfiguration->specs.displacement = 1.839; #if IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT diff --git a/firmware/config/engines/mazda_miata.h b/firmware/config/engines/mazda_miata.h index ab5bfbe1b3..f41fc421b3 100644 --- a/firmware/config/engines/mazda_miata.h +++ b/firmware/config/engines/mazda_miata.h @@ -13,5 +13,5 @@ #include "engine_configuration.h" -void common079721_2351(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setFrankensteinMiata1996(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void common079721_2351(); +void setFrankensteinMiata1996(); diff --git a/firmware/config/engines/mazda_miata_1_6.cpp b/firmware/config/engines/mazda_miata_1_6.cpp index 65f2e35a36..f3b16d146f 100644 --- a/firmware/config/engines/mazda_miata_1_6.cpp +++ b/firmware/config/engines/mazda_miata_1_6.cpp @@ -24,7 +24,7 @@ static const float hardCodedmafDecodingBins[42] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.59 static const float hardCodedmafDecoding[256] = {570.0, 437.0, 351.5, 293.55078, 237.0, 186.0, 145.0, 116.0, 96.0, 78.84961, 65.549805, 56.049805, 48.0, 40.0, 33.25, 29.449951, 25.649902, 22.800049, 20.899902, 19.0, 17.100098, 16.149902, 13.775024, 12.824951, 11.400024, 10.449951, 9.5, 8.550049, 8.454956, 8.359985, 8.300049, 8.199951, 7.5999756, 7.125, 7.125, 7.125, 6.6500244, 6.6500244, 6.6500244, 6.6500244, 6.6500244, 6.6500244, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; /* Generated by TS2C on Fri Jul 31 14:02:18 EDT 2020*/ -static void setMafDecodingBins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setMafDecodingBins() { for (size_t i = 0; i < 42; i++) { config->mafDecodingBins[i] = hardCodedmafDecodingBins[i]; } @@ -60,7 +60,7 @@ static const uint8_t hardCodedveTable[16][16] = { }; /* Generated by TS2C on Sun Aug 02 10:02:25 EDT 2020*/ -static void setMapVeTable(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setMapVeTable() { copyArray(config->veLoadBins, hardCodedveLoadBins); copyArray(config->veRpmBins, hardCodedveRpmBins); copyTable(config->veTable, hardCodedveTable); @@ -91,7 +91,7 @@ static const uint8_t hardCodedVafveTable[16][16] = { }; /* Generated by TS2C on Tue Aug 11 21:13:28 EDT 2020*/ -static void setVafVeTable(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setVafVeTable() { copyArray(config->veLoadBins, hardCodedVafveLoadBins); copyArray(config->veRpmBins, hardCodedVafveRpmBins); copyTable(config->veTable, hardCodedVafveTable); @@ -122,7 +122,7 @@ static const uint8_t hardCodedVafignitionTable[16][16] = { }; /* Generated by TS2C on Tue Aug 11 21:13:28 EDT 2020*/ -static void setVafIgnitionTable(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setVafIgnitionTable() { copyArray(config->ignitionLoadBins, hardCodedVafignitionLoadBins); copyArray(config->ignitionRpmBins, hardCodedVafignitionRpmBins); copyTable(config->ignitionTable, hardCodedVafignitionTable); @@ -151,7 +151,7 @@ static const uint8_t mapBased16IgnitionTable[16][16] = { #endif -static void miataNAcommonEngineSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void miataNAcommonEngineSettings() { engineConfiguration->trigger.type = TT_MAZDA_MIATA_NA; engineConfiguration->useOnlyRisingEdgeForTrigger = false; engineConfiguration->specs.cylindersCount = 4; @@ -180,11 +180,11 @@ static void miataNAcommonEngineSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->manIdlePosition = 34; - miataNA_setCltIdleCorrBins(PASS_CONFIG_PARAMETER_SIGNATURE); - miataNA_setCltIdleRpmBins(PASS_CONFIG_PARAMETER_SIGNATURE); - miataNA_setIacCoastingBins(PASS_CONFIG_PARAMETER_SIGNATURE); - setMafDecodingBins(PASS_CONFIG_PARAMETER_SIGNATURE); - miataNA_setIgnitionTable(PASS_CONFIG_PARAMETER_SIGNATURE); + miataNA_setCltIdleCorrBins(); + miataNA_setCltIdleRpmBins(); + miataNA_setIacCoastingBins(); + setMafDecodingBins(); + miataNA_setIgnitionTable(); engineConfiguration->idle.solenoidFrequency = 160; engineConfiguration->ignitionMode = IM_WASTED_SPARK; @@ -192,7 +192,7 @@ static void miataNAcommonEngineSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->isFasterEngineSpinUpEnabled = true; - setMapVeTable(PASS_CONFIG_PARAMETER_SIGNATURE); + setMapVeTable(); engineConfiguration->idleMode = IM_AUTO; // below 20% this valve seems to be opening for fail-safe idle air @@ -246,7 +246,7 @@ static void miataNAcommonEngineSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->injectionMode = IM_BATCH; } -static void miataNAcommon(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void miataNAcommon() { engineConfiguration->idle.solenoidPin = GPIOB_9; // this W61 <> W61 jumper, pin 3W @@ -259,10 +259,10 @@ static void miataNAcommon(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * MIATA_NA6_MAP */ -void setMiataNA6_MAP_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); - setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); - miataNAcommonEngineSettings(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiataNA6_MAP_Frankenso() { + setDefaultFrankensoConfiguration(); + setFrankensoConfiguration(); + miataNAcommonEngineSettings(); engineConfiguration->isHip9011Enabled = false; @@ -310,11 +310,11 @@ void setMiataNA6_MAP_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // W58 PE4 A/C fan relay out #endif /* EFI_UNIT_TEST */ - miataNAcommon(PASS_CONFIG_PARAMETER_SIGNATURE); + miataNAcommon(); } -void setMiataNA6_VAF_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMiataNA6_MAP_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiataNA6_VAF_Frankenso() { + setMiataNA6_MAP_Frankenso(); /** * Stage 0 we only have OEM TPS switch @@ -327,14 +327,14 @@ void setMiataNA6_VAF_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * set engine_type 12 */ -void setMiataNA6_VAF_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMiataNA6_MAP_MRE(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiataNA6_VAF_MRE() { + setMiataNA6_MAP_MRE(); engineConfiguration->fuelAlgorithm = LM_REAL_MAF; - setVafVeTable(PASS_CONFIG_PARAMETER_SIGNATURE); - setVafIgnitionTable(PASS_CONFIG_PARAMETER_SIGNATURE); + setVafVeTable(); + setVafIgnitionTable(); #if (BOARD_TLE8888_COUNT > 0) @@ -345,8 +345,8 @@ void setMiataNA6_VAF_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * set engine_type 66 */ -void setMiataNA6_MAP_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - miataNAcommonEngineSettings(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiataNA6_MAP_MRE() { + miataNAcommonEngineSettings(); engineConfiguration->triggerInputPins[0] = GPIOA_5; engineConfiguration->triggerInputPins[1] = GPIOC_6; @@ -411,8 +411,8 @@ void setMiataNA6_MAP_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #endif /* BOARD_TLE8888_COUNT */ } -void setMiata94_MAP_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMiataNA6_MAP_MRE(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiata94_MAP_MRE() { + setMiataNA6_MAP_MRE(); #if (BOARD_TLE8888_COUNT > 0) // "35 - GP Out 1" @@ -428,8 +428,8 @@ void setMiata94_MAP_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } -void setHellenNA94(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - miataNAcommonEngineSettings(PASS_CONFIG_PARAMETER_SIGNATURE); +void setHellenNA94() { + miataNAcommonEngineSettings(); strcpy(CONFIG(engineCode), "94"); /** * http://miataturbo.wikidot.com/fuel-injectors @@ -449,7 +449,7 @@ void setHellenNA94(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->fan2Pin = GPIOD_9; // 3S - A/C Fan 94-95 } -void setHellenNA6(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - miataNAcommonEngineSettings(PASS_CONFIG_PARAMETER_SIGNATURE); +void setHellenNA6() { + miataNAcommonEngineSettings(); engineConfiguration->map.sensor.type = MT_MPX4250; } diff --git a/firmware/config/engines/mazda_miata_1_6.h b/firmware/config/engines/mazda_miata_1_6.h index 694236d848..3ed75a5ca3 100644 --- a/firmware/config/engines/mazda_miata_1_6.h +++ b/firmware/config/engines/mazda_miata_1_6.h @@ -12,24 +12,24 @@ /** * set engine_type 57 */ -void setMiataNA6_VAF_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiataNA6_VAF_Frankenso(); /** * set engine_type 41 */ -void setMiataNA6_MAP_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiataNA6_MAP_Frankenso(); -void setMiataNA6_VAF_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setMiataNA6_MAP_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiataNA6_VAF_MRE(); +void setMiataNA6_MAP_MRE(); /** * set engine_type 20 */ -void setMiata94_MAP_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiata94_MAP_MRE(); /** * set engine_type 34 */ -void setHellenNA6(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHellenNA6(); -void setHellenNA94(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHellenNA94(); diff --git a/firmware/config/engines/mazda_miata_base_maps.cpp b/firmware/config/engines/mazda_miata_base_maps.cpp index be2c363e73..d35929f0ca 100644 --- a/firmware/config/engines/mazda_miata_base_maps.cpp +++ b/firmware/config/engines/mazda_miata_base_maps.cpp @@ -12,7 +12,7 @@ static const float hardCodedcrankingFuelBins[8] = {-20.0, -10.0, 3.6799927, 22.7 static const float hardCodedcrankingFuelCoef[8] = {2.7999878, 2.2000122, 1.6900024, 1.2900009, 1.199997, 1.050003, 1.0, 1.0}; /* Generated by TS2C on Thu Jul 30 00:03:20 EDT 2020*/ -void miataNA_setCrankingFuelBins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void miataNA_setCrankingFuelBins() { copyArray(config->crankingFuelBins, hardCodedcrankingFuelBins); copyArray(config->crankingFuelCoef, hardCodedcrankingFuelCoef); } @@ -22,7 +22,7 @@ static const float hardCodediacCoastingBins[16] = {-40.0, -30.0, -20.0, -10.0, 0 static const float hardCodediacCoasting[16] = {40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0}; /* Generated by TS2C on Fri Jul 31 14:02:18 EDT 2020*/ -void miataNA_setIacCoastingBins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void miataNA_setIacCoastingBins() { copyArray(engineConfiguration->iacCoastingBins, hardCodediacCoastingBins); copyArray(engineConfiguration->iacCoasting, hardCodediacCoasting); } @@ -32,7 +32,7 @@ static const float hardCodedcltIdleCorrBins[16] = {-40.0, -30.0, -20.0, -10.0, 0 static const float hardCodedcltIdleCorr[16] = {1.4000015, 1.3199997, 1.2600021, 1.2099991, 1.1699982, 1.050003, 1.0299988, 1.0199966, 1.0299988, 1.0199966, 1.0100021, 1.0, 0.9900017, 0.9900017, 0.9900017, 0.9900017}; /* Generated by TS2C on Fri Jul 31 14:02:18 EDT 2020*/ -void miataNA_setCltIdleCorrBins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void miataNA_setCltIdleCorrBins() { copyArray(config->cltIdleCorrBins, hardCodedcltIdleCorrBins); copyArray(config->cltIdleCorr, hardCodedcltIdleCorr); } @@ -42,7 +42,7 @@ static const float hardCodedcltIdleRpmBins[16] = {-40.0, -30.0, -20.0, 0.0, 10.0 static const float hardCodedcltIdleRpm[16] = {1180.0, 1150.0, 1130.0, 1110.0, 1090.0, 1070.0, 1050.0, 1020.0, 990.0, 970.0, 950.0, 950.0, 950.0, 950.0, 950.0, 950.0}; /* Generated by TS2C on Fri Jul 31 14:02:18 EDT 2020*/ -void miataNA_setCltIdleRpmBins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void miataNA_setCltIdleRpmBins() { copyArray(engineConfiguration->cltIdleRpmBins, hardCodedcltIdleRpmBins); copyArray(engineConfiguration->cltIdleRpm, hardCodedcltIdleRpm); } @@ -72,7 +72,7 @@ static const uint8_t hardCodedignitionTable[16][16] = { }; /* Generated by TS2C on Sun Aug 02 11:58:01 EDT 2020*/ -void miataNA_setIgnitionTable(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void miataNA_setIgnitionTable() { copyArray(config->ignitionLoadBins, hardCodedignitionLoadBins); copyArray(config->ignitionRpmBins, hardCodedignitionRpmBins); copyTable(config->ignitionTable, hardCodedignitionTable); diff --git a/firmware/config/engines/mazda_miata_base_maps.h b/firmware/config/engines/mazda_miata_base_maps.h index fa1c626a34..9823924323 100644 --- a/firmware/config/engines/mazda_miata_base_maps.h +++ b/firmware/config/engines/mazda_miata_base_maps.h @@ -9,9 +9,9 @@ #include "global.h" -void miataNA_setCrankingCycleBins(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void miataNA_setCrankingFuelBins(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void miataNA_setIacCoastingBins(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void miataNA_setCltIdleCorrBins(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void miataNA_setCltIdleRpmBins(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void miataNA_setIgnitionTable(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void miataNA_setCrankingCycleBins(); +void miataNA_setCrankingFuelBins(); +void miataNA_setIacCoastingBins(); +void miataNA_setCltIdleCorrBins(); +void miataNA_setCltIdleRpmBins(); +void miataNA_setIgnitionTable(); diff --git a/firmware/config/engines/mazda_miata_custom_hunchback.cpp b/firmware/config/engines/mazda_miata_custom_hunchback.cpp index 9468150bb0..daa42d82c2 100644 --- a/firmware/config/engines/mazda_miata_custom_hunchback.cpp +++ b/firmware/config/engines/mazda_miata_custom_hunchback.cpp @@ -81,8 +81,8 @@ static const float mazda_miata_nb2_targetLambdaLoadBins[FUEL_LOAD_COUNT] = {10.0 90.0, 100.0, 110.0, 120.0, 130.0, 140.0, 150.0, 160.0}; -void setMazdaMiata2003EngineConfigurationNaFuelRail(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMazdaMiata2003EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMazdaMiata2003EngineConfigurationNaFuelRail() { + setMazdaMiata2003EngineConfiguration(); copyTable(config->scriptTable1, SCRIPT_TABLE_dyno); @@ -102,7 +102,7 @@ void setMazdaMiata2003EngineConfigurationNaFuelRail(DECLARE_CONFIG_PARAMETER_SIG engineConfiguration->mafAdcChannel = EFI_ADC_4; // PA4 - setEgoSensor(ES_14Point7_Free PASS_CONFIG_PARAMETER_SUFFIX); + setEgoSensor(ES_14Point7_Free); engineConfiguration->cranking.baseFuel = 27; // higher value for return system NA conversion since lower fuel pressure engineConfiguration->vbattDividerCoeff = 9.30; // actual value on my new board diff --git a/firmware/config/engines/mazda_miata_na8.cpp b/firmware/config/engines/mazda_miata_na8.cpp index c8363cede3..6f79e2e398 100644 --- a/firmware/config/engines/mazda_miata_na8.cpp +++ b/firmware/config/engines/mazda_miata_na8.cpp @@ -21,8 +21,8 @@ * * See also setMiataNA_1_6_Configuration */ -void setMazdaMiataNA8Configuration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMiataNA6_MAP_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMazdaMiataNA8Configuration() { + setMiataNA6_MAP_Frankenso(); // blue jumper wire to W45 bottom jumper, not OEM engineConfiguration->map.sensor.hwChannel = EFI_ADC_7; diff --git a/firmware/config/engines/mazda_miata_na8.h b/firmware/config/engines/mazda_miata_na8.h index 7aad756c8e..8c26fe6daf 100644 --- a/firmware/config/engines/mazda_miata_na8.h +++ b/firmware/config/engines/mazda_miata_na8.h @@ -9,4 +9,4 @@ #include "engine_configuration.h" -void setMazdaMiataNA8Configuration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMazdaMiataNA8Configuration(); diff --git a/firmware/config/engines/mazda_miata_vvt.cpp b/firmware/config/engines/mazda_miata_vvt.cpp index e6b904406c..bd45a99e2e 100644 --- a/firmware/config/engines/mazda_miata_vvt.cpp +++ b/firmware/config/engines/mazda_miata_vvt.cpp @@ -220,7 +220,7 @@ static const float mafTransferKgH[MAF_TRANSFER_SIZE] = { }; -static void setMAFTransferFunction(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setMAFTransferFunction() { memcpy(config->mafDecoding, mafTransferKgH, sizeof(mafTransferKgH)); memcpy(config->mafDecodingBins, mafTransferVolts, sizeof(mafTransferVolts)); for (int i = MAF_TRANSFER_SIZE;iinjector.battLagCorr, injectorLagCorrection); copyArray(engineConfiguration->injector.battLagCorrBins, injectorLagBins); } -void setMazdaNB2VVTSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setMazdaNB2VVTSettings() { copyArray(config->vvtTable1RpmBins, vvt18fsioRpmBins); copyArray(config->vvtTable1LoadBins, vvt18fsioLoadBins); copyTable(config->vvtTable1, SCRIPT_TABLE_vvt_target); @@ -251,7 +251,7 @@ void setMazdaNB2VVTSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * stuff common between NA1 and NB2 */ -static void setCommonMazdaNB(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setCommonMazdaNB() { engineConfiguration->displayLogicLevelsInEngineSniffer = true; engineConfiguration->useOnlyRisingEdgeForTrigger = true; engineConfiguration->trigger.type = TT_MIATA_VVT; @@ -279,7 +279,7 @@ static void setCommonMazdaNB(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // enable cylinder_cleanup engineConfiguration->isCylinderCleanupEnabled = true; // set_whole_ve_map 80 - setMazdaMiataNbInjectorLag(PASS_CONFIG_PARAMETER_SIGNATURE); + setMazdaMiataNbInjectorLag(); engineConfiguration->idleMode = IM_AUTO; engineConfiguration->tachPulsePerRev = 2; @@ -291,7 +291,7 @@ static void setCommonMazdaNB(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setCommonNTCSensor(&engineConfiguration->clt, 2700); setCommonNTCSensor(&engineConfiguration->iat, 2700); - setMAFTransferFunction(PASS_CONFIG_PARAMETER_SIGNATURE); + setMAFTransferFunction(); // second harmonic (aka double) is usually quieter background noise // 13.8 @@ -318,21 +318,21 @@ static void setCommonMazdaNB(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->idleRpmPid.dFactor = 5; engineConfiguration->idleRpmPid.periodMs = 10; - miataNA_setCltIdleCorrBins(PASS_CONFIG_PARAMETER_SIGNATURE); - miataNA_setCltIdleRpmBins(PASS_CONFIG_PARAMETER_SIGNATURE); - miataNA_setIacCoastingBins(PASS_CONFIG_PARAMETER_SIGNATURE); + miataNA_setCltIdleCorrBins(); + miataNA_setCltIdleRpmBins(); + miataNA_setIacCoastingBins(); } -static void setMazdaMiataEngineNB1Defaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setCommonMazdaNB(PASS_CONFIG_PARAMETER_SIGNATURE); +static void setMazdaMiataEngineNB1Defaults() { + setCommonMazdaNB(); strcpy(CONFIG(engineCode), "NB1"); } -static void setMazdaMiataEngineNB2Defaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setMazdaMiataEngineNB2Defaults() { strcpy(CONFIG(engineCode), "NB2"); engineConfiguration->map.sensor.type = MT_GM_3_BAR; - setEgoSensor(ES_Innovate_MTX_L PASS_CONFIG_PARAMETER_SUFFIX); + setEgoSensor(ES_Innovate_MTX_L); /** * http://miataturbo.wikidot.com/fuel-injectors @@ -358,9 +358,9 @@ static void setMazdaMiataEngineNB2Defaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->vvtMode[0] = VVT_MIATA_NB2; engineConfiguration->vvtOffsets[0] = 98; // 2003 red car value - setCommonMazdaNB(PASS_CONFIG_PARAMETER_SIGNATURE); + setCommonMazdaNB(); - setMazdaNB2VVTSettings(PASS_CONFIG_PARAMETER_SIGNATURE); + setMazdaNB2VVTSettings(); @@ -373,10 +373,10 @@ static void setMazdaMiataEngineNB2Defaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } // end of setMazdaMiataEngineNB2Defaults // MAZDA_MIATA_2003 -void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMazdaMiata2003EngineConfiguration() { + setFrankensoConfiguration(); - setMazdaMiataEngineNB2Defaults(PASS_CONFIG_PARAMETER_SIGNATURE); + setMazdaMiataEngineNB2Defaults(); // engineConfiguration->triggerInputPins[0] = GPIOA_8; // custom Frankenso wiring in order to use SPI1 for accelerometer engineConfiguration->triggerInputPins[0] = GPIOA_5; // board still not modified @@ -456,7 +456,7 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->scriptSetting[2] = 105; // #3 CLT threshold engineConfiguration->scriptSetting[3] = 12.0; // #4 voltage threshold -// setFsio(1, GPIOE_6, COMBINED_WARNING_LIGHT PASS_CONFIG_PARAMETER_SUFFIX); +// setFsio(1, GPIOE_6, COMBINED_WARNING_LIGHT); // enable auto_idle // enable verbose_idle @@ -537,8 +537,8 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * board #70 - closer to default miata NA6 harness * */ -void setMazdaMiata2003EngineConfigurationBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMazdaMiata2003EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMazdaMiata2003EngineConfigurationBoardTest() { + setMazdaMiata2003EngineConfiguration(); engineConfiguration->ignitionPins[2] = GPIOC_7; @@ -548,9 +548,9 @@ void setMazdaMiata2003EngineConfigurationBoardTest(DECLARE_CONFIG_PARAMETER_SIGN engineConfiguration->mafAdcChannel = EFI_ADC_4; // PA4 - W47 top <>W47 } -static void setMiataNB2_MRE_common(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setMiataNB2_MRE_common() { #if (BOARD_TLE8888_COUNT > 0) - setMazdaMiataEngineNB2Defaults(PASS_CONFIG_PARAMETER_SIGNATURE); + setMazdaMiataEngineNB2Defaults(); // MRE has a special main relay control low side pin - rusEfi firmware is totally not involved with main relay control // @@ -624,15 +624,15 @@ static void setMiataNB2_MRE_common(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * Pretty much OEM 2003 Miata with ETB * set engine_type 13 */ -void setMiataNB2_MRE_ETB(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMiataNB2_MRE_common(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_MRE_ETB() { + setMiataNB2_MRE_common(); CONFIG(useETBforIdleControl) = true; #if EFI_FSIO // enable ETB // set_rpn_expression 8 "0" - // todo lua ETB setFsio(7, GPIOC_8, "0" PASS_CONFIG_PARAMETER_SUFFIX); + // todo lua ETB setFsio(7, GPIOC_8, "0"); #endif /* EFI_FSIO */ //set idle_offset 0 @@ -657,8 +657,8 @@ void setMiataNB2_MRE_ETB(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * Normal mechanical throttle body * set engine_type 11 */ -void setMiataNB2_MRE_MAP(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMiataNB2_MRE_common(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_MRE_MAP() { + setMiataNB2_MRE_common(); // somehow MRE72 adapter 0.2 has TPS routed to pin 26? engineConfiguration->tps1_1AdcChannel = EFI_ADC_6; // PA6 @@ -668,8 +668,8 @@ void setMiataNB2_MRE_MAP(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->mafAdcChannel = EFI_ADC_13; // J30 AV5 } -void setMiataNB2_MRE_MAF(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMiataNB2_MRE_MAP(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_MRE_MAF() { + setMiataNB2_MRE_MAP(); engineConfiguration->fuelAlgorithm = LM_REAL_MAF; } @@ -678,7 +678,7 @@ void setMiataNB2_MRE_MAF(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * https://github.com/rusefi/rusefi/wiki/HOWTO-TCU-A42DE-on-Proteus */ #if HW_PROTEUS -void setMiataNB2_Proteus_TCU(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setMiataNB2_Proteus_TCU() { engineConfiguration->tcuEnabled = true; engineConfiguration->trigger.type = TT_TOOTHED_WHEEL; @@ -732,8 +732,8 @@ void setMiataNB2_Proteus_TCU(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * https://github.com/rusefi/rusefi/wiki/HOWTO-Miata-NB2-on-Proteus */ -void setMiataNB2_ProteusEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMazdaMiataEngineNB2Defaults(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_ProteusEngineConfiguration() { + setMazdaMiataEngineNB2Defaults(); engineConfiguration->triggerInputPins[0] = GPIOC_6; // pin 10/black23 engineConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED; @@ -799,14 +799,14 @@ void setMiataNB2_ProteusEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) #endif // HW_PROTEUS #if HW_HELLEN -void setHellenNB1(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMazdaMiataEngineNB1Defaults(PASS_CONFIG_PARAMETER_SIGNATURE); +void setHellenNB1() { + setMazdaMiataEngineNB1Defaults(); engineConfiguration->injector.flow = 256; } -void setMiataNB2_Hellen72(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMazdaMiataEngineNB2Defaults(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_Hellen72() { + setMazdaMiataEngineNB2Defaults(); strcpy(CONFIG(vehicleName), "H72 test"); @@ -815,8 +815,8 @@ void setMiataNB2_Hellen72(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } -void setMiataNB2_Hellen72_36(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setMiataNB2_Hellen72(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_Hellen72_36() { + setMiataNB2_Hellen72(); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_1; engineConfiguration->globalTriggerAngleOffset = 76; diff --git a/firmware/config/engines/mazda_miata_vvt.h b/firmware/config/engines/mazda_miata_vvt.h index 58919c795d..dac97ccbbb 100644 --- a/firmware/config/engines/mazda_miata_vvt.h +++ b/firmware/config/engines/mazda_miata_vvt.h @@ -11,51 +11,51 @@ #include "engine_configuration.h" -void setMazdaMiataNbInjectorLag(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setMazdaNB2VVTSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMazdaMiataNbInjectorLag(); +void setMazdaNB2VVTSettings(); /** * Primary rusEfi test mule https://rusefi.com/forum/viewtopic.php?f=3&t=1095 * MAZDA_MIATA_2003 * set engine_type 47 */ -void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMazdaMiata2003EngineConfiguration(); /** * race car - NA body and fuel system with NB2 engine */ -void setMazdaMiata2003EngineConfigurationNaFuelRail(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setMazdaMiata2003EngineConfigurationBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMazdaMiata2003EngineConfigurationNaFuelRail(); +void setMazdaMiata2003EngineConfigurationBoardTest(); -void setMiataNB2_MRE_ETB(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_MRE_ETB(); /** * OEM mechanical throttle body, with MAP * set engine_type 11 */ -void setMiataNB2_MRE_MAP(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_MRE_MAP(); /** * OEM mechanical throttle body using OEM MAF * set engine_type 15 */ -void setMiataNB2_MRE_MAF(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_MRE_MAF(); /** * https://github.com/rusefi/rusefi/wiki/Mazda-Miata-2001 * set engine_type 1 */ -void setMiataNB2_Proteus_TCU(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_Proteus_TCU(); /** * set engine_type 67 */ -void setMiataNB2_ProteusEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_ProteusEngineConfiguration(); /** * set engine_type 69 */ -void setMiataNB2_Hellen72(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_Hellen72(); -void setMiataNB2_Hellen72_36(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMiataNB2_Hellen72_36(); -void setHellenNB1(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHellenNB1(); diff --git a/firmware/config/engines/me7pnp.cpp b/firmware/config/engines/me7pnp.cpp index 8238504633..86636eaa0e 100644 --- a/firmware/config/engines/me7pnp.cpp +++ b/firmware/config/engines/me7pnp.cpp @@ -14,14 +14,14 @@ /** * set engine_type 102 */ -void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void vag_18_Turbo() { //Base Engine Settings setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_60_2_VW; engineConfiguration->useOnlyRisingEdgeForTrigger = true; - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.firingOrder = FO_1_3_4_2; @@ -89,7 +89,7 @@ void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->is_enabled_spi_3 = false; #if EFI_CJ125 - cj125defaultPinout(PASS_CONFIG_PARAMETER_SIGNATURE); + cj125defaultPinout(); engineConfiguration->cj125ur = EFI_ADC_11; // PC3 engineConfiguration->cj125CsPin = GPIOB_11; #endif @@ -131,8 +131,8 @@ void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) { //ETB Settings #if EFI_FSIO - // todo lua setFsio (14, GPIOF_13, "1" PASS_CONFIG_PARAMETER_SUFFIX); - // todo lua setFsioExt (3, GPIOE_0, "0.15 90 coolant 120 min max 90 - 30 / 0.8 * +", 25 PASS_CONFIG_PARAMETER_SUFFIX); + // todo lua setFsio (14, GPIOF_13, "1"); + // todo lua setFsioExt (3, GPIOE_0, "0.15 90 coolant 120 min max 90 - 30 / 0.8 * +", 25); #endif // is this needed? engineConfiguration->vvtOutputFrequency[3] = 25; CONFIG(etb_use_two_wires) = true; @@ -144,7 +144,7 @@ void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->isHip9011Enabled = false; #if EFI_FSIO - // todo lua setFsio (15, GPIOE_6, "1" PASS_CONFIG_PARAMETER_SUFFIX); + // todo lua setFsio (15, GPIOE_6, "1"); #endif CONFIG(etbIo[1].directionPin1) = GPIOE_2; CONFIG(etbIo[1].directionPin2) = GPIOE_4; diff --git a/firmware/config/engines/me7pnp.h b/firmware/config/engines/me7pnp.h index 86b19d9eba..1c45e619ce 100644 --- a/firmware/config/engines/me7pnp.h +++ b/firmware/config/engines/me7pnp.h @@ -9,5 +9,5 @@ #include "engine_configuration.h" -void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void vag_18_Turbo(); diff --git a/firmware/config/engines/mercedes.cpp b/firmware/config/engines/mercedes.cpp index d504018075..1340dcedb9 100644 --- a/firmware/config/engines/mercedes.cpp +++ b/firmware/config/engines/mercedes.cpp @@ -8,26 +8,26 @@ #include "pch.h" #include "custom_engine.h" -static void common(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setHellenDefaultVrThresholds(PASS_CONFIG_PARAMETER_SIGNATURE); +static void common() { + setHellenDefaultVrThresholds(); engineConfiguration->vrThreshold[0].pin = GPIOD_14; } -void setHellenMercedes128_4_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - common(PASS_CONFIG_PARAMETER_SIGNATURE); +void setHellenMercedes128_4_cyl() { + common(); } // is this M104 or M112 or both? -void setHellenMercedes128_6_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - common(PASS_CONFIG_PARAMETER_SIGNATURE); +void setHellenMercedes128_6_cyl() { + common(); engineConfiguration->specs.cylindersCount = 6; // 1-4-2-5-3-6 M104 engineConfiguration->specs.firingOrder = FO_1_4_3_6_2_5; // M112 } // M113 -void setHellenMercedes128_8_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - common(PASS_CONFIG_PARAMETER_SIGNATURE); +void setHellenMercedes128_8_cyl() { + common(); engineConfiguration->specs.cylindersCount = 8; engineConfiguration->specs.firingOrder = FO_1_5_4_2_6_3_7_8; } diff --git a/firmware/config/engines/mercedes.h b/firmware/config/engines/mercedes.h index 79f5e8fbc2..5c61447750 100644 --- a/firmware/config/engines/mercedes.h +++ b/firmware/config/engines/mercedes.h @@ -9,6 +9,6 @@ #include "engine_configuration.h" -void setHellenMercedes128_4_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setHellenMercedes128_6_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setHellenMercedes128_8_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHellenMercedes128_4_cyl(); +void setHellenMercedes128_6_cyl(); +void setHellenMercedes128_8_cyl(); diff --git a/firmware/config/engines/mitsubishi.cpp b/firmware/config/engines/mitsubishi.cpp index 107581d350..14f7e160b5 100644 --- a/firmware/config/engines/mitsubishi.cpp +++ b/firmware/config/engines/mitsubishi.cpp @@ -14,8 +14,8 @@ #include "fsio_impl.h" #include "mitsubishi.h" -void setMitsubishiConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setMitsubishiConfiguration() { + setDefaultFrankensoConfiguration(); engineConfiguration->trigger.type = TT_MITSUBISHI; // same trigger as 4G63? @@ -73,7 +73,7 @@ void setMitsubishiConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->HD44780width = 20; engineConfiguration->HD44780height = 4; - setEgoSensor(ES_Innovate_MTX_L PASS_CONFIG_PARAMETER_SUFFIX); + setEgoSensor(ES_Innovate_MTX_L); } diff --git a/firmware/config/engines/mitsubishi.h b/firmware/config/engines/mitsubishi.h index cf5b420e0c..d17b85ba97 100644 --- a/firmware/config/engines/mitsubishi.h +++ b/firmware/config/engines/mitsubishi.h @@ -9,5 +9,5 @@ #include "engine_configuration.h" -void setMitsubishiConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setMitsubishiConfiguration(); diff --git a/firmware/config/engines/nissan_primera.cpp b/firmware/config/engines/nissan_primera.cpp index 09bffb3bce..9ba19eca66 100644 --- a/firmware/config/engines/nissan_primera.cpp +++ b/firmware/config/engines/nissan_primera.cpp @@ -12,8 +12,8 @@ #include "nissan_primera.h" -void setNissanPrimeraEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setNissanPrimeraEngineConfiguration() { + setDefaultFrankensoConfiguration(); engineConfiguration->trigger.type = TT_NISSAN_SR20VE; @@ -21,6 +21,6 @@ void setNissanPrimeraEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->auxValves[1] = GPIOE_12; } -void setNissanPrimeraEngineConfiguration_360(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setNissanPrimeraEngineConfiguration_360() { engineConfiguration->trigger.type = TT_NISSAN_SR20VE_360; } diff --git a/firmware/config/engines/nissan_primera.h b/firmware/config/engines/nissan_primera.h index 93ea1d1546..b2a4965ca5 100644 --- a/firmware/config/engines/nissan_primera.h +++ b/firmware/config/engines/nissan_primera.h @@ -9,5 +9,5 @@ #include "engine_configuration.h" -void setNissanPrimeraEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setNissanPrimeraEngineConfiguration_360(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setNissanPrimeraEngineConfiguration(); +void setNissanPrimeraEngineConfiguration_360(); diff --git a/firmware/config/engines/nissan_vq.cpp b/firmware/config/engines/nissan_vq.cpp index cace59ec41..a5c98ecfe9 100644 --- a/firmware/config/engines/nissan_vq.cpp +++ b/firmware/config/engines/nissan_vq.cpp @@ -7,7 +7,7 @@ #include "nissan_vq.h" -void setHellen121nissanQR(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellen121nissanQR() { engineConfiguration->trigger.type = TT_NISSAN_QR25; engineConfiguration->specs.cylindersCount = 4; @@ -26,7 +26,7 @@ void setHellen121nissanQR(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } -void setHellen121nissanVQ(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellen121nissanVQ() { engineConfiguration->trigger.type = TT_NISSAN_VQ35; engineConfiguration->specs.cylindersCount = 6; @@ -43,10 +43,10 @@ void setHellen121nissanVQ(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->vvtOffsets[1 * CAMS_PER_BANK] = NISSAN_VQ_VVT_OFFSET - NISSAN_VQ_CAM_OFFSET; } -void setHellen121nissanAltimaN16(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellen121nissanAltimaN16() { // https://en.wikipedia.org/wiki/Nissan_QG_engine // https://en.wikipedia.org/wiki/N-VCT - setHellen121nissanQR(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellen121nissanQR(); engineConfiguration->specs.displacement = 1.8; strcpy(CONFIG(engineCode), "N16"); diff --git a/firmware/config/engines/nissan_vq.h b/firmware/config/engines/nissan_vq.h index 4a559a19b2..ffb5ef7957 100644 --- a/firmware/config/engines/nissan_vq.h +++ b/firmware/config/engines/nissan_vq.h @@ -12,6 +12,6 @@ #define NISSAN_VQ_VVT_OFFSET -610 #define NISSAN_VQ_CAM_OFFSET -360 -void setHellen121nissanVQ(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setHellen121nissanQR(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setHellen121nissanAltimaN16(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHellen121nissanVQ(); +void setHellen121nissanQR(); +void setHellen121nissanAltimaN16(); diff --git a/firmware/config/engines/sachs.cpp b/firmware/config/engines/sachs.cpp index 706063465a..1015205424 100644 --- a/firmware/config/engines/sachs.cpp +++ b/firmware/config/engines/sachs.cpp @@ -12,8 +12,8 @@ #include "sachs.h" -void setSachs(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setSachs() { + setDefaultFrankensoConfiguration(); engineConfiguration->specs.displacement = 0.1; // 100cc engineConfiguration->specs.cylindersCount = 1; @@ -25,7 +25,7 @@ void setSachs(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // set injection_offset 0 engineConfiguration->extraInjectionOffset = 0; - setEgoSensor(ES_Innovate_MTX_L PASS_CONFIG_PARAMETER_SUFFIX); + setEgoSensor(ES_Innovate_MTX_L); /** * 50/2 trigger @@ -81,7 +81,7 @@ void setSachs(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->fuelPumpPin = GPIOE_6; // todo: extract a method? figure out something smarter - setTimingRpmBin(800, 15000 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingRpmBin(800, 15000); setLinearCurve(config->veRpmBins, 7000, 15000, 1); setLinearCurve(config->lambdaRpmBins, 500, 7000, 1); } diff --git a/firmware/config/engines/sachs.h b/firmware/config/engines/sachs.h index d9207a75d6..b487bc48d5 100644 --- a/firmware/config/engines/sachs.h +++ b/firmware/config/engines/sachs.h @@ -8,5 +8,5 @@ #pragma once #include "engine_configuration.h" -void setSachs(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setSachs(); diff --git a/firmware/config/engines/subaru.cpp b/firmware/config/engines/subaru.cpp index 57adc33c93..35599ecd37 100644 --- a/firmware/config/engines/subaru.cpp +++ b/firmware/config/engines/subaru.cpp @@ -13,7 +13,7 @@ #include "subaru.h" #include "custom_engine.h" -void setSubaru2003Wrx(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setSubaru2003Wrx() { setFrankenso_01_LCD(engineConfiguration); setFrankenso0_1_joystick(engineConfiguration); @@ -37,7 +37,7 @@ void setSubaru2003Wrx(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * MRE_SUBARU_EJ18 * set engine_type 37 */ -void setSubaruEJ18_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setSubaruEJ18_MRE() { engineConfiguration->trigger.type = TT_SUBARU_7_WITHOUT_6; @@ -65,7 +65,7 @@ void setSubaruEJ18_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * Subaru SVX (Alcyone SVX) */ -void setSubaruEG33Defaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void setSubaruEG33Defaults() { setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR); engineConfiguration->trigger.type = TT_SUBARU_SVX; diff --git a/firmware/config/engines/subaru.h b/firmware/config/engines/subaru.h index 7b1c6a959c..b182dbac16 100644 --- a/firmware/config/engines/subaru.h +++ b/firmware/config/engines/subaru.h @@ -7,7 +7,7 @@ #include "engine_configuration.h" -void setSubaru2003Wrx(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setSubaruEJ20GDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setSubaruEJ18_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setSubaruEG33Defaults(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void setSubaru2003Wrx(); +void setSubaruEJ20GDefaults(); +void setSubaruEJ18_MRE(); +void setSubaruEG33Defaults(); diff --git a/firmware/config/engines/test_engine.cpp b/firmware/config/engines/test_engine.cpp index 5c2dc275e3..86286a821c 100644 --- a/firmware/config/engines/test_engine.cpp +++ b/firmware/config/engines/test_engine.cpp @@ -15,8 +15,8 @@ #include "test_engine.h" // TEST_ENGINE -void setTestEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setTestEngineConfiguration() { + setDefaultFrankensoConfiguration(); setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR); engineConfiguration->trigger.type = TT_ONE_PLUS_ONE; @@ -32,13 +32,13 @@ void setTestEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->tps1_1AdcChannel = EFI_ADC_2; engineConfiguration->vbattAdcChannel = EFI_ADC_NONE; - setWholeIatCorrTimingTable(0 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeIatCorrTimingTable(0); // Many tests were written when the default target AFR was 14.0, so use that for tests by default. engineConfiguration->stoichRatioPrimary = 14.0f; engineConfiguration->ignitionMode = IM_ONE_COIL; - setConstantDwell(3 PASS_CONFIG_PARAMETER_SUFFIX); // 50% duty cycle @ 5000 rpm + setConstantDwell(3); // 50% duty cycle @ 5000 rpm engineConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED; @@ -50,8 +50,8 @@ void setTestEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->ignitionPins[5] = GPIO_UNASSIGNED; // #6 } -void setTestVVTEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setTestVVTEngineConfiguration() { + setDefaultFrankensoConfiguration(); setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL; @@ -59,7 +59,7 @@ void setTestVVTEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->trigger.customSkippedToothCount = 1; // set algorithm 3 - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED; engineConfiguration->camInputs[0] = GPIOA_5; @@ -72,8 +72,8 @@ void setTestVVTEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } #if EFI_UNIT_TEST -void setTestEngineIssue366both(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setTestEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setTestEngineIssue366both() { + setTestEngineConfiguration(); engineConfiguration->useOnlyRisingEdgeForTrigger = false; @@ -84,8 +84,8 @@ void setTestEngineIssue366both(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } -void setTestEngineIssue366rise(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setTestEngineIssue366both(PASS_CONFIG_PARAMETER_SIGNATURE); +void setTestEngineIssue366rise() { + setTestEngineIssue366both(); engineConfiguration->useOnlyRisingEdgeForTrigger = true; @@ -93,7 +93,7 @@ void setTestEngineIssue366rise(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #endif /* EFI_UNIT_TEST */ #ifdef HARDWARE_CI -void setProteusAnalogPwmTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setProteusAnalogPwmTest() { // lowest cpu trigger possible engineConfiguration->trigger.type = TT_ONE; diff --git a/firmware/config/engines/test_engine.h b/firmware/config/engines/test_engine.h index 7e1042074a..052835c76f 100644 --- a/firmware/config/engines/test_engine.h +++ b/firmware/config/engines/test_engine.h @@ -9,9 +9,9 @@ #include "engine_configuration.h" -void setTestEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setTestVVTEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setTestEngineConfiguration(); +void setTestVVTEngineConfiguration(); -void setTestEngineIssue366both(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setTestEngineIssue366rise(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setProteusAnalogPwmTest(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setTestEngineIssue366both(); +void setTestEngineIssue366rise(); +void setProteusAnalogPwmTest(); diff --git a/firmware/config/engines/toyota_jzs147.cpp b/firmware/config/engines/toyota_jzs147.cpp index e9d786bb0e..b8a21a2a8a 100644 --- a/firmware/config/engines/toyota_jzs147.cpp +++ b/firmware/config/engines/toyota_jzs147.cpp @@ -23,8 +23,8 @@ #include "custom_engine.h" #include "mazda_miata_vvt.h" -static void common2jz(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); // default pinout +static void common2jz() { + setFrankensoConfiguration(); // default pinout engineConfiguration->specs.displacement = 3.0; engineConfiguration->specs.cylindersCount = 6; @@ -67,8 +67,8 @@ static void common2jz(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } -void setToyota_jzs147EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - common2jz(PASS_CONFIG_PARAMETER_SIGNATURE); +void setToyota_jzs147EngineConfiguration() { + common2jz(); setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR); engineConfiguration->trigger.type = TT_2JZ_1_12; @@ -99,8 +99,8 @@ void setToyota_jzs147EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * TOYOTA_2JZ_GTE_VVTi * set engine_type 44 */ -void setToyota_2jz_vics(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - common2jz(PASS_CONFIG_PARAMETER_SIGNATURE); +void setToyota_2jz_vics() { + common2jz(); setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_2; @@ -133,7 +133,7 @@ void setToyota_2jz_vics(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->vvtPins[0] = GPIOE_3; // VVT solenoid control // Mazda VVT settings have nothing to do wit Toyota 2JZ settings but those are a good starting point for settings - setMazdaNB2VVTSettings(PASS_CONFIG_PARAMETER_SIGNATURE); + setMazdaNB2VVTSettings(); } diff --git a/firmware/config/engines/toyota_jzs147.h b/firmware/config/engines/toyota_jzs147.h index c93e1a9384..41c22a2356 100644 --- a/firmware/config/engines/toyota_jzs147.h +++ b/firmware/config/engines/toyota_jzs147.h @@ -9,6 +9,6 @@ #include "engine_configuration.h" -void setToyota_jzs147EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setToyota_2jz_vics(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setToyota_jzs147EngineConfiguration(); +void setToyota_2jz_vics(); diff --git a/firmware/config/engines/vw.cpp b/firmware/config/engines/vw.cpp index c34f479269..56a0649455 100644 --- a/firmware/config/engines/vw.cpp +++ b/firmware/config/engines/vw.cpp @@ -14,10 +14,10 @@ // VW_ABA // set engine_type 32 -void setVwAba(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setVwAba() { + setFrankensoConfiguration(); - setWholeTimingTable_d(20 PASS_CONFIG_PARAMETER_SUFFIX); + setWholeTimingTable_d(20); // set cranking_timing_angle 10 engineConfiguration->crankingTimingAngle = 10; @@ -39,7 +39,7 @@ void setVwAba(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->specs.displacement = 2.0; engineConfiguration->injector.flow = 320; // 30lb/h // set algorithm 3 - setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); + setAlgorithm(LM_SPEED_DENSITY); engineConfiguration->map.sensor.type = MT_GM_3_BAR; engineConfiguration->ignitionMode = IM_ONE_COIL; @@ -55,27 +55,27 @@ void setVwAba(DECLARE_CONFIG_PARAMETER_SIGNATURE) { float mapRange = 110; - setEgoSensor(ES_PLX PASS_CONFIG_PARAMETER_SUFFIX); - setFuelTablesLoadBin(20, mapRange PASS_CONFIG_PARAMETER_SUFFIX); - setTimingLoadBin(20, mapRange PASS_CONFIG_PARAMETER_SUFFIX); + setEgoSensor(ES_PLX); + setFuelTablesLoadBin(20, mapRange); + setTimingLoadBin(20, mapRange); CONFIG(isSdCardEnabled) = false; engineConfiguration->tpsMin = 740; engineConfiguration->tpsMax = 135; } -void setHellen121Vag_5_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellen121Vag_5_cyl() { engineConfiguration->specs.cylindersCount = 5; engineConfiguration->specs.displacement = 2.5; engineConfiguration->specs.firingOrder = FO_1_2_4_5_3; } -void setHellen121Vag_vr6_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellen121Vag_vr6_cyl() { engineConfiguration->specs.cylindersCount = 6; engineConfiguration->specs.firingOrder = FO_1_5_3_6_2_4; } -void setHellen121Vag_v6_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellen121Vag_v6_cyl() { engineConfiguration->specs.cylindersCount = 6; engineConfiguration->specs.displacement = 2.7; @@ -84,7 +84,7 @@ void setHellen121Vag_v6_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->specs.firingOrder = FO_1_4_3_6_2_5; } -void setHellen121Vag_8_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHellen121Vag_8_cyl() { engineConfiguration->specs.cylindersCount = 8; engineConfiguration->specs.displacement = 4.2; engineConfiguration->specs.firingOrder = FO_1_5_4_8_6_3_7_2; diff --git a/firmware/config/engines/vw.h b/firmware/config/engines/vw.h index 357d0c1435..65fe710d3c 100644 --- a/firmware/config/engines/vw.h +++ b/firmware/config/engines/vw.h @@ -9,10 +9,10 @@ #include "engine_configuration.h" -void setVwAba(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setVwAba(); -void setHellen121Vag_5_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setHellen121Vag_vr6_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setHellen121Vag_v6_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setHellen121Vag_8_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setHellen121Vag_5_cyl(); +void setHellen121Vag_vr6_cyl(); +void setHellen121Vag_v6_cyl(); +void setHellen121Vag_8_cyl(); diff --git a/firmware/config/engines/vw_b6.cpp b/firmware/config/engines/vw_b6.cpp index e347f5f623..a7bb394420 100644 --- a/firmware/config/engines/vw_b6.cpp +++ b/firmware/config/engines/vw_b6.cpp @@ -17,7 +17,7 @@ * VW_B6 * has to be microRusEFI 0.5.2 */ -void setVwPassatB6(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setVwPassatB6() { #if (BOARD_TLE8888_COUNT > 0) setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2; @@ -68,7 +68,7 @@ void setVwPassatB6(DECLARE_CONFIG_PARAMETER_SIGNATURE) { CONFIG(isSdCardEnabled) = false; CONFIG(mc33816spiDevice) = SPI_DEVICE_3; - setBoschHDEV_5_injectors(PASS_CONFIG_PARAMETER_SIGNATURE); + setBoschHDEV_5_injectors(); // RED engineConfiguration->spi3mosiPin = GPIOC_12; // YELLOW @@ -128,7 +128,7 @@ void setVwPassatB6(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // "7 - Lowside 1" // engineConfiguration->hpfpValvePin = TLE8888_PIN_6; // Disable for now - setBoschVAGETB(PASS_CONFIG_PARAMETER_SIGNATURE); + setBoschVAGETB(); engineConfiguration->injector.flow = 300; diff --git a/firmware/config/engines/vw_b6.h b/firmware/config/engines/vw_b6.h index f1fe40c227..93a0fe3f01 100644 --- a/firmware/config/engines/vw_b6.h +++ b/firmware/config/engines/vw_b6.h @@ -7,4 +7,4 @@ #pragma once -void setVwPassatB6(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setVwPassatB6(); diff --git a/firmware/console/binary/tooth_logger.cpp b/firmware/console/binary/tooth_logger.cpp index 2f13d9d795..6b84997d15 100644 --- a/firmware/console/binary/tooth_logger.cpp +++ b/firmware/console/binary/tooth_logger.cpp @@ -76,7 +76,7 @@ static void setToothLogReady(bool value) { #endif // EFI_TUNER_STUDIO } -static void SetNextCompositeEntry(efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void SetNextCompositeEntry(efitick_t timestamp) { uint32_t nowUs = NT2US(timestamp); // TS uses big endian, grumble @@ -106,7 +106,7 @@ static void SetNextCompositeEntry(efitick_t timestamp DECLARE_ENGINE_PARAMETER_S } -void LogTriggerTooth(trigger_event_e tooth, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { +void LogTriggerTooth(trigger_event_e tooth, efitick_t timestamp) { // bail if we aren't enabled if (!ToothLoggerEnabled) { return; @@ -161,36 +161,36 @@ void LogTriggerTooth(trigger_event_e tooth, efitick_t timestamp DECLARE_ENGINE_P break; } - SetNextCompositeEntry(timestamp PASS_ENGINE_PARAMETER_SUFFIX); + SetNextCompositeEntry(timestamp); } -void LogTriggerTopDeadCenter(efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { +void LogTriggerTopDeadCenter(efitick_t timestamp) { // bail if we aren't enabled if (!ToothLoggerEnabled) { return; } currentTdc = true; - SetNextCompositeEntry(timestamp PASS_ENGINE_PARAMETER_SUFFIX); + SetNextCompositeEntry(timestamp); currentTdc = false; - SetNextCompositeEntry(timestamp + 10 PASS_ENGINE_PARAMETER_SUFFIX); + SetNextCompositeEntry(timestamp + 10); } -void LogTriggerCoilState(efitick_t timestamp, bool state DECLARE_ENGINE_PARAMETER_SUFFIX) { +void LogTriggerCoilState(efitick_t timestamp, bool state) { if (!ToothLoggerEnabled) { return; } currentCoilState = state; UNUSED(timestamp); - //SetNextCompositeEntry(timestamp, trigger1, trigger2, trigger PASS_ENGINE_PARAMETER_SUFFIX); + //SetNextCompositeEntry(timestamp, trigger1, trigger2, trigger); } -void LogTriggerInjectorState(efitick_t timestamp, bool state DECLARE_ENGINE_PARAMETER_SUFFIX) { +void LogTriggerInjectorState(efitick_t timestamp, bool state) { if (!ToothLoggerEnabled) { return; } currentInjectorState = state; UNUSED(timestamp); - //SetNextCompositeEntry(timestamp, trigger1, trigger2, trigger PASS_ENGINE_PARAMETER_SUFFIX); + //SetNextCompositeEntry(timestamp, trigger1, trigger2, trigger); } void EnableToothLogger() { diff --git a/firmware/console/binary/tooth_logger.h b/firmware/console/binary/tooth_logger.h index b8c17810b6..ee868728ff 100644 --- a/firmware/console/binary/tooth_logger.h +++ b/firmware/console/binary/tooth_logger.h @@ -25,13 +25,13 @@ void EnableToothLogger(); void DisableToothLogger(); // A new tooth has arrived! Log to the buffer if enabled. -void LogTriggerTooth(trigger_event_e tooth, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX); +void LogTriggerTooth(trigger_event_e tooth, efitick_t timestamp); -void LogTriggerTopDeadCenter(efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX); +void LogTriggerTopDeadCenter(efitick_t timestamp); -void LogTriggerCoilState(efitick_t timestamp, bool state DECLARE_ENGINE_PARAMETER_SUFFIX); +void LogTriggerCoilState(efitick_t timestamp, bool state); -void LogTriggerInjectorState(efitick_t timestamp, bool state DECLARE_ENGINE_PARAMETER_SUFFIX); +void LogTriggerInjectorState(efitick_t timestamp, bool state); struct ToothLoggerBuffer { diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 828d811fc5..a475f997f6 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -211,7 +211,7 @@ static void handlePageSelectCommand(TsChannelBase *tsChannel, ts_response_format * On the contrary, 'hard parameters' are waiting for the Burn button to be clicked and configuration version * would be increased and much more complicated logic would be executed. */ -static void onlineApplyWorkingCopyBytes(uint32_t offset, int count DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void onlineApplyWorkingCopyBytes(uint32_t offset, int count) { if (offset >= sizeof(engine_configuration_s)) { int maxSize = sizeof(persistent_config_s) - offset; if (count > maxSize) { @@ -306,7 +306,7 @@ bool rebootForPresetPending = false; * @note See also handleWriteValueCommand */ void handleWriteChunkCommand(TsChannelBase* tsChannel, ts_response_format_e mode, uint16_t offset, uint16_t count, - void *content DECLARE_ENGINE_PARAMETER_SUFFIX) { + void *content) { tsState.writeChunkCommandCounter++; efiPrintf("WRITE CHUNK mode=%d o=%d s=%d", mode, offset, count); @@ -319,7 +319,7 @@ void handleWriteChunkCommand(TsChannelBase* tsChannel, ts_response_format_e mode if (!rebootForPresetPending) { uint8_t * addr = (uint8_t *) (getWorkingPageAddr() + offset); memcpy(addr, content, count); - onlineApplyWorkingCopyBytes(offset, count PASS_ENGINE_PARAMETER_SUFFIX); + onlineApplyWorkingCopyBytes(offset, count); } sendOkResponse(tsChannel, mode); @@ -398,7 +398,7 @@ static void handlePageReadCommand(TsChannelBase* tsChannel, ts_response_format_e void requestBurn(void) { #if !EFI_UNIT_TEST - onBurnRequest(PASS_ENGINE_PARAMETER_SIGNATURE); + onBurnRequest(); #if EFI_INTERNAL_FLASH setNeedToWriteConfiguration(); @@ -415,7 +415,7 @@ static void sendResponseCode(ts_response_format_e mode, TsChannelBase *tsChannel /** * 'Burn' command is a command to commit the changes */ -void handleBurnCommand(TsChannelBase* tsChannel, ts_response_format_e mode DECLARE_ENGINE_PARAMETER_SUFFIX) { +void handleBurnCommand(TsChannelBase* tsChannel, ts_response_format_e mode) { efitimems_t nowMs = currentTimeMillis(); tsState.burnCommandCounter++; diff --git a/firmware/console/binary/tunerstudio.h b/firmware/console/binary/tunerstudio.h index 3c1eda3a5e..c029b534bd 100644 --- a/firmware/console/binary/tunerstudio.h +++ b/firmware/console/binary/tunerstudio.h @@ -48,7 +48,7 @@ bool handlePlainCommand(TsChannelBase* tsChannel, uint8_t command); */ void handleQueryCommand(TsChannelBase* tsChannel, ts_response_format_e mode); -void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ENGINE_PARAMETER_SUFFIX); +void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels); void printTsStats(void); void requestBurn(void); @@ -86,5 +86,5 @@ public: #endif /* EFI_TUNER_STUDIO */ -void handleWriteChunkCommand(TsChannelBase* tsChannel, ts_response_format_e mode, uint16_t offset, uint16_t count, void *content DECLARE_ENGINE_PARAMETER_SUFFIX); -void handleBurnCommand(TsChannelBase* tsChannel, ts_response_format_e mode DECLARE_ENGINE_PARAMETER_SUFFIX); +void handleWriteChunkCommand(TsChannelBase* tsChannel, ts_response_format_e mode, uint16_t offset, uint16_t count, void *content); +void handleBurnCommand(TsChannelBase* tsChannel, ts_response_format_e mode); diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 375e883672..85af6c1620 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -135,13 +135,13 @@ static uint64_t binaryLogCount = 0; * This is useful if we are changing engine mode dynamically * For example http://rusefi.com/forum/viewtopic.php?f=5&t=1085 */ -static int packEngineMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static int packEngineMode() { return (engineConfiguration->fuelAlgorithm << 4) + (engineConfiguration->injectionMode << 2) + engineConfiguration->ignitionMode; } -static float getAirFlowGauge(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static float getAirFlowGauge() { return Sensor::get(SensorType::Maf).value_or(engine->engineState.airFlow); } @@ -312,7 +312,7 @@ static void showFuelInfo2(float rpm, float engineLoad) { #if EFI_ENGINE_CONTROL static void showFuelInfo() { - showFuelInfo2((float) GET_RPM(), getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE)); + showFuelInfo2((float) GET_RPM(), getFuelingLoad()); } #endif @@ -592,8 +592,8 @@ static void updateFuelCorrections() { } static void updateFuelLoads() { - tsOutputChannels.fuelingLoad = getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE); - tsOutputChannels.ignitionLoad = getIgnitionLoad(PASS_ENGINE_PARAMETER_SIGNATURE); + tsOutputChannels.fuelingLoad = getFuelingLoad(); + tsOutputChannels.ignitionLoad = getIgnitionLoad(); tsOutputChannels.veTableYAxis = ENGINE(engineState.currentVeLoad); tsOutputChannels.afrTableYAxis = ENGINE(engineState.currentAfrLoad); } @@ -634,7 +634,7 @@ static void updateIgnition(int rpm) { // 60 tsOutputChannels.sparkDwell = ENGINE(engineState.sparkDwell); - tsOutputChannels.coilDutyCycle = getCoilDutyCycle(rpm PASS_ENGINE_PARAMETER_SUFFIX); + tsOutputChannels.coilDutyCycle = getCoilDutyCycle(rpm); tsOutputChannels.knockRetard = ENGINE(knockController).getKnockRetard(); } @@ -681,7 +681,7 @@ static void updateTpsDebug() { tsOutputChannels.debugFloatField5 = 100 * Sensor::getOrZero(SensorType::Tps1Primary) / Sensor::getOrZero(SensorType::Tps1Secondary); } -void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ENGINE_PARAMETER_SUFFIX) { +void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels) { #if EFI_SHAFT_POSITION_INPUT int rpm = Sensor::get(SensorType::Rpm).Value; #else /* EFI_SHAFT_POSITION_INPUT */ @@ -707,7 +707,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->rpmAcceleration = engine->rpmCalculator.getRpmAcceleration(); // offset 108 // For air-interpolated tCharge mode, we calculate a decent massAirFlow approximation, so we can show it to users even without MAF sensor! - tsOutputChannels->massAirFlow = getAirFlowGauge(PASS_ENGINE_PARAMETER_SIGNATURE); + tsOutputChannels->massAirFlow = getAirFlowGauge(); // offset 116 // TPS acceleration tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getMaxDelta(); @@ -718,7 +718,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ // 68 // 140 #if EFI_ENGINE_CONTROL - tsOutputChannels->injectorDutyCycle = getInjectorDutyCycle(rpm PASS_ENGINE_PARAMETER_SUFFIX); + tsOutputChannels->injectorDutyCycle = getInjectorDutyCycle(rpm); #endif // 224 @@ -726,7 +726,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->timeSeconds = timeSeconds; // 252 - tsOutputChannels->engineMode = packEngineMode(PASS_ENGINE_PARAMETER_SIGNATURE); + tsOutputChannels->engineMode = packEngineMode(); // 120 tsOutputChannels->firmwareVersion = getRusEfiVersion(); @@ -739,7 +739,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->accelerationYaw = engine->sensors.accelerometer.yaw; #if EFI_DYNO_VIEW - tsOutputChannels->VssAcceleration = getDynoviewAcceleration(PASS_ENGINE_PARAMETER_SIGNATURE); + tsOutputChannels->VssAcceleration = getDynoviewAcceleration(); #endif tsOutputChannels->turboSpeed = Sensor::getOrZero(SensorType::TurbochargerSpeed); @@ -849,8 +849,8 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ break; #endif /* EFI_CAN_SUPPORT */ case DBG_ANALOG_INPUTS: - tsOutputChannels->debugFloatField4 = isAdcChannelValid(engineConfiguration->map.sensor.hwChannel) ? getVoltageDivided("map", engineConfiguration->map.sensor.hwChannel PASS_ENGINE_PARAMETER_SUFFIX) : 0.0f; - tsOutputChannels->debugFloatField7 = isAdcChannelValid(engineConfiguration->afr.hwChannel) ? getVoltageDivided("ego", engineConfiguration->afr.hwChannel PASS_ENGINE_PARAMETER_SUFFIX) : 0.0f; + tsOutputChannels->debugFloatField4 = isAdcChannelValid(engineConfiguration->map.sensor.hwChannel) ? getVoltageDivided("map", engineConfiguration->map.sensor.hwChannel) : 0.0f; + tsOutputChannels->debugFloatField7 = isAdcChannelValid(engineConfiguration->afr.hwChannel) ? getVoltageDivided("ego", engineConfiguration->afr.hwChannel) : 0.0f; break; case DBG_ANALOG_INPUTS2: updateTpsDebug(); @@ -885,7 +885,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ } } -void updateCurrentEnginePhase(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void updateCurrentEnginePhase() { if (auto phase = engine->triggerCentral.getCurrentEnginePhase(getTimeNowNt())) { tsOutputChannels.currentEnginePhase = phase.Value - tdcPosition(); } else { @@ -895,7 +895,7 @@ void updateCurrentEnginePhase(DECLARE_ENGINE_PARAMETER_SIGNATURE) { void prepareTunerStudioOutputs(void) { // sensor state for EFI Analytics Tuner Studio - updateTunerStudioState(&tsOutputChannels PASS_ENGINE_PARAMETER_SUFFIX); + updateTunerStudioState(&tsOutputChannels); } #endif /* EFI_TUNER_STUDIO */ diff --git a/firmware/console/status_loop.h b/firmware/console/status_loop.h index b6ed120396..f37d6a1e03 100644 --- a/firmware/console/status_loop.h +++ b/firmware/console/status_loop.h @@ -11,7 +11,7 @@ void updateDevConsoleState(void); void prepareTunerStudioOutputs(void); -void updateCurrentEnginePhase(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void updateCurrentEnginePhase(); void startStatusThreads(void); void initStatusLoop(void); diff --git a/firmware/controllers/actuators/ac_control.cpp b/firmware/controllers/actuators/ac_control.cpp index 687779ea43..43388625a7 100644 --- a/firmware/controllers/actuators/ac_control.cpp +++ b/firmware/controllers/actuators/ac_control.cpp @@ -8,7 +8,7 @@ static Deadband<200> maxRpmDeadband; static Deadband<5> maxCltDeadband; static Deadband<5> maxTpsDeadband; -bool AcState::getAcState(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +bool AcState::getAcState() { latest_usage_ac_control = getTimeNowSeconds(); auto rpm = Sensor::getOrZero(SensorType::Rpm); @@ -51,8 +51,8 @@ bool AcState::getAcState(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return acButtonState; } -bool AcState::updateAc(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - bool isEnabled = getAcState(PASS_ENGINE_PARAMETER_SIGNATURE); +bool AcState::updateAc() { + bool isEnabled = getAcState(); enginePins.acRelay.setValue(isEnabled); diff --git a/firmware/controllers/actuators/ac_control.h b/firmware/controllers/actuators/ac_control.h index a3a1658901..13f9032c4e 100644 --- a/firmware/controllers/actuators/ac_control.h +++ b/firmware/controllers/actuators/ac_control.h @@ -6,8 +6,8 @@ class AcState final : public ac_control_s { public: // Returns true if AC is currently active - bool updateAc(DECLARE_ENGINE_PARAMETER_SIGNATURE); + bool updateAc(); private: - bool getAcState(DECLARE_ENGINE_PARAMETER_SIGNATURE); + bool getAcState(); }; diff --git a/firmware/controllers/actuators/alternator_controller.cpp b/firmware/controllers/actuators/alternator_controller.cpp index 6c4cbed5f2..9f9abbb870 100644 --- a/firmware/controllers/actuators/alternator_controller.cpp +++ b/firmware/controllers/actuators/alternator_controller.cpp @@ -130,7 +130,7 @@ void onConfigurationChangeAlternatorCallback(engine_configuration_s *previousCon shouldResetPid = !alternatorPid.isSame(&previousConfiguration->alternatorControl); } -void initAlternatorCtrl(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initAlternatorCtrl() { addConsoleAction("altinfo", showAltInfo); if (!isBrainPinValid(CONFIG(alternatorControlPin))) return; diff --git a/firmware/controllers/actuators/boost_control.cpp b/firmware/controllers/actuators/boost_control.cpp index e524d10bda..18381222da 100644 --- a/firmware/controllers/actuators/boost_control.cpp +++ b/firmware/controllers/actuators/boost_control.cpp @@ -143,7 +143,7 @@ void BoostController::setOutput(expected output) { m_pwm->setSimplePwmDutyCycle(duty); } - setEtbWastegatePosition(percent PASS_ENGINE_PARAMETER_SUFFIX); + setEtbWastegatePosition(percent); } void BoostController::update() { @@ -162,7 +162,7 @@ void updateBoostControl() { } } -void setDefaultBoostParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setDefaultBoostParameters() { engineConfiguration->boostPwmFrequency = 33; engineConfiguration->boostPid.offset = 0; engineConfiguration->boostPid.pFactor = 0.5; @@ -210,7 +210,7 @@ void onConfigurationChangeBoostCallback(engine_configuration_s *previousConfigur boostController.onConfigurationChange(&previousConfiguration->boostPid); } -void initBoostCtrl(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initBoostCtrl() { // todo: why do we have 'isBoostControlEnabled' setting exactly? // 'initAuxPid' is an example of a subsystem without explicit enable if (!CONFIG(isBoostControlEnabled)) { diff --git a/firmware/controllers/actuators/boost_control.h b/firmware/controllers/actuators/boost_control.h index 77f2d44b5c..9e7734b4db 100644 --- a/firmware/controllers/actuators/boost_control.h +++ b/firmware/controllers/actuators/boost_control.h @@ -42,8 +42,8 @@ private: }; void startBoostPin(); -void initBoostCtrl(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void setDefaultBoostParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void initBoostCtrl(); +void setDefaultBoostParameters(); void onConfigurationChangeBoostCallback(engine_configuration_s *previousConfiguration); void updateBoostControl(); diff --git a/firmware/controllers/actuators/dc_motors.cpp b/firmware/controllers/actuators/dc_motors.cpp index 0f0c0fcd10..d92f1d31c9 100644 --- a/firmware/controllers/actuators/dc_motors.cpp +++ b/firmware/controllers/actuators/dc_motors.cpp @@ -114,7 +114,7 @@ public: static DcHardware dcHardware[ETB_COUNT + DC_PER_STEPPER]; -DcMotor* initDcMotor(const dc_io& io, size_t index, bool useTwoWires DECLARE_ENGINE_PARAMETER_SUFFIX) { +DcMotor* initDcMotor(const dc_io& io, size_t index, bool useTwoWires) { auto& hw = dcHardware[index]; hw.start( diff --git a/firmware/controllers/actuators/dc_motors.h b/firmware/controllers/actuators/dc_motors.h index 912219fb69..9e82f29527 100644 --- a/firmware/controllers/actuators/dc_motors.h +++ b/firmware/controllers/actuators/dc_motors.h @@ -11,7 +11,7 @@ class DcMotor; -DcMotor* initDcMotor(const dc_io& io, size_t index, bool useTwoWires DECLARE_ENGINE_PARAMETER_SUFFIX); +DcMotor* initDcMotor(const dc_io& io, size_t index, bool useTwoWires); // Manual control of motors for use by console commands void setDcMotorFrequency(size_t index, int hz); diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index 891c737f5e..be58232ffd 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -102,7 +102,7 @@ static const float hardCodedetbHitachiBiasBins[8] = {0.0, 19.0, 21.0, 22.0, 23.0 static const float hardCodedetbHitachiBiasValues[8] = {-18.0, -17.0, -15.0, 0.0, 16.0, 20.0, 20.0, 20.0}; /* Generated by TS2C on Thu Aug 20 21:10:02 EDT 2020*/ -void setHitachiEtbBiasBins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setHitachiEtbBiasBins() { copyArray(engineConfiguration->etbBiasBins, hardCodedetbHitachiBiasBins); copyArray(engineConfiguration->etbBiasValues, hardCodedetbHitachiBiasValues); } @@ -703,7 +703,7 @@ static void showEthInfo() { #endif /* EFI_PROD_CODE */ } -static void etbPidReset(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void etbPidReset() { for (int i = 0 ; i < ETB_COUNT; i++) { if (auto controller = engine->etbControllers[i]) { controller->reset(); @@ -813,7 +813,7 @@ static const float boschBiasValues[] = { -15, -15, -10, 0, 19, 20, 26, 28 }; -void setBoschVAGETB(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setBoschVAGETB() { // set tps_min 890 engineConfiguration->tpsMin = 890; // convert 12to10 bit (ADC/4) // set tps_max 70 @@ -828,12 +828,12 @@ void setBoschVAGETB(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->etb.offset = 0; } -void setBoschVNH2SP30Curve(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setBoschVNH2SP30Curve() { copyArray(CONFIG(etbBiasBins), boschBiasBins); copyArray(CONFIG(etbBiasValues), boschBiasValues); } -void setDefaultEtbParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setDefaultEtbParameters() { CONFIG(etbIdleThrottleRange) = 5; setLinearCurve(config->pedalToTpsPedalBins, /*from*/0, /*to*/100, 1); @@ -900,7 +900,7 @@ static const float defaultBiasValues[] = { -20, -18, -17, 0, 20, 21, 22, 25 }; -void setDefaultEtbBiasCurve(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setDefaultEtbBiasCurve() { copyArray(CONFIG(etbBiasBins), defaultBiasBins); copyArray(CONFIG(etbBiasValues), defaultBiasValues); } @@ -909,14 +909,14 @@ void unregisterEtbPins() { // todo: we probably need an implementation here?! } -static pid_s* getEtbPidForFunction(etb_function_e function DECLARE_ENGINE_PARAMETER_SUFFIX) { +static pid_s* getEtbPidForFunction(etb_function_e function) { switch (function) { case ETB_Wastegate: return &CONFIG(etbWastegatePid); default: return &CONFIG(etb); } } -void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void doInitElectronicThrottle() { efiAssertVoid(OBD_PCM_Processor_Fault, engine->etbControllers != NULL, "etbControllers NULL"); #if EFI_PROD_CODE addConsoleAction("ethinfo", showEthInfo); @@ -925,7 +925,7 @@ void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // this command is useful for real hardware test with known cheap hardware addConsoleAction("etb_test_hw", [](){ - set18919_AM810_pedal_position_sensor(PASS_CONFIG_PARAMETER_SIGNATURE); + set18919_AM810_pedal_position_sensor(); }); #endif /* EFI_PROD_CODE */ @@ -943,7 +943,7 @@ void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // do not touch HW pins if function not selected, this way Lua can use DC motor hardware pins directly continue; } - auto motor = initDcMotor(engineConfiguration->etbIo[i], i, CONFIG(etb_use_two_wires) PASS_ENGINE_PARAMETER_SUFFIX); + auto motor = initDcMotor(engineConfiguration->etbIo[i], i, CONFIG(etb_use_two_wires)); // If this motor is actually set up, init the etb if (motor) @@ -953,10 +953,10 @@ void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { continue; } - auto pid = getEtbPidForFunction(func PASS_ENGINE_PARAMETER_SUFFIX); + auto pid = getEtbPidForFunction(func); anyEtbConfigured |= controller->init(func, motor, pid, &pedal2tpsMap, shouldInitThrottles); - engine->etbControllers[i]->inject(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->etbControllers[i]->inject(); } } @@ -971,7 +971,7 @@ void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } #if 0 && ! EFI_UNIT_TEST - percent_t startupThrottlePosition = getTPS(PASS_ENGINE_PARAMETER_SIGNATURE); + percent_t startupThrottlePosition = getTPS(); if (absF(startupThrottlePosition - engineConfiguration->etbNeutralPosition) > STARTUP_NEUTRAL_POSITION_ERROR_THRESHOLD) { /** * Unexpected electronic throttle start-up position is worth a critical error @@ -988,7 +988,7 @@ void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif } -void initElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initElectronicThrottle() { if (hasFirmwareError()) { return; } @@ -999,10 +999,10 @@ void initElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } #endif - doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE); + doInitElectronicThrottle(); } -void setEtbIdlePosition(percent_t pos DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setEtbIdlePosition(percent_t pos) { if (!Sensor::hasSensor(SensorType::AcceleratorPedal)) { firmwareError(CUSTOM_NO_ETB_FOR_IDLE, "ETB idle does not work with unhappy accelerator pedal."); return; @@ -1015,7 +1015,7 @@ void setEtbIdlePosition(percent_t pos DECLARE_ENGINE_PARAMETER_SUFFIX) { } } -void setEtbWastegatePosition(percent_t pos DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setEtbWastegatePosition(percent_t pos) { for (int i = 0; i < ETB_COUNT; i++) { if (auto etb = engine->etbControllers[i]) { etb->setWastegatePosition(pos); @@ -1023,24 +1023,24 @@ void setEtbWastegatePosition(percent_t pos DECLARE_ENGINE_PARAMETER_SUFFIX) { } } -void set18919_AM810_pedal_position_sensor(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void set18919_AM810_pedal_position_sensor() { engineConfiguration->throttlePedalUpVoltage = 0.1; engineConfiguration->throttlePedalWOTVoltage = 4.5; engineConfiguration->throttlePedalSecondaryUpVoltage = 0.1; engineConfiguration->throttlePedalSecondaryWOTVoltage = 2.2; } -void setToyota89281_33010_pedal_position_sensor(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setToyota89281_33010_pedal_position_sensor() { engineConfiguration->throttlePedalUpVoltage = 0; engineConfiguration->throttlePedalWOTVoltage = 4.1; engineConfiguration->throttlePedalSecondaryUpVoltage = 0.73; engineConfiguration->throttlePedalSecondaryWOTVoltage = 4.9; } -void setHitachiEtbCalibration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setToyota89281_33010_pedal_position_sensor(PASS_CONFIG_PARAMETER_SIGNATURE); +void setHitachiEtbCalibration() { + setToyota89281_33010_pedal_position_sensor(); - setHitachiEtbBiasBins(PASS_CONFIG_PARAMETER_SIGNATURE); + setHitachiEtbBiasBins(); engineConfiguration->etb.pFactor = 2.7999; engineConfiguration->etb.iFactor = 25.5; @@ -1057,8 +1057,8 @@ void setHitachiEtbCalibration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { CONFIG(tps1SecondaryMax) = CONFIG(tps2SecondaryMax) = 161; } -void setProteusHitachiEtbDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setHitachiEtbCalibration(PASS_CONFIG_PARAMETER_SIGNATURE); +void setProteusHitachiEtbDefaults() { + setHitachiEtbCalibration(); // EFI_ADC_12: "Analog Volt 3" engineConfiguration->tps1_2AdcChannel = EFI_ADC_12; diff --git a/firmware/controllers/actuators/electronic_throttle.h b/firmware/controllers/actuators/electronic_throttle.h index ecbbb179f5..5c424164d5 100644 --- a/firmware/controllers/actuators/electronic_throttle.h +++ b/firmware/controllers/actuators/electronic_throttle.h @@ -11,22 +11,22 @@ #include "closed_loop_controller.h" #include "rusefi_types.h" -void initElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void doInitElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initElectronicThrottle(); +void doInitElectronicThrottle(); -void setEtbIdlePosition(percent_t pos DECLARE_ENGINE_PARAMETER_SUFFIX); -void setEtbWastegatePosition(percent_t pos DECLARE_ENGINE_PARAMETER_SUFFIX); -void setHitachiEtbCalibration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setEtbIdlePosition(percent_t pos); +void setEtbWastegatePosition(percent_t pos); +void setHitachiEtbCalibration(); // these two sensors use same plug but have different calibrations and even rotate in different directions -void set18919_AM810_pedal_position_sensor(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setToyota89281_33010_pedal_position_sensor(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void set18919_AM810_pedal_position_sensor(); +void setToyota89281_33010_pedal_position_sensor(); -void setBoschVAGETB(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setBoschVAGETB(); -void setDefaultEtbBiasCurve(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setDefaultEtbParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setBoschVNH2SP30Curve(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setDefaultEtbBiasCurve(); +void setDefaultEtbParameters(); +void setBoschVNH2SP30Curve(); void setEtbPFactor(float value); void setEtbIFactor(float value); void setEtbDFactor(float value); @@ -34,7 +34,7 @@ void setEtbOffset(int value); void setThrottleDutyCycle(percent_t level); void onConfigurationChangeElectronicThrottleCallback(engine_configuration_s *previousConfiguration); void unregisterEtbPins(); -void setProteusHitachiEtbDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setProteusHitachiEtbDefaults(); void etbAutocal(size_t throttleIndex); diff --git a/firmware/controllers/actuators/fan_control.cpp b/firmware/controllers/actuators/fan_control.cpp index 4fbdf6b457..09723bceef 100644 --- a/firmware/controllers/actuators/fan_control.cpp +++ b/firmware/controllers/actuators/fan_control.cpp @@ -4,7 +4,7 @@ #include "bench_test.h" -static void fanControl(bool acActive, OutputPin& pin, int8_t fanOnTemp, int8_t fanOffTemp, bool enableWithAc, bool disableWhenStopped DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void fanControl(bool acActive, OutputPin& pin, int8_t fanOnTemp, int8_t fanOffTemp, bool enableWithAc, bool disableWhenStopped) { auto [cltValid, clt] = Sensor::get(SensorType::Clt); bool isCranking = ENGINE(rpmCalculator).isCranking(); @@ -32,13 +32,13 @@ static void fanControl(bool acActive, OutputPin& pin, int8_t fanOnTemp, int8_t f } } -void updateFans(bool acActive DECLARE_ENGINE_PARAMETER_SUFFIX) { +void updateFans(bool acActive) { #if EFI_PROD_CODE if (isRunningBenchTest()) { return; // let's not mess with bench testing } #endif - fanControl(acActive, enginePins.fanRelay, CONFIG(fanOnTemperature), CONFIG(fanOffTemperature), CONFIG(enableFan1WithAc), CONFIG(disableFan1WhenStopped) PASS_ENGINE_PARAMETER_SUFFIX); - fanControl(acActive, enginePins.fanRelay2, CONFIG(fan2OnTemperature), CONFIG(fan2OffTemperature), CONFIG(enableFan2WithAc), CONFIG(disableFan2WhenStopped) PASS_ENGINE_PARAMETER_SUFFIX); + fanControl(acActive, enginePins.fanRelay, CONFIG(fanOnTemperature), CONFIG(fanOffTemperature), CONFIG(enableFan1WithAc), CONFIG(disableFan1WhenStopped)); + fanControl(acActive, enginePins.fanRelay2, CONFIG(fan2OnTemperature), CONFIG(fan2OffTemperature), CONFIG(enableFan2WithAc), CONFIG(disableFan2WhenStopped)); } diff --git a/firmware/controllers/actuators/fan_control.h b/firmware/controllers/actuators/fan_control.h index dc5a1046e7..71bb1e2291 100644 --- a/firmware/controllers/actuators/fan_control.h +++ b/firmware/controllers/actuators/fan_control.h @@ -2,4 +2,4 @@ #include "engine_ptr.h" -void updateFans(bool acActive DECLARE_ENGINE_PARAMETER_SUFFIX); +void updateFans(bool acActive); diff --git a/firmware/controllers/actuators/gppwm/gppwm.cpp b/firmware/controllers/actuators/gppwm/gppwm.cpp index 13a10b5f2f..5e1fced4d0 100644 --- a/firmware/controllers/actuators/gppwm/gppwm.cpp +++ b/firmware/controllers/actuators/gppwm/gppwm.cpp @@ -19,7 +19,7 @@ static gppwm_Map3D_t* tables[] = { &table4, }; -void initGpPwm(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initGpPwm() { for (size_t i = 0; i < efi::size(channels); i++) { auto& cfg = CONFIG(gppwm)[i]; @@ -42,7 +42,7 @@ void initGpPwm(DECLARE_ENGINE_PARAMETER_SIGNATURE) { tables[i]->init(cfg.table, cfg.loadBins, cfg.rpmBins); // Finally configure the channel - channels[i].inject(PASS_ENGINE_PARAMETER_SIGNATURE); + channels[i].inject(); channels[i].init(usePwm, &outputs[i], &pins[i], tables[i], &cfg); } } diff --git a/firmware/controllers/actuators/gppwm/gppwm.h b/firmware/controllers/actuators/gppwm/gppwm.h index 2fa2b7a4de..559344ecde 100644 --- a/firmware/controllers/actuators/gppwm/gppwm.h +++ b/firmware/controllers/actuators/gppwm/gppwm.h @@ -2,5 +2,5 @@ #include "engine_ptr.h" -void initGpPwm(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initGpPwm(); void updateGppwm(); diff --git a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp index e8c8e4088c..ccb6534886 100644 --- a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp +++ b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp @@ -6,7 +6,7 @@ #include "table_helper.h" #include "expected.h" -expected readGppwmChannel(gppwm_channel_e channel DECLARE_ENGINE_PARAMETER_SUFFIX) { +expected readGppwmChannel(gppwm_channel_e channel) { switch (channel) { case GPPWM_Tps: return Sensor::get(SensorType::Tps1); @@ -17,9 +17,9 @@ expected readGppwmChannel(gppwm_channel_e channel DECLARE_ENGINE_PARAMETE case GPPWM_Iat: return Sensor::get(SensorType::Iat); case GPPWM_FuelLoad: - return getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE); + return getFuelingLoad(); case GPPWM_IgnLoad: - return getIgnitionLoad(PASS_ENGINE_PARAMETER_SIGNATURE); + return getIgnitionLoad(); case GPPWM_AuxTemp1: return Sensor::get(SensorType::AuxTemp1); case GPPWM_AuxTemp2: @@ -71,7 +71,7 @@ void GppwmChannel::init(bool usePwm, IPwm* pwm, OutputPin* outputPin, const Valu } percent_t GppwmChannel::getOutput() const { - expected loadAxisValue = readGppwmChannel(m_config->loadAxis PASS_ENGINE_PARAMETER_SUFFIX); + expected loadAxisValue = readGppwmChannel(m_config->loadAxis); // If we couldn't get load axis value, fall back on error value if (!loadAxisValue) { diff --git a/firmware/controllers/actuators/idle_hardware.cpp b/firmware/controllers/actuators/idle_hardware.cpp index 5f87604c6c..626bf40e61 100644 --- a/firmware/controllers/actuators/idle_hardware.cpp +++ b/firmware/controllers/actuators/idle_hardware.cpp @@ -25,7 +25,7 @@ StepperMotor iacMotor CCM_OPTIONAL; static SimplePwm idleSolenoidOpen("idle open"); static SimplePwm idleSolenoidClose("idle close"); -void applyIACposition(percent_t position DECLARE_ENGINE_PARAMETER_SUFFIX) { +void applyIACposition(percent_t position) { /** * currently idle level is an percent value (0-100 range), and PWM takes a float in the 0..1 range * todo: unify? @@ -34,7 +34,7 @@ void applyIACposition(percent_t position DECLARE_ENGINE_PARAMETER_SUFFIX) { if (CONFIG(useETBforIdleControl)) { #if EFI_ELECTRONIC_THROTTLE_BODY - setEtbIdlePosition(position PASS_ENGINE_PARAMETER_SUFFIX); + setEtbIdlePosition(position); #endif // EFI_ELECTRONIC_THROTTLE_BODY #if ! EFI_UNIT_TEST } else if (CONFIG(useStepperIdle)) { @@ -77,7 +77,7 @@ bool isIdleHardwareRestartNeeded() { isConfigurationChanged(secondSolenoidPin); } -bool isIdleMotorBusy(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +bool isIdleMotorBusy() { if (!CONFIG(useStepperIdle)) { // todo: check other motor types? return false; @@ -85,13 +85,13 @@ bool isIdleMotorBusy(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return iacMotor.isBusy(); } -void initIdleHardware(DECLARE_ENGINE_PARAMETER_SUFFIX) { +void initIdleHardware() { if (CONFIG(useStepperIdle)) { StepperHw* hw; if (CONFIG(useHbridgesToDriveIdleStepper)) { - auto motorA = initDcMotor(engineConfiguration->stepperDcIo[0], 2, /*useTwoWires*/ true PASS_ENGINE_PARAMETER_SUFFIX); - auto motorB = initDcMotor(engineConfiguration->stepperDcIo[1], 3, /*useTwoWires*/ true PASS_ENGINE_PARAMETER_SUFFIX); + auto motorA = initDcMotor(engineConfiguration->stepperDcIo[0], 2, /*useTwoWires*/ true); + auto motorB = initDcMotor(engineConfiguration->stepperDcIo[1], 3, /*useTwoWires*/ true); if (motorA && motorB) { iacHbridgeHw.initialize( diff --git a/firmware/controllers/actuators/idle_hardware.h b/firmware/controllers/actuators/idle_hardware.h index e0f3b693a0..04d46514f7 100644 --- a/firmware/controllers/actuators/idle_hardware.h +++ b/firmware/controllers/actuators/idle_hardware.h @@ -9,6 +9,6 @@ #pragma once -void initIdleHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initIdleHardware(); bool isIdleHardwareRestartNeeded(); -bool isIdleMotorBusy(DECLARE_ENGINE_PARAMETER_SIGNATURE); +bool isIdleMotorBusy(); diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 337aa37058..94e410ff73 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -49,7 +49,7 @@ static PidIndustrial industrialWithOverrideIdlePid; static PidCic idleCicPid; #endif //EFI_IDLE_PID_CIC -Pid * getIdlePid(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +Pid * getIdlePid() { #if EFI_IDLE_PID_CIC if (CONFIG(useCicPidForIdle)) { return &idleCicPid; @@ -66,7 +66,7 @@ void idleDebug(const char *msg, percent_t value) { efiPrintf("idle debug: %s%.2f", msg, value); } -static void showIdleInfo(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void showIdleInfo() { const char * idleModeStr = getIdle_mode_e(engineConfiguration->idleMode); efiPrintf("useStepperIdle=%s useHbridges=%s", boolToString(CONFIG(useStepperIdle)), boolToString(CONFIG(useHbridgesToDriveIdleStepper))); @@ -103,11 +103,11 @@ static void showIdleInfo(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } if (engineConfiguration->idleMode == IM_AUTO) { - getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE)->showPidStatus("idle"); + getIdlePid()->showPidStatus("idle"); } } -void setIdleMode(idle_mode_e value DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setIdleMode(idle_mode_e value) { engineConfiguration->idleMode = value ? IM_AUTO : IM_MANUAL; showIdleInfo(); } @@ -280,12 +280,12 @@ static void blipIdle(int idlePosition, int durationMs) { #endif // EFI_UNIT_TEST } -static void finishIdleTestIfNeeded(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void finishIdleTestIfNeeded() { if (engine->timeToStopIdleTest != 0 && getTimeNowUs() > engine->timeToStopIdleTest) engine->timeToStopIdleTest = 0; } -static void undoIdleBlipIfNeeded(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void undoIdleBlipIfNeeded() { if (engine->timeToStopBlip != 0 && getTimeNowUs() > engine->timeToStopBlip) { engine->timeToStopBlip = 0; } @@ -295,7 +295,7 @@ static void undoIdleBlipIfNeeded(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * @return idle valve position percentage for automatic closed loop mode */ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos, int rpm, int targetRpm) { - auto idlePid = getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE); + auto idlePid = getIdlePid(); if (engine->idle.shouldResetPid) { // we reset only if I-term is negative, because the positive I-term is good - it keeps RPM from dropping too low @@ -366,7 +366,7 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos, // Apply PID Multiplier if used if (CONFIG(useIacPidMultTable)) { - float engineLoad = getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE); + float engineLoad = getFuelingLoad(); float multCoef = iacPidMultMap.getValue(rpm / RPM_1_BYTE_PACKING_MULT, engineLoad); // PID can be completely disabled of multCoef==0, or it just works as usual if multCoef==1 newValue = interpolateClamped(0, 0, 1, newValue, multCoef); @@ -395,8 +395,8 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos, * @see stepper.cpp */ - getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE)->iTermMin = engineConfiguration->idlerpmpid_iTermMin; - getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE)->iTermMax = engineConfiguration->idlerpmpid_iTermMax; + getIdlePid()->iTermMin = engineConfiguration->idlerpmpid_iTermMin; + getIdlePid()->iTermMax = engineConfiguration->idlerpmpid_iTermMax; // On failed sensor, use 0 deg C - should give a safe highish idle @@ -426,11 +426,11 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos, if (engineConfiguration->isVerboseIAC && isAutomaticIdle) { efiPrintf("Idle state %s", getIdle_state_e(engine->idle.idleState)); - getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE)->showPidStatus("idle"); + getIdlePid()->showPidStatus("idle"); } - finishIdleTestIfNeeded(PASS_ENGINE_PARAMETER_SIGNATURE); - undoIdleBlipIfNeeded(PASS_ENGINE_PARAMETER_SIGNATURE); + finishIdleTestIfNeeded(); + undoIdleBlipIfNeeded(); percent_t iacPosition; @@ -457,7 +457,7 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos, if (engineConfiguration->debugMode == DBG_IDLE_CONTROL) { if (engineConfiguration->idleMode == IM_AUTO) { // see also tsOutputChannels->idlePosition - getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE)->postState(&tsOutputChannels, 1000000); + getIdlePid()->postState(&tsOutputChannels, 1000000); tsOutputChannels.debugIntField4 = engine->idle.idleState; } else { tsOutputChannels.debugFloatField1 = iacPosition; @@ -474,7 +474,7 @@ float IdleController::getClosedLoop(IIdleController::Phase phase, float tpsPos, void IdleController::update() { float position = getIdlePosition(); - applyIACposition(position PASS_ENGINE_PARAMETER_SUFFIX); + applyIACposition(position); } IdleController idleControllerInstance; @@ -492,12 +492,12 @@ bool isIdlingOrTaper() { return idleControllerInstance.isIdlingOrTaper(); } -static void applyPidSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE)->updateFactors(engineConfiguration->idleRpmPid.pFactor, engineConfiguration->idleRpmPid.iFactor, engineConfiguration->idleRpmPid.dFactor); +static void applyPidSettings() { + getIdlePid()->updateFactors(engineConfiguration->idleRpmPid.pFactor, engineConfiguration->idleRpmPid.iFactor, engineConfiguration->idleRpmPid.dFactor); iacPidMultMap.init(CONFIG(iacPidMultTable), CONFIG(iacPidMultLoadBins), CONFIG(iacPidMultRpmBins)); } -void setDefaultIdleParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setDefaultIdleParameters() { engineConfiguration->idleRpmPid.pFactor = 0.1f; engineConfiguration->idleRpmPid.iFactor = 0.05f; engineConfiguration->idleRpmPid.dFactor = 0.0f; @@ -521,12 +521,12 @@ void setDefaultIdleParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #if ! EFI_UNIT_TEST void onConfigurationChangeIdleCallback(engine_configuration_s *previousConfiguration) { - engine->idle.shouldResetPid = !getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE)->isSame(&previousConfiguration->idleRpmPid); + engine->idle.shouldResetPid = !getIdlePid()->isSame(&previousConfiguration->idleRpmPid); engine->idle.mustResetPid = engine->idle.shouldResetPid; } void setTargetIdleRpm(int value) { - setTargetRpmCurve(value PASS_ENGINE_PARAMETER_SUFFIX); + setTargetRpmCurve(value); efiPrintf("target idle RPM %d", value); showIdleInfo(); } @@ -565,19 +565,19 @@ void startIdleBench(void) { #endif /* EFI_UNIT_TEST */ -void startIdleThread(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - idleControllerInstance.inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void startIdleThread() { + idleControllerInstance.inject(); idleControllerInstance.init(&CONFIG(idleTimingPid)); - industrialWithOverrideIdlePid.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + industrialWithOverrideIdlePid.inject(); ENGINE(idleController) = &idleControllerInstance; - getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE)->initPidClass(&engineConfiguration->idleRpmPid); + getIdlePid()->initPidClass(&engineConfiguration->idleRpmPid); #if ! EFI_UNIT_TEST // todo: we still have to explicitly init all hardware on start in addition to handling configuration change via // 'applyNewHardwareSettings' todo: maybe unify these two use-cases? - initIdleHardware(PASS_ENGINE_PARAMETER_SIGNATURE); + initIdleHardware(); #endif /* EFI_UNIT_TEST */ engine->idle.idleState = INIT; @@ -595,12 +595,12 @@ void startIdleThread(DECLARE_ENGINE_PARAMETER_SIGNATURE) { addConsoleAction("idlebench", startIdleBench); #endif /* EFI_UNIT_TEST */ - applyPidSettings(PASS_ENGINE_PARAMETER_SIGNATURE); + applyPidSettings(); } #endif /* EFI_IDLE_CONTROL */ -void startPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void startPedalPins() { #if EFI_PROD_CODE // this is neutral/no gear switch input. on Miata it's wired both to clutch pedal and neutral in gearbox // this switch is not used yet @@ -626,9 +626,9 @@ void startPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif /* EFI_PROD_CODE */ } -void stopPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - brain_pin_markUnused(activeConfiguration.clutchUpPin PASS_ENGINE_PARAMETER_SUFFIX); - brain_pin_markUnused(activeConfiguration.clutchDownPin PASS_ENGINE_PARAMETER_SUFFIX); - brain_pin_markUnused(activeConfiguration.throttlePedalUpPin PASS_ENGINE_PARAMETER_SUFFIX); - brain_pin_markUnused(activeConfiguration.brakePedalPin PASS_ENGINE_PARAMETER_SUFFIX); +void stopPedalPins() { + brain_pin_markUnused(activeConfiguration.clutchUpPin); + brain_pin_markUnused(activeConfiguration.clutchDownPin); + brain_pin_markUnused(activeConfiguration.throttlePedalUpPin); + brain_pin_markUnused(activeConfiguration.brakePedalPin); } diff --git a/firmware/controllers/actuators/idle_thread.h b/firmware/controllers/actuators/idle_thread.h index aedff28363..8d1542a42d 100644 --- a/firmware/controllers/actuators/idle_thread.h +++ b/firmware/controllers/actuators/idle_thread.h @@ -79,20 +79,20 @@ float getIdleTimingAdjustment(int rpm); bool isIdlingOrTaper(); -void applyIACposition(percent_t position DECLARE_ENGINE_PARAMETER_SUFFIX); +void applyIACposition(percent_t position); void setManualIdleValvePosition(int positionPercent); -void startIdleThread(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void setDefaultIdleParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void startIdleThread(); +void setDefaultIdleParameters(); void startIdleBench(void); void setIdleOffset(float value); void setIdlePFactor(float value); void setIdleIFactor(float value); void setIdleDFactor(float value); -void setIdleMode(idle_mode_e value DECLARE_ENGINE_PARAMETER_SUFFIX); +void setIdleMode(idle_mode_e value); void setTargetIdleRpm(int value); void onConfigurationChangeIdleCallback(engine_configuration_s *previousConfiguration); -Pid * getIdlePid(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void startPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void stopPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); +Pid * getIdlePid(); +void startPedalPins(); +void stopPedalPins(); diff --git a/firmware/controllers/actuators/vvt.cpp b/firmware/controllers/actuators/vvt.cpp index 77546009c8..902c64bb3e 100644 --- a/firmware/controllers/actuators/vvt.cpp +++ b/firmware/controllers/actuators/vvt.cpp @@ -51,7 +51,7 @@ expected VvtController::observePlant() const { expected VvtController::getSetpoint() const { int rpm = GET_RPM(); - float load = getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE); + float load = getFuelingLoad(); float target = m_targetMap->getValue(rpm, load); #if EFI_TUNER_STUDIO @@ -140,7 +140,7 @@ void initAuxPid() { config->vvtTable2RpmBins); for (int i = 0;i < CAM_INPUTS_COUNT;i++) { - instances[i].inject(PASS_ENGINE_PARAMETER_SIGNATURE); + instances[i].inject(); int camIndex = i % CAMS_PER_BANK; int bankIndex = i / CAMS_PER_BANK; diff --git a/firmware/controllers/algo/accel_enrichment.cpp b/firmware/controllers/algo/accel_enrichment.cpp index d692b9ba5b..eeeb29b9f6 100644 --- a/firmware/controllers/algo/accel_enrichment.cpp +++ b/firmware/controllers/algo/accel_enrichment.cpp @@ -27,10 +27,10 @@ static tps_tps_Map3D_t tpsTpsMap; // todo: eliminate code duplication between these two methods! Some pointer magic would help. -floatms_t TpsAccelEnrichment::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +floatms_t TpsAccelEnrichment::getTpsEnrichment() { ScopePerf perf(PE::GetTpsEnrichment); - int maxDeltaIndex = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_SIGNATURE); + int maxDeltaIndex = getMaxDeltaIndex(); // FuelSchedule *fs = engineConfiguration->injectionEvents; percent_t tpsTo = cb.get(maxDeltaIndex); @@ -87,7 +87,7 @@ floatms_t TpsAccelEnrichment::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATUR return extraFuel; } -void TpsAccelEnrichment::onEngineCycleTps(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void TpsAccelEnrichment::onEngineCycleTps() { // we update values in handleFuel() directly by calling onNewValue() onUpdateInvocationCounter++; @@ -120,7 +120,7 @@ void TpsAccelEnrichment::onEngineCycleTps(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } } -int AccelEnrichment::getMaxDeltaIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +int AccelEnrichment::getMaxDeltaIndex() { int len = minI(cb.getSize(), cb.getCount()); if (len < 2) @@ -143,8 +143,8 @@ int AccelEnrichment::getMaxDeltaIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return resultIndex; } -float AccelEnrichment::getMaxDelta(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - int index = getMaxDeltaIndex(PASS_ENGINE_PARAMETER_SIGNATURE); +float AccelEnrichment::getMaxDelta() { + int index = getMaxDeltaIndex(); return (cb.get(index) - (cb.get(index - 1))); } @@ -170,7 +170,7 @@ void AccelEnrichment::setLength(int length) { cb.setSize(length); } -void AccelEnrichment::onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_SUFFIX) { +void AccelEnrichment::onNewValue(float currentValue) { cb.add(currentValue); } @@ -219,7 +219,7 @@ void updateAccelParameters() { #endif /* ! EFI_UNIT_TEST */ -void initAccelEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initAccelEnrichment() { tpsTpsMap.init(config->tpsTpsAccelTable, config->tpsTpsAccelFromRpmBins, config->tpsTpsAccelToRpmBins); #if ! EFI_UNIT_TEST diff --git a/firmware/controllers/algo/accel_enrichment.h b/firmware/controllers/algo/accel_enrichment.h index 2d9efb4306..9ffc6ff722 100644 --- a/firmware/controllers/algo/accel_enrichment.h +++ b/firmware/controllers/algo/accel_enrichment.h @@ -22,13 +22,13 @@ typedef Map3D tps class AccelEnrichment : public tps_accel_state_s { public: AccelEnrichment(); - int getMaxDeltaIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE); - float getMaxDelta(DECLARE_ENGINE_PARAMETER_SIGNATURE); + int getMaxDeltaIndex(); + float getMaxDelta(); void resetAE(); void setLength(int length); cyclic_buffer cb; - void onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_SUFFIX); + void onNewValue(float currentValue); int onUpdateInvocationCounter = 0; }; @@ -37,13 +37,13 @@ public: /** * @return Extra fuel squirt duration for TPS acceleration */ - floatms_t getTpsEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE); - void onEngineCycleTps(DECLARE_ENGINE_PARAMETER_SIGNATURE); + floatms_t getTpsEnrichment(); + void onEngineCycleTps(); void resetFractionValues(); void resetAE(); }; -void initAccelEnrichment(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initAccelEnrichment(); void setTpsAccelThr(float value); void setTpsDecelThr(float value); diff --git a/firmware/controllers/algo/advance_map.cpp b/firmware/controllers/algo/advance_map.cpp index 6dad8551a3..63cc4294ed 100644 --- a/firmware/controllers/algo/advance_map.cpp +++ b/firmware/controllers/algo/advance_map.cpp @@ -35,7 +35,7 @@ int minCrankingRpm = 0; /** * @return ignition timing angle advance before TDC */ -static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX) { +static angle_t getRunningAdvance(int rpm, float engineLoad) { if (CONFIG(timingMode) == TM_FIXED) { return engineConfiguration->fixedTiming; } @@ -77,7 +77,7 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME return advanceAngle; } -angle_t getAdvanceCorrections(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { +angle_t getAdvanceCorrections(int rpm) { float iatCorrection; const auto [iatValid, iat] = Sensor::get(SensorType::Iat); @@ -107,14 +107,14 @@ angle_t getAdvanceCorrections(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { /** * @return ignition timing angle advance before TDC for Cranking */ -static angle_t getCrankingAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX) { +static angle_t getCrankingAdvance(int rpm, float engineLoad) { // get advance from the separate table for Cranking if (CONFIG(useSeparateAdvanceForCranking)) { return interpolate2d(rpm, CONFIG(crankingAdvanceBins), CONFIG(crankingAdvance)); } // Interpolate the cranking timing angle to the earlier running angle for faster engine start - angle_t crankingToRunningTransitionAngle = getRunningAdvance(CONFIG(cranking.rpm), engineLoad PASS_ENGINE_PARAMETER_SUFFIX); + angle_t crankingToRunningTransitionAngle = getRunningAdvance(CONFIG(cranking.rpm), engineLoad); // interpolate not from zero, but starting from min. possible rpm detected if (rpm < minCrankingRpm || minCrankingRpm == 0) minCrankingRpm = rpm; @@ -122,7 +122,7 @@ static angle_t getCrankingAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAM } -angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX) { +angle_t getAdvance(int rpm, float engineLoad) { #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT if (cisnan(engineLoad)) { return 0; // any error should already be reported @@ -132,11 +132,11 @@ angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX) { bool isCranking = ENGINE(rpmCalculator).isCranking(); if (isCranking) { - angle = getCrankingAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER_SUFFIX); + angle = getCrankingAdvance(rpm, engineLoad); assertAngleRange(angle, "crAngle", CUSTOM_ERR_ANGLE_CR); efiAssert(CUSTOM_ERR_ASSERT, !cisnan(angle), "cr_AngleN", 0); } else { - angle = getRunningAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER_SUFFIX); + angle = getRunningAdvance(rpm, engineLoad); if (cisnan(angle)) { warning(CUSTOM_ERR_6610, "NaN angle from table"); @@ -150,7 +150,7 @@ angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX) { && (!isCranking || CONFIG(useAdvanceCorrectionsForCranking)); if (allowCorrections) { - angle_t correction = getAdvanceCorrections(rpm PASS_ENGINE_PARAMETER_SUFFIX); + angle_t correction = getAdvanceCorrections(rpm); if (!cisnan(correction)) { // correction could be NaN during settings update angle += correction; } @@ -164,7 +164,7 @@ angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX) { #endif } -size_t getMultiSparkCount(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { +size_t getMultiSparkCount(int rpm) { // Compute multispark (if enabled) if (CONFIG(multisparkEnable) && rpm <= CONFIG(multisparkMaxRpm) @@ -202,7 +202,7 @@ size_t getMultiSparkCount(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { } } -void initTimingMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initTimingMap() { // We init both tables in RAM because here we're at a very early stage, with no config settings loaded. advanceMap.init(config->ignitionTable, config->ignitionLoadBins, config->ignitionRpmBins); @@ -272,7 +272,7 @@ float getInitialAdvance(int rpm, float map, float advanceMax) { /** * this method builds a good-enough base timing advance map bases on a number of heuristics */ -void buildTimingMap(float advanceMax DECLARE_CONFIG_PARAMETER_SUFFIX) { +void buildTimingMap(float advanceMax) { if (engineConfiguration->fuelAlgorithm != LM_SPEED_DENSITY) { warning(CUSTOM_WRONG_ALGORITHM, "wrong algorithm for MAP-based timing"); return; diff --git a/firmware/controllers/algo/advance_map.h b/firmware/controllers/algo/advance_map.h index 2f37a18a10..21f565a74b 100644 --- a/firmware/controllers/algo/advance_map.h +++ b/firmware/controllers/algo/advance_map.h @@ -7,10 +7,10 @@ #pragma once -angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_SUFFIX); -void initTimingMap(DECLARE_ENGINE_PARAMETER_SIGNATURE); +angle_t getAdvance(int rpm, float engineLoad); +void initTimingMap(); float getTopAdvanceForBore(chamber_style_e style, int octane, double compression, double bore); float getInitialAdvance(int rpm, float map, float advanceMax); -void buildTimingMap(float advanceMax DECLARE_CONFIG_PARAMETER_SUFFIX); -angle_t getAdvanceCorrections(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); -size_t getMultiSparkCount(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); +void buildTimingMap(float advanceMax); +angle_t getAdvanceCorrections(int rpm); +size_t getMultiSparkCount(int rpm); diff --git a/firmware/controllers/algo/airmass/alphan_airmass.cpp b/firmware/controllers/algo/airmass/alphan_airmass.cpp index e0df6bf021..f8ca09ceff 100644 --- a/firmware/controllers/algo/airmass/alphan_airmass.cpp +++ b/firmware/controllers/algo/airmass/alphan_airmass.cpp @@ -18,7 +18,6 @@ AirmassResult AlphaNAirmass::getAirmass(int rpm) { ve, 101.325f, // std atmosphere pressure 273.0f + 20.0f // std atmosphere pressure - PASS_ENGINE_PARAMETER_SUFFIX ); return { diff --git a/firmware/controllers/algo/airmass/speed_density_airmass.cpp b/firmware/controllers/algo/airmass/speed_density_airmass.cpp index e8a0da8a74..214db5bfa2 100644 --- a/firmware/controllers/algo/airmass/speed_density_airmass.cpp +++ b/firmware/controllers/algo/airmass/speed_density_airmass.cpp @@ -17,7 +17,7 @@ AirmassResult SpeedDensityAirmass::getAirmass(int rpm) { float ve = getVe(rpm, map); - float airMass = getAirmassImpl(ve, map, tChargeK PASS_ENGINE_PARAMETER_SUFFIX); + float airMass = getAirmassImpl(ve, map, tChargeK); if (cisnan(airMass)) { warning(CUSTOM_ERR_6685, "NaN airMass"); return {}; diff --git a/firmware/controllers/algo/airmass/speed_density_base.cpp b/firmware/controllers/algo/airmass/speed_density_base.cpp index 37e0ef5314..1c23dc7cf1 100644 --- a/firmware/controllers/algo/airmass/speed_density_base.cpp +++ b/firmware/controllers/algo/airmass/speed_density_base.cpp @@ -23,7 +23,7 @@ float idealGasLaw(float volume, float pressure, float temperature) { return volume * pressure / (AIR_R * temperature); } -/*static*/ float SpeedDensityBase::getAirmassImpl(float ve, float manifoldPressure, float temperature DECLARE_ENGINE_PARAMETER_SUFFIX) { +/*static*/ float SpeedDensityBase::getAirmassImpl(float ve, float manifoldPressure, float temperature) { float cycleAir = ve * idealGasLaw(CONFIG(specs.displacement), manifoldPressure, temperature); return cycleAir / CONFIG(specs.cylindersCount); } diff --git a/firmware/controllers/algo/airmass/speed_density_base.h b/firmware/controllers/algo/airmass/speed_density_base.h index ab6a682f64..2a5322ee6a 100644 --- a/firmware/controllers/algo/airmass/speed_density_base.h +++ b/firmware/controllers/algo/airmass/speed_density_base.h @@ -18,5 +18,5 @@ protected: explicit SpeedDensityBase(const ValueProvider3D& veTable) : AirmassVeModelBase(veTable) {} public: - static float getAirmassImpl(float ve, float manifoldPressure, float temperature DECLARE_ENGINE_PARAMETER_SUFFIX); + static float getAirmassImpl(float ve, float manifoldPressure, float temperature); }; diff --git a/firmware/controllers/algo/defaults/default_base_engine.cpp b/firmware/controllers/algo/defaults/default_base_engine.cpp index 923940c275..b62a598bf0 100644 --- a/firmware/controllers/algo/defaults/default_base_engine.cpp +++ b/firmware/controllers/algo/defaults/default_base_engine.cpp @@ -2,7 +2,7 @@ #include "defaults.h" -static void setDefaultAlternatorParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultAlternatorParameters() { engineConfiguration->alternatorOffAboveTps = 120; engineConfiguration->targetVBatt = 14; @@ -12,7 +12,7 @@ static void setDefaultAlternatorParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->alternatorControl.periodMs = 100; } -void setDefaultBaseEngine(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setDefaultBaseEngine() { // Base Engine Settings engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.displacement = 2; @@ -46,7 +46,7 @@ void setDefaultBaseEngine(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->vbattDividerCoeff = ((float) (15 + 65)) / 15; #if EFI_ALTERNATOR_CONTROL - setDefaultAlternatorParameters(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultAlternatorParameters(); #endif /* EFI_ALTERNATOR_CONTROL */ // Fuel pump diff --git a/firmware/controllers/algo/defaults/default_cranking.cpp b/firmware/controllers/algo/defaults/default_cranking.cpp index 5321838245..7b76ac73f9 100644 --- a/firmware/controllers/algo/defaults/default_cranking.cpp +++ b/firmware/controllers/algo/defaults/default_cranking.cpp @@ -3,7 +3,7 @@ #include "defaults.h" #include "table_helper.h" -void setDefaultCranking(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setDefaultCranking() { engineConfiguration->cranking.rpm = 550; // Fuel diff --git a/firmware/controllers/algo/defaults/default_fuel.cpp b/firmware/controllers/algo/defaults/default_fuel.cpp index 5c01d2e2e4..cf8b5ea28a 100644 --- a/firmware/controllers/algo/defaults/default_fuel.cpp +++ b/firmware/controllers/algo/defaults/default_fuel.cpp @@ -4,7 +4,7 @@ #include "table_helper.h" #include "mazda_miata_vvt.h" -static void setBosch02880155868(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setBosch02880155868() { // http://www.boschdealer.com/specsheets/0280155868cs.jpg engineConfiguration->injector.battLagCorrBins[0] = 6; engineConfiguration->injector.battLagCorr[0] = 3.371; @@ -31,7 +31,7 @@ static void setBosch02880155868(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->injector.battLagCorr[7] = 0.726; } -static void setDefaultWarmupFuelEnrichment(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultWarmupFuelEnrichment() { static const float bins[] = { -40, @@ -77,7 +77,7 @@ static void setDefaultWarmupFuelEnrichment(DECLARE_CONFIG_PARAMETER_SIGNATURE) { copyArray(config->cltFuelCorr, values); } -static void setDefaultVETable(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultVETable() { setRpmTableBin(config->veRpmBins, FUEL_RPM_COUNT); setTable(config->veTable, 80); @@ -97,7 +97,7 @@ static void setDefaultVETable(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } } -static void setDefaultFuelCutParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultFuelCutParameters() { engineConfiguration->coastingFuelCutEnabled = false; engineConfiguration->coastingFuelCutRpmLow = 1300; engineConfiguration->coastingFuelCutRpmHigh = 1500; @@ -106,7 +106,7 @@ static void setDefaultFuelCutParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->coastingFuelCutClt = 30; } -static void setDefaultStftSettings(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultStftSettings() { auto& cfg = CONFIG(stft); // Default to disabled @@ -156,13 +156,13 @@ static const uint8_t tpsTpsTable[TPS_TPS_ACCEL_TABLE][TPS_TPS_ACCEL_TABLE] = { {/* 7 100 *//* 0 0.0*/37, /* 1 10.0*/35, /* 2 20.0*/32, /* 3 35.0*/28, /* 4 50.0*/23, /* 5 65.0*/17, /* 6 80.0*/10, /* 7 100.0*/0, }, }; -static void setMazdaMiataNbTpsTps(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setMazdaMiataNbTpsTps() { setLinearCurve(config->tpsTpsAccelFromRpmBins, 0, 100, 10); setLinearCurve(config->tpsTpsAccelToRpmBins, 0, 100, 10); copyTable(config->tpsTpsAccelTable, tpsTpsTable); } -static void setDefaultLambdaTable(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultLambdaTable() { static constexpr float mapBins[] = { 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 150, 175, 200, 225, 250 }; @@ -183,7 +183,7 @@ static void setDefaultLambdaTable(DECLARE_CONFIG_PARAMETER_SIGNATURE) { } } -void setDefaultFuel(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setDefaultFuel() { // Base injection configuration engineConfiguration->isInjectionEnabled = true; engineConfiguration->injectionMode = IM_SEQUENTIAL; @@ -198,14 +198,14 @@ void setDefaultFuel(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->stoichRatioSecondary = 9.0f; // Injector deadtime - setBosch02880155868(PASS_CONFIG_PARAMETER_SIGNATURE); + setBosch02880155868(); // Tables - setFuelTablesLoadBin(10, 160 PASS_CONFIG_PARAMETER_SUFFIX); + setFuelTablesLoadBin(10, 160); setRpmTableBin(config->injPhaseRpmBins, FUEL_RPM_COUNT); - setDefaultVETable(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultVETable(); setTable(config->injectionPhase, -180.0f); - setDefaultLambdaTable(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultLambdaTable(); // Charge temperature estimation engineConfiguration->tChargeMinRpmMinTps = 0.25; @@ -220,16 +220,16 @@ void setDefaultFuel(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->tChargeAirDecrLimit = 12.5f; // CLT correction table - setDefaultWarmupFuelEnrichment(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultWarmupFuelEnrichment(); // IAT correction table // TODO // Closed loop fuel correction - setDefaultStftSettings(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultStftSettings(); // Decel fuel cut - setDefaultFuelCutParameters(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultFuelCutParameters(); engineConfiguration->tpsAccelLength = 12; engineConfiguration->tpsAccelEnrichmentThreshold = 40; // TPS % change, per engine cycle @@ -241,7 +241,7 @@ void setDefaultFuel(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #endif // EFI_UNIT_TEST // TPS/TPS AE curve - setMazdaMiataNbTpsTps(PASS_CONFIG_PARAMETER_SIGNATURE); + setMazdaMiataNbTpsTps(); // AE load taper setLinearCurve(engineConfiguration->mapAccelTaperBins, 0, 32, 4); diff --git a/firmware/controllers/algo/defaults/default_ignition.cpp b/firmware/controllers/algo/defaults/default_ignition.cpp index f961a7883a..c3c34d3019 100644 --- a/firmware/controllers/algo/defaults/default_ignition.cpp +++ b/firmware/controllers/algo/defaults/default_ignition.cpp @@ -3,7 +3,7 @@ #include "defaults.h" #include "table_helper.h" -static void setDefaultMultisparkParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultMultisparkParameters() { // 1ms spark + 2ms dwell engineConfiguration->multisparkSparkDuration = 1000; engineConfiguration->multisparkDwell = 2000; @@ -16,7 +16,7 @@ static void setDefaultMultisparkParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { static constexpr float iatTimingRpmBins[] = { 880, 1260, 1640, 2020, 2400, 2780, 3000, 3380, 3760, 4140, 4520, 5000, 5700, 6500, 7200, 8000 }; -static void setDefaultIatTimingCorrection(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultIatTimingCorrection() { setLinearCurve(config->ignitionIatCorrLoadBins, /*from*/CLT_CURVE_RANGE_FROM, 110, 1); #if IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT copyArray(config->ignitionIatCorrRpmBins, iatTimingRpmBins); @@ -49,7 +49,7 @@ static void setDefaultIatTimingCorrection(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #endif /* IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT */ } -void setDefaultIgnition(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setDefaultIgnition() { // Ignition base settings CONFIG(isIgnitionEnabled) = true; @@ -57,15 +57,15 @@ void setDefaultIgnition(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->fixedModeTiming = 50; // Dwell table - setConstantDwell(4 PASS_CONFIG_PARAMETER_SUFFIX); + setConstantDwell(4); // Multispark - setDefaultMultisparkParameters(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultMultisparkParameters(); // Ignition advance table // TODO: populate some values that aren't all 0? - setTimingLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); - setTimingRpmBin(800, 7000 PASS_CONFIG_PARAMETER_SUFFIX); + setTimingLoadBin(1.2, 4.4); + setTimingRpmBin(800, 7000); engineConfiguration->trailingSparkAngle = 10; @@ -74,5 +74,5 @@ void setDefaultIgnition(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setArrayValues(engineConfiguration->cltTimingExtra, 0.0f); // IAT correction - setDefaultIatTimingCorrection(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultIatTimingCorrection(); } diff --git a/firmware/controllers/algo/defaults/defaults.h b/firmware/controllers/algo/defaults/defaults.h index f1352aba17..fea310c274 100644 --- a/firmware/controllers/algo/defaults/defaults.h +++ b/firmware/controllers/algo/defaults/defaults.h @@ -1,6 +1,6 @@ #include "engine_ptr.h" -void setDefaultBaseEngine(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setDefaultFuel(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setDefaultIgnition(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void setDefaultCranking(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setDefaultBaseEngine(); +void setDefaultFuel(); +void setDefaultIgnition(); +void setDefaultCranking(); diff --git a/firmware/controllers/algo/dynoview.cpp b/firmware/controllers/algo/dynoview.cpp index 05e0abe78d..ea498c515d 100644 --- a/firmware/controllers/algo/dynoview.cpp +++ b/firmware/controllers/algo/dynoview.cpp @@ -131,11 +131,11 @@ int DynoView::getEngineTorque() { } -float getDynoviewAcceleration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getDynoviewAcceleration() { return dynoInstance.getAcceleration(); } -int getDynoviewPower(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +int getDynoviewPower() { return dynoInstance.getEnginePower(); } @@ -143,10 +143,10 @@ int getDynoviewPower(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * Periodic update function called from SlowCallback. * Only updates if we have Vss from input pin. */ -void updateDynoView(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void updateDynoView() { if (isBrainPinValid(CONFIG(vehicleSpeedSensorInputPin)) && (!CONFIG(enableCanVss))) { - dynoInstance.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dynoInstance.inject(); dynoInstance.update(ICU); } } @@ -155,7 +155,7 @@ void updateDynoView(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * This function is called after every CAN msg received, we process it * as soon as we can to be more acurate. */ -void updateDynoViewCan(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void updateDynoViewCan() { if (!CONFIG(enableCanVss)) { return; } diff --git a/firmware/controllers/algo/dynoview.h b/firmware/controllers/algo/dynoview.h index 7b98438eaf..00b43dc707 100644 --- a/firmware/controllers/algo/dynoview.h +++ b/firmware/controllers/algo/dynoview.h @@ -9,10 +9,10 @@ #include "engine_ptr.h" -void updateDynoView(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void updateDynoViewCan(DECLARE_ENGINE_PARAMETER_SIGNATURE); -float getDynoviewAcceleration(DECLARE_ENGINE_PARAMETER_SIGNATURE); -int getDynoviewPower(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void updateDynoView(); +void updateDynoViewCan(); +float getDynoviewAcceleration(); +int getDynoviewPower(); typedef enum{ ICU = 0, diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 7b550e047f..9f54d69e4f 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -102,7 +102,7 @@ trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode) { } } -static void initVvtShape(int camIndex, TriggerState &initState DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void initVvtShape(int camIndex, TriggerState &initState) { vvt_mode_e vvtMode = engineConfiguration->vvtMode[camIndex]; TriggerWaveform *shape = &ENGINE(triggerCentral).vvtShape[camIndex]; @@ -128,9 +128,9 @@ static void initVvtShape(int camIndex, TriggerState &initState DECLARE_ENGINE_PA } -void Engine::initializeTriggerWaveform(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void Engine::initializeTriggerWaveform() { static TriggerState initState; - initState.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + initState.inject(); // Re-read config in case it's changed primaryTriggerConfiguration.update(); @@ -169,7 +169,7 @@ void Engine::initializeTriggerWaveform(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * #192 BUG real hardware trigger events could be coming even while we are initializing trigger */ calculateTriggerSynchPoint(ENGINE(triggerCentral.triggerShape), - initState PASS_ENGINE_PARAMETER_SUFFIX); + initState); ENGINE(triggerCentral.triggerState).name = "TRG"; engine->engineCycleEventCount = TRIGGER_WAVEFORM(getLength()); @@ -177,17 +177,17 @@ void Engine::initializeTriggerWaveform(DECLARE_ENGINE_PARAMETER_SIGNATURE) { for (int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) { - initVvtShape(camIndex, initState PASS_ENGINE_PARAMETER_SUFFIX); + initVvtShape(camIndex, initState); } if (!TRIGGER_WAVEFORM(shapeDefinitionError)) { - prepareOutputSignals(PASS_ENGINE_PARAMETER_SIGNATURE); + prepareOutputSignals(); } #endif /* EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT */ } -static void cylinderCleanupControl(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void cylinderCleanupControl() { #if EFI_ENGINE_CONTROL bool newValue; if (engineConfiguration->isCylinderCleanupEnabled) { @@ -210,7 +210,7 @@ static void assertCloseTo(const char * msg, float actual, float expected) { } #endif // ANALOG_HW_CHECK_MODE -void Engine::periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void Engine::periodicSlowCallback() { ScopePerf perf(PE::EnginePeriodicSlowCallback); // Re-read config in case it's changed @@ -220,19 +220,19 @@ void Engine::periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } watchdog(); - updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE); - checkShutdown(PASS_ENGINE_PARAMETER_SIGNATURE); + updateSlowSensors(); + checkShutdown(); - updateVrPwm(PASS_ENGINE_PARAMETER_SIGNATURE); + updateVrPwm(); #if EFI_FSIO - runFsio(PASS_ENGINE_PARAMETER_SIGNATURE); + runFsio(); #else - runHardcodedFsio(PASS_ENGINE_PARAMETER_SIGNATURE); + runHardcodedFsio(); #endif /* EFI_FSIO */ - bool acActive = acState.updateAc(PASS_ENGINE_PARAMETER_SIGNATURE); - updateFans(acActive PASS_ENGINE_PARAMETER_SUFFIX); + bool acActive = acState.updateAc(); + updateFans(acActive); updateGppwm(); @@ -242,16 +242,16 @@ void Engine::periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { updateBoostControl(); #endif // EFI_BOOST_CONTROL - cylinderCleanupControl(PASS_ENGINE_PARAMETER_SIGNATURE); + cylinderCleanupControl(); - standardAirCharge = getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE); + standardAirCharge = getStandardAirCharge(); #if (BOARD_TLE8888_COUNT > 0) tle8888startup(); #endif #if EFI_DYNO_VIEW - updateDynoView(PASS_ENGINE_PARAMETER_SIGNATURE); + updateDynoView(); #endif slowCallBackWasInvoked = true; @@ -290,15 +290,15 @@ extern float vBattForTle8888; * We are executing these heavy (logarithm) methods from outside the trigger callbacks for performance reasons. * See also periodicFastCallback */ -void Engine::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - updateSwitchInputs(PASS_ENGINE_PARAMETER_SIGNATURE); +void Engine::updateSlowSensors() { + updateSwitchInputs(); #if EFI_ENGINE_CONTROL int rpm = GET_RPM(); isEngineChartEnabled = CONFIG(isEngineChartEnabled) && rpm < CONFIG(engineSnifferRpmThreshold); sensorChartMode = rpm < CONFIG(sensorSnifferRpmThreshold) ? CONFIG(sensorChartMode) : SC_OFF; - engineState.updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE); + engineState.updateSlowSensors(); #if (BOARD_TLE8888_COUNT > 0) // nasty value injection into C driver which would not be able to access Engine class @@ -311,14 +311,14 @@ void Engine::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif } -void Engine::updateSwitchInputs(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void Engine::updateSwitchInputs() { #if EFI_GPIO_HARDWARE // this value is not used yet if (isBrainPinValid(CONFIG(clutchDownPin))) { engine->clutchDownState = CONFIG(clutchDownPinInverted) ^ efiReadPin(CONFIG(clutchDownPin)); } - if (hasAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE)) { - bool result = getAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE); + if (hasAcToggle()) { + bool result = getAcToggle(); if (engine->acSwitchState != result) { engine->acSwitchState = result; engine->acSwitchLastChangeTime = getTimeNowUs(); @@ -372,7 +372,7 @@ void Engine::reset() { * Here we have a bunch of stuff which should invoked after configuration change * so that we can prepare some helper structures */ -void Engine::preCalculate(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void Engine::preCalculate() { #if EFI_TUNER_STUDIO // we take 2 bytes of crc32, no idea if it's right to call it crc16 or not // we have a hack here - we rely on the fact that engineMake is the first of three relevant fields @@ -448,7 +448,7 @@ void Engine::OnTriggerSyncronization(bool wasSynchronized) { engine->triggerErrorDetection.add(isDecodingError); - if (triggerCentral.isTriggerDecoderError(PASS_ENGINE_PARAMETER_SIGNATURE)) { + if (triggerCentral.isTriggerDecoderError()) { warning(CUSTOM_OBD_TRG_DECODING, "trigger decoding issue. expected %d/%d/%d got %d/%d/%d", TRIGGER_WAVEFORM(getExpectedEventCount(0)), TRIGGER_WAVEFORM(getExpectedEventCount(1)), @@ -463,23 +463,23 @@ void Engine::OnTriggerSyncronization(bool wasSynchronized) { #endif void Engine::injectEngineReferences() { - triggerCentral.inject(PASS_ENGINE_PARAMETER_SIGNATURE); - primaryTriggerConfiguration.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + triggerCentral.inject(); + primaryTriggerConfiguration.inject(); for (int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) { - vvtTriggerConfiguration[camIndex].inject(PASS_ENGINE_PARAMETER_SIGNATURE); + vvtTriggerConfiguration[camIndex].inject(); } - limpManager.inject(PASS_ENGINE_PARAMETER_SIGNATURE); - knockController.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + limpManager.inject(); + knockController.inject(); primaryTriggerConfiguration.update(); for (int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) { vvtTriggerConfiguration[camIndex].update(); } - triggerCentral.init(PASS_ENGINE_PARAMETER_SIGNATURE); + triggerCentral.init(); } -void Engine::setConfig(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void Engine::setConfig() { + inject(); efi::clear(config); injectEngineReferences(); @@ -519,7 +519,7 @@ void Engine::watchdog() { #endif } -void Engine::checkShutdown(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void Engine::checkShutdown() { #if EFI_MAIN_RELAY_CONTROL // if we are already in the "ignition_on" mode, then do nothing if (ignitionOnTimeNt > 0) { @@ -533,7 +533,7 @@ void Engine::checkShutdown(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // if the ignition key is turned on again, // we cancel the shutdown mode, but only if all shutdown procedures are complete const float vBattThresholdOn = 8.0f; - if ((Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE) > vBattThresholdOn) && !isInShutdownMode(PASS_ENGINE_PARAMETER_SIGNATURE)) { + if ((Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE) > vBattThresholdOn) && !isInShutdownMode()) { ignitionOnTimeNt = getTimeNowNt(); stopEngineRequestTimeNt = 0; efiPrintf("Ignition voltage detected! Cancel the engine shutdown!"); @@ -542,14 +542,14 @@ void Engine::checkShutdown(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif /* EFI_MAIN_RELAY_CONTROL */ } -bool Engine::isInMainRelayBench(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +bool Engine::isInMainRelayBench() { if (mainRelayBenchStartNt == 0) { return false; } return (getTimeNowNt() - mainRelayBenchStartNt) < NT_PER_SECOND; } -bool Engine::isInShutdownMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) const { +bool Engine::isInShutdownMode() const { #if EFI_MAIN_RELAY_CONTROL // if we are in "ignition_on" mode and not in shutdown mode if (stopEngineRequestTimeNt == 0 && ignitionOnTimeNt > 0) { @@ -579,13 +579,13 @@ bool Engine::isInShutdownMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) const { // The idle motor valve is still moving! Give it some time to park (but wait no more than 10 secs) // Usually it can move to the initial 'cranking' position or zero 'parking' position. const efitick_t idleMotorWaitTimeoutNt = 10 * NT_PER_SECOND; - if (isIdleMotorBusy(PASS_ENGINE_PARAMETER_SIGNATURE) && (getTimeNowNt() - stopEngineRequestTimeNt) < idleMotorWaitTimeoutNt) + if (isIdleMotorBusy() && (getTimeNowNt() - stopEngineRequestTimeNt) < idleMotorWaitTimeoutNt) return true; #endif /* EFI_MAIN_RELAY_CONTROL */ return false; } -bool Engine::isMainRelayEnabled(DECLARE_ENGINE_PARAMETER_SIGNATURE) const { +bool Engine::isMainRelayEnabled() const { #if EFI_MAIN_RELAY_CONTROL return enginePins.mainRelay.getLogicValue(); #else @@ -603,7 +603,7 @@ float Engine::getTimeIgnitionSeconds(void) const { return numSeconds; } -injection_mode_e Engine::getCurrentInjectionMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +injection_mode_e Engine::getCurrentInjectionMode() { return rpmCalculator.isCranking() ? CONFIG(crankingInjectionMode) : CONFIG(injectionMode); } @@ -618,7 +618,7 @@ static bool doesTriggerImplyOperationMode(trigger_type_e type) { && type != TT_TOOTHED_WHEEL_36_1; } -operation_mode_e Engine::getOperationMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +operation_mode_e Engine::getOperationMode() { /** * here we ignore user-provided setting for well known triggers. * For instance for Miata NA, there is no reason to allow user to set FOUR_STROKE_CRANK_SENSOR @@ -630,21 +630,21 @@ operation_mode_e Engine::getOperationMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * The idea of this method is to execute all heavy calculations in a lower-priority thread, * so that trigger event handler/IO scheduler tasks are faster. */ -void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void Engine::periodicFastCallback() { ScopePerf pc(PE::EnginePeriodicFastCallback); #if EFI_MAP_AVERAGING - refreshMapAveragingPreCalc(PASS_ENGINE_PARAMETER_SIGNATURE); + refreshMapAveragingPreCalc(); #endif - engineState.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engineState.periodicFastCallback(); knockController.periodicFastCallback(); - tachSignalCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + tachSignalCallback(); } -void doScheduleStopEngine(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void doScheduleStopEngine() { efiPrintf("Starting doScheduleStopEngine"); engine->stopEngineRequestTimeNt = getTimeNowNt(); engine->ignitionOnTimeNt = 0; diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index f376a3d571..ac3bda259c 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -138,12 +138,12 @@ public: void OnTriggerSynchronizationLost() override; #endif - void setConfig(DECLARE_ENGINE_PARAMETER_SIGNATURE); - injection_mode_e getCurrentInjectionMode(DECLARE_ENGINE_PARAMETER_SIGNATURE); + void setConfig(); + injection_mode_e getCurrentInjectionMode(); LocalVersionHolder versionForConfigurationListeners; LocalVersionHolder auxParametersVersion; - operation_mode_e getOperationMode(DECLARE_ENGINE_PARAMETER_SIGNATURE); + operation_mode_e getOperationMode(); AuxActor auxValves[AUX_DIGITAL_VALVE_COUNT][2]; @@ -261,11 +261,11 @@ public: // Standard cylinder air charge - 100% VE at standard temperature, grams per cylinder float standardAirCharge = 0; - void periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE); - void periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE); - void updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE); - void updateSwitchInputs(DECLARE_ENGINE_PARAMETER_SIGNATURE); - void initializeTriggerWaveform(DECLARE_ENGINE_PARAMETER_SIGNATURE); + void periodicFastCallback(); + void periodicSlowCallback(); + void updateSlowSensors(); + void updateSwitchInputs(); + void initializeTriggerWaveform(); bool clutchUpState = false; bool clutchDownState = false; @@ -333,7 +333,7 @@ public: */ uint32_t engineCycleEventCount = 0; - void preCalculate(DECLARE_ENGINE_PARAMETER_SIGNATURE); + void preCalculate(); void watchdog(); @@ -341,22 +341,22 @@ public: * Needed by EFI_MAIN_RELAY_CONTROL to shut down the engine correctly. * This method cancels shutdown if the ignition voltage is detected. */ - void checkShutdown(DECLARE_ENGINE_PARAMETER_SIGNATURE); + void checkShutdown(); /** * Allows to finish some long-term shutdown procedures (stepper motor parking etc.) Called when the ignition switch is turned off (vBatt is too low). Returns true if some operations are in progress on background. */ - bool isInShutdownMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) const; + bool isInShutdownMode() const; - bool isInMainRelayBench(DECLARE_ENGINE_PARAMETER_SIGNATURE); + bool isInMainRelayBench(); /** * The stepper does not work if the main relay is turned off (it requires +12V). * Needed by the stepper motor code to detect if it works. */ - bool isMainRelayEnabled(DECLARE_ENGINE_PARAMETER_SIGNATURE) const; + bool isMainRelayEnabled() const; /** * Needed by EFI_MAIN_RELAY_CONTROL to handle fuel pump and shutdown timings correctly. @@ -386,12 +386,12 @@ private: void injectEngineReferences(); }; -void prepareShapes(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void applyNonPersistentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void prepareShapes(); +void applyNonPersistentConfiguration(); +void prepareOutputSignals(); -void validateConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void doScheduleStopEngine(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void validateConfiguration(); +void doScheduleStopEngine(); #define HW_CHECK_RPM 200 diff --git a/firmware/controllers/algo/engine2.cpp b/firmware/controllers/algo/engine2.cpp index 58b682fe70..647ecb6f44 100644 --- a/firmware/controllers/algo/engine2.cpp +++ b/firmware/controllers/algo/engine2.cpp @@ -47,7 +47,7 @@ void WarningCodeState::addWarningCode(obd_code_e code) { /** * @param forIndicator if we want to retrieving value for TS indicator, this case a minimal period is applued */ -bool WarningCodeState::isWarningNow(efitimesec_t now, bool forIndicator DECLARE_ENGINE_PARAMETER_SUFFIX) const { +bool WarningCodeState::isWarningNow(efitimesec_t now, bool forIndicator) const { int period = forIndicator ? maxI(3, engineConfiguration->warningPeriod) : engineConfiguration->warningPeriod; return absI(now - timeOfPreviousWarning) < period; } @@ -57,7 +57,7 @@ MockAdcState::MockAdcState() { } #if EFI_ENABLE_MOCK_ADC -void MockAdcState::setMockVoltage(int hwChannel, float voltage DECLARE_ENGINE_PARAMETER_SUFFIX) { +void MockAdcState::setMockVoltage(int hwChannel, float voltage) { efiAssertVoid(OBD_PCM_Processor_Fault, hwChannel >= 0 && hwChannel < MOCK_ADC_SIZE, "hwChannel out of bounds"); efiPrintf("fake voltage: channel %d value %.2f", hwChannel, voltage); @@ -91,10 +91,10 @@ EngineState::EngineState() { timeSinceLastTChargeK = getTimeNowNt(); } -void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void EngineState::updateSlowSensors() { } -void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void EngineState::periodicFastCallback() { ScopePerf perf(PE::EngineStatePeriodicFastCallback); #if EFI_ENGINE_CONTROL @@ -108,19 +108,19 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } else { timeSinceCranking = nowNt - crankingTime; } - recalculateAuxValveTiming(PASS_ENGINE_PARAMETER_SIGNATURE); + recalculateAuxValveTiming(); int rpm = ENGINE(rpmCalculator).getRpm(); - sparkDwell = getSparkDwell(rpm PASS_ENGINE_PARAMETER_SUFFIX); + sparkDwell = getSparkDwell(rpm); dwellAngle = cisnan(rpm) ? NAN : sparkDwell / getOneDegreeTimeMs(rpm); // todo: move this into slow callback, no reason for IAT corr to be here - running.intakeTemperatureCoefficient = getIatFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); + running.intakeTemperatureCoefficient = getIatFuelCorrection(); // todo: move this into slow callback, no reason for CLT corr to be here - running.coolantTemperatureCoefficient = getCltFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); + running.coolantTemperatureCoefficient = getCltFuelCorrection(); // Fuel cut-off isn't just 0 or 1, it can be tapered - fuelCutoffCorrection = getFuelCutOffCorrection(nowNt, rpm PASS_ENGINE_PARAMETER_SUFFIX); + fuelCutoffCorrection = getFuelCutOffCorrection(nowNt, rpm); // post-cranking fuel enrichment. // for compatibility reasons, apply only if the factor is greater than unity (only allow adding fuel) @@ -134,18 +134,18 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { running.postCrankingFuelCorrection = 1.0f; } - cltTimingCorrection = getCltTimingCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); + cltTimingCorrection = getCltTimingCorrection(); knockThreshold = interpolate2d(rpm, engineConfiguration->knockNoiseRpmBins, engineConfiguration->knockNoise); - baroCorrection = getBaroCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); + baroCorrection = getBaroCorrection(); auto tps = Sensor::get(SensorType::Tps1); - updateTChargeK(rpm, tps.value_or(0) PASS_ENGINE_PARAMETER_SUFFIX); + updateTChargeK(rpm, tps.value_or(0)); - float injectionMass = getInjectionMass(rpm PASS_ENGINE_PARAMETER_SUFFIX); - auto clResult = fuelClosedLoopCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); + float injectionMass = getInjectionMass(rpm); + auto clResult = fuelClosedLoopCorrection(); // compute per-bank fueling for (size_t i = 0; i < STFT_BANK_COUNT; i++) { @@ -157,16 +157,16 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // Store the pre-wall wetting injection duration for scheduling purposes only, not the actual injection duration ENGINE(injectionDuration) = ENGINE(injectorModel)->getInjectionDuration(injectionMass); - float fuelLoad = getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE); - injectionOffset = getInjectionOffset(rpm, fuelLoad PASS_ENGINE_PARAMETER_SUFFIX); + float fuelLoad = getFuelingLoad(); + injectionOffset = getInjectionOffset(rpm, fuelLoad); - float ignitionLoad = getIgnitionLoad(PASS_ENGINE_PARAMETER_SIGNATURE); - timingAdvance = getAdvance(rpm, ignitionLoad PASS_ENGINE_PARAMETER_SUFFIX) * luaAdjustments.ignitionTimingMult + luaAdjustments.ignitionTimingAdd; + float ignitionLoad = getIgnitionLoad(); + timingAdvance = getAdvance(rpm, ignitionLoad) * luaAdjustments.ignitionTimingMult + luaAdjustments.ignitionTimingAdd; // TODO: calculate me from a table! trailingSparkAngle = CONFIG(trailingSparkAngle); - multispark.count = getMultiSparkCount(rpm PASS_ENGINE_PARAMETER_SUFFIX); + multispark.count = getMultiSparkCount(rpm); #if EFI_LAUNCH_CONTROL engine->launchController.update(); @@ -177,9 +177,9 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif // EFI_ENGINE_CONTROL } -void EngineState::updateTChargeK(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX) { +void EngineState::updateTChargeK(int rpm, float tps) { #if EFI_ENGINE_CONTROL - float newTCharge = getTCharge(rpm, tps PASS_ENGINE_PARAMETER_SUFFIX); + float newTCharge = getTCharge(rpm, tps); // convert to microsecs and then to seconds efitick_t curTime = getTimeNowNt(); float secsPassed = (float)NT2US(curTime - timeSinceLastTChargeK) / US_PER_SECOND_F; @@ -218,7 +218,7 @@ void StartupFuelPumping::setPumpsCounter(int newValue) { } } -void StartupFuelPumping::update(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void StartupFuelPumping::update() { if (GET_RPM() == 0) { bool isTpsAbove50 = Sensor::getOrZero(SensorType::DriverThrottleIntent) >= 50; diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 685e5d2972..0f4963df81 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -131,7 +131,7 @@ engine_configuration_s & activeConfiguration = activeConfigurationLocalStorage; extern engine_configuration_s *engineConfiguration; -void rememberCurrentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void rememberCurrentConfiguration() { #if ! EFI_ACTIVE_CONFIGURATION_IN_FLASH memcpy(&activeConfiguration, engineConfiguration, sizeof(engine_configuration_s)); #else @@ -146,16 +146,16 @@ static void wipeString(char *string, int size) { } } -static void wipeStrings(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void wipeStrings() { wipeString(engineConfiguration->engineMake, sizeof(vehicle_info_t)); wipeString(engineConfiguration->engineCode, sizeof(vehicle_info_t)); wipeString(engineConfiguration->vehicleName, sizeof(vehicle_info_t)); } -void onBurnRequest(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - wipeStrings(PASS_ENGINE_PARAMETER_SIGNATURE); +void onBurnRequest() { + wipeStrings(); - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } /** @@ -165,18 +165,18 @@ void onBurnRequest(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * this method is NOT currently invoked on ECU start - actual user input has to happen! * See preCalculate which is invoked BOTH on start and configuration change */ -void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void incrementGlobalConfigurationVersion() { ENGINE(globalConfigurationVersion++); #if EFI_DEFAILED_LOGGING efiPrintf("set globalConfigurationVersion=%d", globalConfigurationVersion); #endif /* EFI_DEFAILED_LOGGING */ - applyNewHardwareSettings(PASS_ENGINE_PARAMETER_SIGNATURE); + applyNewHardwareSettings(); /** * All these callbacks could be implemented as listeners, but these days I am saving RAM */ - engine->preCalculate(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->preCalculate(); #if EFI_ALTERNATOR_CONTROL onConfigurationChangeAlternatorCallback(&activeConfiguration); #endif /* EFI_ALTERNATOR_CONTROL */ @@ -193,47 +193,47 @@ void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif /* EFI_IDLE_CONTROL */ #if EFI_SHAFT_POSITION_INPUT - onConfigurationChangeTriggerCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + onConfigurationChangeTriggerCallback(); #endif /* EFI_SHAFT_POSITION_INPUT */ #if EFI_EMULATE_POSITION_SENSORS && ! EFI_UNIT_TEST onConfigurationChangeRpmEmulatorCallback(&activeConfiguration); #endif /* EFI_EMULATE_POSITION_SENSORS */ #if EFI_FSIO - onConfigurationChangeFsioCallback(&activeConfiguration PASS_ENGINE_PARAMETER_SUFFIX); + onConfigurationChangeFsioCallback(&activeConfiguration); #endif /* EFI_FSIO */ - rememberCurrentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); + rememberCurrentConfiguration(); } /** * @brief Sets the same dwell time across the whole getRpm() range * set dwell X */ -void setConstantDwell(floatms_t dwellMs DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setConstantDwell(floatms_t dwellMs) { for (int i = 0; i < DWELL_CURVE_SIZE; i++) { engineConfiguration->sparkDwellRpmBins[i] = 1000 * i; } setArrayValues(engineConfiguration->sparkDwellValues, dwellMs); } -void setWholeIgnitionIatCorr(float value DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setWholeIgnitionIatCorr(float value) { setTable(config->ignitionIatCorrTable, value); } -void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setFuelTablesLoadBin(float minValue, float maxValue) { setLinearCurve(config->injPhaseLoadBins, minValue, maxValue, 1); setLinearCurve(config->veLoadBins, minValue, maxValue, 1); setLinearCurve(config->lambdaLoadBins, minValue, maxValue, 1); } -void setWholeIatCorrTimingTable(float value DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setWholeIatCorrTimingTable(float value) { setTable(config->ignitionIatCorrTable, value); } /** * See also crankingTimingAngle */ -void setWholeTimingTable_d(angle_t value DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setWholeTimingTable_d(angle_t value) { setTable(config->ignitionTable, value); } @@ -253,7 +253,7 @@ void prepareVoidConfiguration(engine_configuration_s *engineConfiguration) { engineConfiguration->brakePedalPinMode = PI_PULLUP; } -void setDefaultBasePins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setDefaultBasePins() { #ifdef EFI_WARNING_PIN engineConfiguration->warningLedPin = EFI_WARNING_PIN; #else @@ -294,7 +294,7 @@ void setDefaultBasePins(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // needed also by bootloader code // at the moment bootloader does NOT really need SD card, this is a step towards future bootloader SD card usage -void setDefaultSdCardParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setDefaultSdCardParameters() { engineConfiguration->is_enabled_spi_3 = true; engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3; engineConfiguration->sdCardCsPin = GPIOD_4; @@ -306,7 +306,7 @@ void setDefaultSdCardParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #endif /* EFI_PROD_CODE */ } -static void setDefaultWarmupIdleCorrection(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultWarmupIdleCorrection() { initTemperatureCurve(CLT_MANUAL_IDLE_CORRECTION, 1.0); float baseIdle = 30; @@ -328,7 +328,7 @@ static void setDefaultWarmupIdleCorrection(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * see also setTargetRpmCurve() */ -static void setDefaultIdleSpeedTarget(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void setDefaultIdleSpeedTarget() { setLinearCurve(engineConfiguration->cltIdleRpmBins, CLT_CURVE_RANGE_FROM, 140, 10); setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -30, 1350); @@ -348,7 +348,7 @@ static void setDefaultIdleSpeedTarget(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, 110, 1100); } -static void setDefaultFrankensoStepperIdleParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultFrankensoStepperIdleParameters() { engineConfiguration->idle.stepperDirectionPin = GPIOE_10; engineConfiguration->idle.stepperStepPin = GPIOE_12; engineConfiguration->stepperEnablePin = GPIOE_14; @@ -356,7 +356,7 @@ static void setDefaultFrankensoStepperIdleParameters(DECLARE_CONFIG_PARAMETER_SI engineConfiguration->idleStepperTotalSteps = 150; } -static void setCanFrankensoDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setCanFrankensoDefaults() { engineConfiguration->canTxPin = GPIOB_6; engineConfiguration->canRxPin = GPIOB_12; } @@ -364,12 +364,12 @@ static void setCanFrankensoDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * see also setDefaultIdleSpeedTarget() */ -void setTargetRpmCurve(int rpm DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setTargetRpmCurve(int rpm) { setLinearCurve(engineConfiguration->cltIdleRpmBins, CLT_CURVE_RANGE_FROM, 140, 10); setLinearCurve(engineConfiguration->cltIdleRpm, rpm, rpm, 10); } -void setDefaultGppwmParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void setDefaultGppwmParameters() { // Same config for all channels for (size_t i = 0; i < efi::size(CONFIG(gppwm)); i++) { auto& cfg = CONFIG(gppwm)[i]; @@ -397,7 +397,7 @@ void setDefaultGppwmParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } } -static void setDefaultEngineNoiseTable(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void setDefaultEngineNoiseTable() { setRpmTableBin(engineConfiguration->knockNoiseRpmBins, ENGINE_NOISE_CURVE_SIZE); engineConfiguration->knockSamplingDuration = 45; @@ -412,7 +412,7 @@ static void setDefaultEngineNoiseTable(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->knockNoise[7] = 2; // 7000 } -static void setHip9011FrankensoPinout(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void setHip9011FrankensoPinout() { /** * SPI on PB13/14/15 */ @@ -461,16 +461,16 @@ static void setHip9011FrankensoPinout(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * * This method should NOT be setting any default pinout */ -static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void setDefaultEngineConfiguration() { #if (! EFI_UNIT_TEST) efi::clear(persistentState.persistentConfiguration); #endif prepareVoidConfiguration(engineConfiguration); - setDefaultBaseEngine(PASS_CONFIG_PARAMETER_SIGNATURE); - setDefaultFuel(PASS_CONFIG_PARAMETER_SIGNATURE); - setDefaultIgnition(PASS_CONFIG_PARAMETER_SIGNATURE); - setDefaultCranking(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultBaseEngine(); + setDefaultFuel(); + setDefaultIgnition(); + setDefaultCranking(); // VVT closed loop, totally random values! engineConfiguration->auxPid[0].pFactor = 2; @@ -488,15 +488,15 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->turboSpeedSensorMultiplier = 1; #if EFI_IDLE_CONTROL - setDefaultIdleParameters(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultIdleParameters(); #endif /* EFI_IDLE_CONTROL */ #if EFI_ELECTRONIC_THROTTLE_BODY - setDefaultEtbParameters(PASS_CONFIG_PARAMETER_SIGNATURE); - setDefaultEtbBiasCurve(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultEtbParameters(); + setDefaultEtbBiasCurve(); #endif /* EFI_ELECTRONIC_THROTTLE_BODY */ #if EFI_BOOST_CONTROL - setDefaultBoostParameters(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultBoostParameters(); #endif // OBD-II default rate is 500kbps @@ -545,7 +545,7 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setLinearCurve(engineConfiguration->scriptCurve6Bins, 0, 100, 1); #if EFI_ENGINE_CONTROL - setDefaultWarmupIdleCorrection(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultWarmupIdleCorrection(); setLinearCurve(engineConfiguration->map.samplingAngleBins, 800, 7000, 1); setLinearCurve(engineConfiguration->map.samplingAngle, 100, 130, 1); @@ -565,7 +565,7 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setLinearCurve(config->scriptTable4LoadBins, 20, 120, 10); setRpmTableBin(config->scriptTable4RpmBins, SCRIPT_TABLE_8); - setDefaultEngineNoiseTable(PASS_ENGINE_PARAMETER_SIGNATURE); + setDefaultEngineNoiseTable(); engineConfiguration->clt.config = {0, 23.8889, 48.8889, 9500, 2100, 1000, 1500}; @@ -588,8 +588,8 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * Idle control defaults */ - setDefaultIdleSpeedTarget(PASS_ENGINE_PARAMETER_SIGNATURE); - // setTargetRpmCurve(1200 PASS_ENGINE_PARAMETER_SUFFIX); + setDefaultIdleSpeedTarget(); + // setTargetRpmCurve(1200); engineConfiguration->idleRpmPid.pFactor = 0.05; engineConfiguration->idleRpmPid.iFactor = 0.002; @@ -610,7 +610,7 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->useStepperIdle = false; - setDefaultGppwmParameters(PASS_ENGINE_PARAMETER_SIGNATURE); + setDefaultGppwmParameters(); #if !EFI_UNIT_TEST engineConfiguration->analogInputDividerCoefficient = 2; @@ -653,7 +653,7 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engineConfiguration->cylinderBore = 87.5; - setEgoSensor(ES_14Point7_Free PASS_CONFIG_PARAMETER_SUFFIX); + setEgoSensor(ES_14Point7_Free); engineConfiguration->globalFuelCorrection = 1; engineConfiguration->adcVcc = 3.0; @@ -720,9 +720,9 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * @brief Hardware board-specific default configuration (GPIO pins, ADC channels, SPI configs etc.) */ -void setDefaultFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - setDefaultFrankensoStepperIdleParameters(PASS_CONFIG_PARAMETER_SIGNATURE); - setCanFrankensoDefaults(PASS_CONFIG_PARAMETER_SIGNATURE); +void setDefaultFrankensoConfiguration() { + setDefaultFrankensoStepperIdleParameters(); + setCanFrankensoDefaults(); engineConfiguration->map.sensor.hwChannel = EFI_ADC_4; engineConfiguration->clt.adcChannel = EFI_ADC_6; @@ -764,15 +764,15 @@ void setDefaultFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // set optional subsystem configs #if EFI_MEMS // this would override some values from above - configureAccelerometerPins(PASS_CONFIG_PARAMETER_SIGNATURE); + configureAccelerometerPins(); #endif /* EFI_MEMS */ #if EFI_HIP_9011 - setHip9011FrankensoPinout(PASS_CONFIG_PARAMETER_SIGNATURE); + setHip9011FrankensoPinout(); #endif /* EFI_HIP_9011 */ #if EFI_FILE_LOGGING - setDefaultSdCardParameters(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultSdCardParameters(); #endif /* EFI_FILE_LOGGING */ engineConfiguration->is_enabled_spi_1 = false; @@ -792,7 +792,7 @@ void setDefaultFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #define IGNORE_FLASH_CONFIGURATION false #endif -void loadConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void loadConfiguration() { #ifdef CONFIG_RESET_SWITCH_PORT // initialize the reset pin if necessary palSetPadMode(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN, PAL_MODE_INPUT_PULLUP); @@ -806,7 +806,7 @@ void loadConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #if EFI_INTERNAL_FLASH if (SHOULD_IGNORE_FLASH() || IGNORE_FLASH_CONFIGURATION) { engineConfiguration->engineType = DEFAULT_ENGINE_TYPE; - resetConfigurationExt(engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX); + resetConfigurationExt(engineConfiguration->engineType); writeToFlashNow(); } else { // this call reads configuration from flash memory or sets default configuration @@ -816,22 +816,22 @@ void loadConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #else // not EFI_INTERNAL_FLASH // This board doesn't load configuration, initialize the default engineConfiguration->engineType = DEFAULT_ENGINE_TYPE; - resetConfigurationExt(engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX); + resetConfigurationExt(engineConfiguration->engineType); #endif /* EFI_INTERNAL_FLASH */ // Force any board configuration options that humans shouldn't be able to change setBoardConfigOverrides(); } -void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) { +void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e engineType) { enginePins.reset(); // that's mostly important for functional tests /** * Let's apply global defaults first */ - setDefaultEngineConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); + setDefaultEngineConfiguration(); // set initial pin groups - setDefaultBasePins(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultBasePins(); if (boardCallback != nullptr) { boardCallback(engineConfiguration); @@ -858,132 +858,132 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e // nothing to do - we do it all in setBoardDefaultConfiguration break; case TEST_ENGINE: - setTestEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setTestEngineConfiguration(); break; #if EFI_UNIT_TEST case TEST_ISSUE_366_BOTH: - setTestEngineIssue366both(PASS_CONFIG_PARAMETER_SIGNATURE); + setTestEngineIssue366both(); break; case TEST_ISSUE_366_RISE: - setTestEngineIssue366rise(PASS_CONFIG_PARAMETER_SIGNATURE); + setTestEngineIssue366rise(); break; case TEST_ISSUE_898: - setIssue898(PASS_CONFIG_PARAMETER_SIGNATURE); + setIssue898(); break; #endif // EFI_UNIT_TEST #if HW_MICRO_RUSEFI case MRE_M111: - setM111EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setM111EngineConfiguration(); break; case MRE_SECONDARY_CAN: - mreSecondaryCan(PASS_CONFIG_PARAMETER_SIGNATURE); + mreSecondaryCan(); break; case UNUSED101: case MRE_SUBARU_EJ18: - setSubaruEJ18_MRE(PASS_CONFIG_PARAMETER_SIGNATURE); + setSubaruEJ18_MRE(); break; case UNUSED30: case MRE_BOARD_NEW_TEST: - mreBoardNewTest(PASS_CONFIG_PARAMETER_SIGNATURE); + mreBoardNewTest(); break; case BMW_M73_MRE: case BMW_M73_MRE_SLAVE: - setEngineBMW_M73_microRusEfi(PASS_CONFIG_PARAMETER_SIGNATURE); + setEngineBMW_M73_microRusEfi(); break; case MRE_MIATA_NA6_VAF: - setMiataNA6_VAF_MRE(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNA6_VAF_MRE(); break; case MRE_MIATA_94_MAP: - setMiata94_MAP_MRE(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiata94_MAP_MRE(); break; case MRE_MIATA_NA6_MAP: - setMiataNA6_MAP_MRE(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNA6_MAP_MRE(); break; case MRE_MIATA_NB2_MAP: - setMiataNB2_MRE_MAP(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNB2_MRE_MAP(); break; case MRE_MIATA_NB2_MAF: - setMiataNB2_MRE_MAF(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNB2_MRE_MAF(); break; case MRE_MIATA_NB2_ETB: - setMiataNB2_MRE_ETB(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNB2_MRE_ETB(); break; case MRE_BODY_CONTROL: - mreBCM(PASS_CONFIG_PARAMETER_SIGNATURE); + mreBCM(); break; #endif // HW_MICRO_RUSEFI #if HW_PROTEUS case PROTEUS_QC_TEST_BOARD: - proteusBoardTest(PASS_CONFIG_PARAMETER_SIGNATURE); + proteusBoardTest(); break; case PROTEUS_LUA_DEMO: - proteusLuaDemo(PASS_CONFIG_PARAMETER_SIGNATURE); + proteusLuaDemo(); break; case PROTEUS_HARLEY: - proteusHarley(PASS_CONFIG_PARAMETER_SIGNATURE); + proteusHarley(); break; case PROTEUS_BMW_M73: - setEngineBMW_M73_Proteus(PASS_CONFIG_PARAMETER_SIGNATURE); + setEngineBMW_M73_Proteus(); break; case MIATA_PROTEUS_TCU: - setMiataNB2_Proteus_TCU(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNB2_Proteus_TCU(); break; case PROTEUS_HONDA_ELEMENT_2003: - setProteusHondaElement2003(PASS_CONFIG_PARAMETER_SIGNATURE); + setProteusHondaElement2003(); break; case PROTEUS_HONDA_OBD2A: - setProteusHondaOBD2A(PASS_CONFIG_PARAMETER_SIGNATURE); + setProteusHondaOBD2A(); break; case PROTEUS_VAG_80_18T: case PROTEUS_N73: case PROTEUS_MIATA_NB2: - setMiataNB2_ProteusEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNB2_ProteusEngineConfiguration(); break; #ifdef HARDWARE_CI case PROTEUS_ANALOG_PWM_TEST: - setProteusAnalogPwmTest(PASS_CONFIG_PARAMETER_SIGNATURE); + setProteusAnalogPwmTest(); break; #endif // HARDWARE_CI #endif // HW_PROTEUS #if HW_HELLEN case HELLEN_128_MERCEDES_4_CYL: - setHellenMercedes128_4_cyl(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellenMercedes128_4_cyl(); break; case HELLEN_128_MERCEDES_6_CYL: - setHellenMercedes128_6_cyl(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellenMercedes128_6_cyl(); break; case HELLEN_128_MERCEDES_8_CYL: - setHellenMercedes128_8_cyl(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellenMercedes128_8_cyl(); break; case HELLEN_NB2: - setMiataNB2_Hellen72(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNB2_Hellen72(); break; case HELLEN_NB2_36: - setMiataNB2_Hellen72_36(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNB2_Hellen72_36(); break; case HELLEN_NB1: - setHellenNB1(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellenNB1(); break; case HELLEN72_ETB: - setHellen72etb(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellen72etb(); break; case HELLEN_121_NISSAN_4_CYL: - setHellen121nissanQR(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellen121nissanQR(); break; case HELLEN_121_NISSAN_6_CYL: - setHellen121nissanVQ(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellen121nissanVQ(); break; case HELLEN_121_VAG_5_CYL: - setHellen121Vag_5_cyl(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellen121Vag_5_cyl(); break; case HELLEN_121_VAG_V6_CYL: - setHellen121Vag_v6_cyl(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellen121Vag_v6_cyl(); break; case HELLEN_121_VAG_VR6_CYL: - setHellen121Vag_vr6_cyl(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellen121Vag_vr6_cyl(); break; case HELLEN_121_VAG_8_CYL: - setHellen121Vag_8_cyl(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellen121Vag_8_cyl(); break; case HELLEN_121_VAG_4_CYL: case HELLEN_55_BMW: @@ -992,147 +992,147 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e case HELLEN_154_VAG: break; case HELLEN_154_HYUNDAI_COUPE_BK1: - setGenesisCoupeBK1(PASS_CONFIG_PARAMETER_SIGNATURE); + setGenesisCoupeBK1(); break; case HELLEN_154_HYUNDAI_COUPE_BK2: - setGenesisCoupeBK2(PASS_CONFIG_PARAMETER_SIGNATURE); + setGenesisCoupeBK2(); break; case HELLEN_NA6: - setHellenNA6(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellenNA6(); break; case HELLEN_NA94: - setHellenNA94(PASS_CONFIG_PARAMETER_SIGNATURE); + setHellenNA94(); break; #endif // HW_HELLEN #if HW_FRANKENSO case DEFAULT_FRANKENSO: - setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setFrankensoConfiguration(); break; case FRANKENSO_QA_ENGINE: - setFrankensoBoardTestConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setFrankensoBoardTestConfiguration(); break; case FRANKENSO_BMW_M73_F: - setBMW_M73_TwoCoilUnitTest(PASS_CONFIG_PARAMETER_SIGNATURE); + setBMW_M73_TwoCoilUnitTest(); break; case BMW_M73_M: - setEngineBMW_M73_Manhattan(PASS_CONFIG_PARAMETER_SIGNATURE); + setEngineBMW_M73_Manhattan(); break; case DODGE_NEON_1995: - setDodgeNeon1995EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setDodgeNeon1995EngineConfiguration(); break; case DODGE_NEON_2003_CRANK: - setDodgeNeonNGCEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setDodgeNeonNGCEngineConfiguration(); break; case UNUSED39: case FORD_ASPIRE_1996: - setFordAspireEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setFordAspireEngineConfiguration(); break; case NISSAN_PRIMERA: - setNissanPrimeraEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setNissanPrimeraEngineConfiguration(); break; case FRANKENSO_MIATA_NA6_MAP: - setMiataNA6_MAP_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNA6_MAP_Frankenso(); break; case FRANKENSO_MIATA_NA6_VAF: - setMiataNA6_VAF_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE); + setMiataNA6_VAF_Frankenso(); break; case ETB_BENCH_ENGINE: - setEtbTestConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setEtbTestConfiguration(); break; case TLE8888_BENCH_ENGINE: - setTle8888TestConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setTle8888TestConfiguration(); break; case FRANKENSO_MAZDA_MIATA_NA8: - setMazdaMiataNA8Configuration(PASS_CONFIG_PARAMETER_SIGNATURE); + setMazdaMiataNA8Configuration(); break; case HONDA_ACCORD_CD_TWO_WIRES: - setHondaAccordConfiguration1_24(PASS_CONFIG_PARAMETER_SIGNATURE); + setHondaAccordConfiguration1_24(); break; case UNUSED18: case MITSU_4G93: - setMitsubishiConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setMitsubishiConfiguration(); break; case FORD_INLINE_6_1995: - setFordInline6(PASS_CONFIG_PARAMETER_SIGNATURE); + setFordInline6(); break; case GY6_139QMB: - setGy6139qmbDefaultEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setGy6139qmbDefaultEngineConfiguration(); break; case HONDA_600: - setHonda600(PASS_CONFIG_PARAMETER_SIGNATURE); + setHonda600(); break; case UNUSED9: case UNUSED28: case FORD_ESCORT_GT: - setFordEscortGt(PASS_CONFIG_PARAMETER_SIGNATURE); + setFordEscortGt(); break; case UNUSED_19: case MIATA_1996: - setFrankensteinMiata1996(PASS_CONFIG_PARAMETER_SIGNATURE); + setFrankensteinMiata1996(); break; case CITROEN_TU3JP: - setCitroenBerlingoTU3JPConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setCitroenBerlingoTU3JPConfiguration(); break; case SUBARU_2003_WRX: - setSubaru2003Wrx(PASS_CONFIG_PARAMETER_SIGNATURE); + setSubaru2003Wrx(); break; case DODGE_RAM: - setDodgeRam1996(PASS_CONFIG_PARAMETER_SIGNATURE); + setDodgeRam1996(); break; case VW_B6: - setVwPassatB6(PASS_CONFIG_PARAMETER_SIGNATURE); + setVwPassatB6(); break; case VW_ABA: - setVwAba(PASS_CONFIG_PARAMETER_SIGNATURE); + setVwAba(); break; case FRANKENSO_MAZDA_MIATA_2003: - setMazdaMiata2003EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setMazdaMiata2003EngineConfiguration(); break; case MAZDA_MIATA_2003_NA_RAIL: - setMazdaMiata2003EngineConfigurationNaFuelRail(PASS_CONFIG_PARAMETER_SIGNATURE); + setMazdaMiata2003EngineConfigurationNaFuelRail(); break; case MAZDA_MIATA_2003_BOARD_TEST: - setMazdaMiata2003EngineConfigurationBoardTest(PASS_CONFIG_PARAMETER_SIGNATURE); + setMazdaMiata2003EngineConfigurationBoardTest(); break; case TEST_ENGINE_VVT: - setTestVVTEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setTestVVTEngineConfiguration(); break; case SACHS: - setSachs(PASS_CONFIG_PARAMETER_SIGNATURE); + setSachs(); break; case CAMARO_4: - setCamaro4(PASS_CONFIG_PARAMETER_SIGNATURE); + setCamaro4(); break; case TOYOTA_2JZ_GTE_VVTi: - setToyota_2jz_vics(PASS_CONFIG_PARAMETER_SIGNATURE); + setToyota_2jz_vics(); break; case TOYOTA_JZS147: - setToyota_jzs147EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setToyota_jzs147EngineConfiguration(); break; case VAG_18_TURBO: - vag_18_Turbo(PASS_CONFIG_PARAMETER_SIGNATURE); + vag_18_Turbo(); break; case TEST_33816: - setTest33816EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); + setTest33816EngineConfiguration(); break; case TEST_108: - setVrThresholdTest(PASS_CONFIG_PARAMETER_SIGNATURE); + setVrThresholdTest(); break; case TEST_109: case TEST_110: case TEST_ROTARY: - setRotary(PASS_CONFIG_PARAMETER_SIGNATURE); + setRotary(); break; #endif // HW_FRANKENSO #ifdef HW_SUBARU_EG33 case SUBARUEG33_DEFAULTS: - setSubaruEG33Defaults(PASS_CONFIG_PARAMETER_SIGNATURE); + setSubaruEG33Defaults(); break; #endif //HW_SUBARU_EG33 default: firmwareError(CUSTOM_UNEXPECTED_ENGINE_TYPE, "Unexpected engine type: %d", engineType); } - applyNonPersistentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); + applyNonPersistentConfiguration(); #if EFI_TUNER_STUDIO syncTunerStudioCopy(); @@ -1143,15 +1143,15 @@ void emptyCallbackWithConfiguration(engine_configuration_s * engineConfiguration UNUSED(engineConfiguration); } -void resetConfigurationExt(engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) { - resetConfigurationExt(&emptyCallbackWithConfiguration, engineType PASS_ENGINE_PARAMETER_SUFFIX); +void resetConfigurationExt(engine_type_e engineType) { + resetConfigurationExt(&emptyCallbackWithConfiguration, engineType); } -void validateConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void validateConfiguration() { if (engineConfiguration->adcVcc > 5.0f || engineConfiguration->adcVcc < 1.0f) { engineConfiguration->adcVcc = 3.0f; } - engine->preCalculate(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->preCalculate(); /** * TunerStudio text tune files convert negative zero into positive zero so to keep things consistent we should avoid @@ -1162,7 +1162,7 @@ void validateConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } } -void applyNonPersistentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void applyNonPersistentConfiguration() { #if EFI_PROD_CODE efiAssertVoid(CUSTOM_APPLY_STACK, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "apply c"); efiPrintf("applyNonPersistentConfiguration()"); @@ -1171,16 +1171,16 @@ void applyNonPersistentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { assertEngineReference(); #if EFI_ENGINE_CONTROL - ENGINE(initializeTriggerWaveform(PASS_ENGINE_PARAMETER_SIGNATURE)); + ENGINE(initializeTriggerWaveform()); #endif // EFI_ENGINE_CONTROL } #if EFI_ENGINE_CONTROL -void prepareShapes(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - prepareOutputSignals(PASS_ENGINE_PARAMETER_SIGNATURE); +void prepareShapes() { + prepareOutputSignals(); - engine->injectionEvents.addFuelEvents(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->injectionEvents.addFuelEvents(); } #endif diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index 15c3013e3c..50eb509063 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -24,40 +24,40 @@ void setOperationMode(engine_configuration_s *engineConfiguration, operation_mode_e mode); void prepareVoidConfiguration(engine_configuration_s *activeConfiguration); -void setTargetRpmCurve(int rpm DECLARE_CONFIG_PARAMETER_SUFFIX); -void setWholeIgnitionIatCorr(float value DECLARE_CONFIG_PARAMETER_SUFFIX); -void setFuelTablesLoadBin(float minValue, float maxValue DECLARE_CONFIG_PARAMETER_SUFFIX); -void setWholeIatCorrTimingTable(float value DECLARE_CONFIG_PARAMETER_SUFFIX); -void setWholeTimingTable_d(angle_t value DECLARE_CONFIG_PARAMETER_SUFFIX); -#define setWholeTimingTable(x) setWholeTimingTable_d(x PASS_CONFIG_PARAMETER_SUFFIX); -void setConstantDwell(floatms_t dwellMs DECLARE_CONFIG_PARAMETER_SUFFIX); +void setTargetRpmCurve(int rpm); +void setWholeIgnitionIatCorr(float value); +void setFuelTablesLoadBin(float minValue, float maxValue); +void setWholeIatCorrTimingTable(float value); +void setWholeTimingTable_d(angle_t value); +#define setWholeTimingTable(x) setWholeTimingTable_d(x); +void setConstantDwell(floatms_t dwellMs); // needed by bootloader -void setDefaultBasePins(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setDefaultBasePins(); -void setDefaultSdCardParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setDefaultSdCardParameters(); -void onBurnRequest(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void onBurnRequest(); +void incrementGlobalConfigurationVersion(); void commonFrankensoAnalogInputs(engine_configuration_s *engineConfiguration); void setFrankenso0_1_joystick(engine_configuration_s *engineConfiguration); void emptyCallbackWithConfiguration(engine_configuration_s * engine); -void setDefaultFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setDefaultFrankensoConfiguration(); typedef void (*configuration_callback_t)(engine_configuration_s*); #ifdef __cplusplus // because of 'Logging' class parameter these functions are visible only to C++ code but C code -void loadConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void loadConfiguration(); /** * boardCallback is invoked after configuration reset but before specific engineType configuration */ -void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX); -void resetConfigurationExt(engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX); +void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e engineType); +void resetConfigurationExt(engine_type_e engineType); -void rememberCurrentConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void rememberCurrentConfiguration(); #endif /* __cplusplus */ void setBoardDefaultConfiguration(void); diff --git a/firmware/controllers/algo/engine_parts.h b/firmware/controllers/algo/engine_parts.h index 510126f8d2..65066ba04e 100644 --- a/firmware/controllers/algo/engine_parts.h +++ b/firmware/controllers/algo/engine_parts.h @@ -18,7 +18,7 @@ public: bool hasMockAdc[MOCK_ADC_SIZE]; int fakeAdcValues[MOCK_ADC_SIZE]; - void setMockVoltage(int hwChannel, float voltage DECLARE_ENGINE_PARAMETER_SUFFIX); + void setMockVoltage(int hwChannel, float voltage); int getMockAdcValue(int hwChannel) const; }; @@ -63,7 +63,7 @@ class WarningCodeState { public: WarningCodeState(); void addWarningCode(obd_code_e code); - bool isWarningNow(efitimesec_t now, bool forIndicator DECLARE_ENGINE_PARAMETER_SUFFIX) const; + bool isWarningNow(efitimesec_t now, bool forIndicator) const; void clear(); int warningCounter; int lastErrorCode; @@ -110,7 +110,7 @@ public: class StartupFuelPumping { public: StartupFuelPumping(); - void update(DECLARE_ENGINE_PARAMETER_SIGNATURE); + void update(); bool isTpsAbove50; int pumpsCounter; private: diff --git a/firmware/controllers/algo/engine_state.h b/firmware/controllers/algo/engine_state.h index 6b7b8fad11..84cc46c349 100644 --- a/firmware/controllers/algo/engine_state.h +++ b/firmware/controllers/algo/engine_state.h @@ -23,9 +23,9 @@ struct LuaAdjustments { class EngineState : public engine_state2_s { public: EngineState(); - void periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE); - void updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE); - void updateTChargeK(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX); + void periodicFastCallback(); + void updateSlowSensors(); + void updateTChargeK(int rpm, float tps); FuelConsumptionState fuelConsumption; diff --git a/firmware/controllers/algo/event_registry.h b/firmware/controllers/algo/event_registry.h index 74bebfcb34..14a3470fc3 100644 --- a/firmware/controllers/algo/event_registry.h +++ b/firmware/controllers/algo/event_registry.h @@ -62,13 +62,13 @@ public: void invalidate(); // Call this every trigger tooth. It will schedule all required injector events. - void onTriggerTooth(size_t toothIndex, int rpm, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX); + void onTriggerTooth(size_t toothIndex, int rpm, efitick_t nowNt); /** * this method schedules all fuel events for an engine cycle */ - void addFuelEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE); - bool addFuelEventsForCylinder(int cylinderIndex DECLARE_ENGINE_PARAMETER_SUFFIX); + void addFuelEvents(); + bool addFuelEventsForCylinder(int cylinderIndex); void resetOverlapping(); diff --git a/firmware/controllers/algo/fuel/fuel_computer.cpp b/firmware/controllers/algo/fuel/fuel_computer.cpp index e446c56756..ae662c2236 100644 --- a/firmware/controllers/algo/fuel/fuel_computer.cpp +++ b/firmware/controllers/algo/fuel/fuel_computer.cpp @@ -56,10 +56,10 @@ float FuelComputer::getTargetLambda(int rpm, float load) const { } float FuelComputer::getTargetLambdaLoadAxis(float defaultLoad) const { - return getLoadOverride(defaultLoad, CONFIG(afrOverrideMode) PASS_ENGINE_PARAMETER_SUFFIX); + return getLoadOverride(defaultLoad, CONFIG(afrOverrideMode)); } -float getLoadOverride(float defaultLoad, afr_override_e overrideMode DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getLoadOverride(float defaultLoad, afr_override_e overrideMode) { switch(overrideMode) { case AFR_None: return defaultLoad; // MAP default to 200kpa - failed MAP goes rich diff --git a/firmware/controllers/algo/fuel/fuel_computer.h b/firmware/controllers/algo/fuel/fuel_computer.h index 4efd552bac..83f258da5c 100644 --- a/firmware/controllers/algo/fuel/fuel_computer.h +++ b/firmware/controllers/algo/fuel/fuel_computer.h @@ -33,5 +33,5 @@ private: const ValueProvider3D* const m_lambdaTable; }; -float getLoadOverride(float defaultLoad, afr_override_e overrideMode DECLARE_ENGINE_PARAMETER_SUFFIX); +float getLoadOverride(float defaultLoad, afr_override_e overrideMode); constexpr float fuelDensity = 0.72; // g/cc diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index f0e08eeb52..b37f959761 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -44,7 +44,7 @@ static mapEstimate_Map3D_t mapEstimationTable; float getCrankingFuel3( float baseFuel, - uint32_t revolutionCounterSinceStart DECLARE_ENGINE_PARAMETER_SUFFIX) { + uint32_t revolutionCounterSinceStart) { // these magic constants are in Celsius float baseCrankingFuel; if (engineConfiguration->useRunningMathForCranking) { @@ -92,7 +92,7 @@ float getCrankingFuel3( return crankingFuel; } -float getRunningFuel(float baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getRunningFuel(float baseFuel) { ScopePerf perf(PE::GetRunningFuel); ENGINE(engineState.running.baseFuel) = baseFuel; @@ -123,7 +123,7 @@ static SpeedDensityAirmass sdAirmass(veMap, mapEstimationTable); static MafAirmass mafAirmass(veMap); static AlphaNAirmass alphaNAirmass(veMap); -AirmassModelBase* getAirmassModel(engine_load_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX) { +AirmassModelBase* getAirmassModel(engine_load_mode_e mode) { switch (mode) { case LM_SPEED_DENSITY: return &sdAirmass; case LM_REAL_MAF: return &mafAirmass; @@ -145,11 +145,11 @@ AirmassModelBase* getAirmassModel(engine_load_mode_e mode DECLARE_ENGINE_PARAMET } // Per-cylinder base fuel mass -static float getBaseFuelMass(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { +static float getBaseFuelMass(int rpm) { ScopePerf perf(PE::GetBaseFuel); // airmass modes - get airmass first, then convert to fuel - auto model = getAirmassModel(CONFIG(fuelAlgorithm) PASS_ENGINE_PARAMETER_SUFFIX); + auto model = getAirmassModel(CONFIG(fuelAlgorithm)); efiAssert(CUSTOM_ERR_ASSERT, model != nullptr, "Invalid airmass mode", 0.0f); auto airmass = model->getAirmass(rpm); @@ -157,7 +157,7 @@ static float getBaseFuelMass(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { // Plop some state for others to read ENGINE(engineState.sd.airMassInOneCylinder) = airmass.CylinderAirmass; ENGINE(engineState.fuelingLoad) = airmass.EngineLoadPercent; - ENGINE(engineState.ignitionLoad) = getLoadOverride(airmass.EngineLoadPercent, CONFIG(ignOverrideMode) PASS_ENGINE_PARAMETER_SUFFIX); + ENGINE(engineState.ignitionLoad) = getLoadOverride(airmass.EngineLoadPercent, CONFIG(ignOverrideMode)); float baseFuelMass = ENGINE(fuelComputer)->getCycleFuel(airmass.CylinderAirmass, rpm, airmass.EngineLoadPercent); @@ -173,7 +173,7 @@ static float getBaseFuelMass(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { return baseFuelMass; } -angle_t getInjectionOffset(float rpm, float load DECLARE_ENGINE_PARAMETER_SUFFIX) { +angle_t getInjectionOffset(float rpm, float load) { if (cisnan(rpm)) { return 0; // error already reported } @@ -199,7 +199,7 @@ angle_t getInjectionOffset(float rpm, float load DECLARE_ENGINE_PARAMETER_SUFFIX * Number of injections using each injector per engine cycle * @see getNumberOfSparks */ -int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX) { +int getNumberOfInjections(injection_mode_e mode) { switch (mode) { case IM_SIMULTANEOUS: case IM_SINGLE_POINT: @@ -214,8 +214,8 @@ int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX) } } -float getInjectionModeDurationMultiplier(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - injection_mode_e mode = ENGINE(getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); +float getInjectionModeDurationMultiplier() { + injection_mode_e mode = ENGINE(getCurrentInjectionMode()); switch (mode) { case IM_SIMULTANEOUS: { @@ -243,17 +243,17 @@ float getInjectionModeDurationMultiplier(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * This is more like MOSFET duty cycle since durations include injector lag * @see getCoilDutyCycle */ -percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { - floatms_t totalInjectiorAmountPerCycle = ENGINE(injectionDuration) * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX); - floatms_t engineCycleDuration = getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX); +percent_t getInjectorDutyCycle(int rpm) { + floatms_t totalInjectiorAmountPerCycle = ENGINE(injectionDuration) * getNumberOfInjections(engineConfiguration->injectionMode); + floatms_t engineCycleDuration = getEngineCycleDuration(rpm); return 100 * totalInjectiorAmountPerCycle / engineCycleDuration; } -static float getCycleFuelMass(bool isCranking, float baseFuelMass DECLARE_ENGINE_PARAMETER_SUFFIX) { +static float getCycleFuelMass(bool isCranking, float baseFuelMass) { if (isCranking) { - return getCrankingFuel(baseFuelMass PASS_ENGINE_PARAMETER_SUFFIX); + return getCrankingFuel(baseFuelMass); } else { - return getRunningFuel(baseFuelMass PASS_ENGINE_PARAMETER_SUFFIX); + return getRunningFuel(baseFuelMass); } } @@ -261,27 +261,27 @@ static float getCycleFuelMass(bool isCranking, float baseFuelMass DECLARE_ENGINE * @returns Mass of each individual fuel injection, in grams * in case of single point injection mode the amount of fuel into all cylinders, otherwise the amount for one cylinder */ -float getInjectionMass(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getInjectionMass(int rpm) { ScopePerf perf(PE::GetInjectionDuration); #if EFI_SHAFT_POSITION_INPUT // Always update base fuel - some cranking modes use it - float baseFuelMass = getBaseFuelMass(rpm PASS_ENGINE_PARAMETER_SUFFIX); + float baseFuelMass = getBaseFuelMass(rpm); bool isCranking = ENGINE(rpmCalculator).isCranking(); - float cycleFuelMass = getCycleFuelMass(isCranking, baseFuelMass PASS_ENGINE_PARAMETER_SUFFIX); + float cycleFuelMass = getCycleFuelMass(isCranking, baseFuelMass); efiAssert(CUSTOM_ERR_ASSERT, !cisnan(cycleFuelMass), "NaN cycleFuelMass", 0); // Fuel cut-off isn't just 0 or 1, it can be tapered cycleFuelMass *= ENGINE(engineState.fuelCutoffCorrection); - float durationMultiplier = getInjectionModeDurationMultiplier(PASS_ENGINE_PARAMETER_SIGNATURE); + float durationMultiplier = getInjectionModeDurationMultiplier(); float injectionFuelMass = cycleFuelMass * durationMultiplier; // Prepare injector flow rate & deadtime ENGINE(injectorModel)->prepare(); - floatms_t tpsAccelEnrich = ENGINE(tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE)); + floatms_t tpsAccelEnrich = ENGINE(tpsAccelEnrichment.getTpsEnrichment()); efiAssert(CUSTOM_ERR_ASSERT, !cisnan(tpsAccelEnrich), "NaN tpsAccelEnrich", 0); ENGINE(engineState.tpsAccelEnrich) = tpsAccelEnrich; @@ -304,13 +304,13 @@ static InjectorModel injectorModel; * @note this method has nothing to do with fuel map VALUES - it's job * is to prepare the fuel map data structure for 3d interpolation */ -void initFuelMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - sdAirmass.inject(PASS_ENGINE_PARAMETER_SIGNATURE); - mafAirmass.inject(PASS_ENGINE_PARAMETER_SIGNATURE); - alphaNAirmass.inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void initFuelMap() { + sdAirmass.inject(); + mafAirmass.inject(); + alphaNAirmass.inject(); - fuelComputer.inject(PASS_ENGINE_PARAMETER_SIGNATURE); - injectorModel.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + fuelComputer.inject(); + injectorModel.inject(); ENGINE(fuelComputer) = &fuelComputer; ENGINE(injectorModel) = &injectorModel; @@ -325,7 +325,7 @@ void initFuelMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * @brief Engine warm-up fuel correction. */ -float getCltFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getCltFuelCorrection() { const auto [valid, clt] = Sensor::get(SensorType::Clt); if (!valid) @@ -334,7 +334,7 @@ float getCltFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return interpolate2d(clt, config->cltFuelCorrBins, config->cltFuelCorr); } -angle_t getCltTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +angle_t getCltTimingCorrection() { const auto [valid, clt] = Sensor::get(SensorType::Clt); if (!valid) @@ -343,7 +343,7 @@ angle_t getCltTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return interpolate2d(clt, engineConfiguration->cltTimingBins, engineConfiguration->cltTimingExtra); } -float getIatFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getIatFuelCorrection() { const auto [valid, iat] = Sensor::get(SensorType::Iat); if (!valid) @@ -357,7 +357,7 @@ float getIatFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * @note The returned value is float, not boolean - to implement taper (smoothed correction). * @return Fuel duration correction for fuel cut-off control (ex. if coasting). No correction if 1.0 */ -float getFuelCutOffCorrection(efitick_t nowNt, int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getFuelCutOffCorrection(efitick_t nowNt, int rpm) { // no corrections by default float fuelCorr = 1.0f; @@ -403,7 +403,7 @@ float getFuelCutOffCorrection(efitick_t nowNt, int rpm DECLARE_ENGINE_PARAMETER_ return fuelCorr; } -float getBaroCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getBaroCorrection() { if (Sensor::hasSensor(SensorType::BarometricPressure)) { // Default to 1atm if failed float pressure = Sensor::get(SensorType::BarometricPressure).value_or(101.325f); @@ -424,11 +424,11 @@ float getBaroCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * @return Duration of fuel injection while craning */ -float getCrankingFuel(float baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX) { - return getCrankingFuel3(baseFuel, engine->rpmCalculator.getRevolutionCounterSinceStart() PASS_ENGINE_PARAMETER_SUFFIX); +float getCrankingFuel(float baseFuel) { + return getCrankingFuel3(baseFuel, engine->rpmCalculator.getRevolutionCounterSinceStart()); } -float getStandardAirCharge(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getStandardAirCharge() { float totalDisplacement = CONFIG(specs.displacement); float cylDisplacement = totalDisplacement / CONFIG(specs.cylindersCount); diff --git a/firmware/controllers/algo/fuel_math.h b/firmware/controllers/algo/fuel_math.h index 779b36b92d..6289989348 100644 --- a/firmware/controllers/algo/fuel_math.h +++ b/firmware/controllers/algo/fuel_math.h @@ -10,27 +10,27 @@ #include "engine_ptr.h" #include "rusefi_types.h" -void initFuelMap(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initFuelMap(); /** * @return baseFuel with CLT and IAT corrections */ -float getRunningFuel(float baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX); +float getRunningFuel(float baseFuel); -float getBaroCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE); -int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX); -angle_t getInjectionOffset(float rpm, float load DECLARE_ENGINE_PARAMETER_SUFFIX); -float getIatFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE); +float getBaroCorrection(); +int getNumberOfInjections(injection_mode_e mode); +angle_t getInjectionOffset(float rpm, float load); +float getIatFuelCorrection(); -float getCltFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE); -float getFuelCutOffCorrection(efitick_t nowNt, int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); -angle_t getCltTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE); -float getCrankingFuel(float baseFuel DECLARE_ENGINE_PARAMETER_SUFFIX); -float getCrankingFuel3(float baseFuel, uint32_t revolutionCounterSinceStart DECLARE_ENGINE_PARAMETER_SUFFIX); -float getInjectionMass(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); -percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); +float getCltFuelCorrection(); +float getFuelCutOffCorrection(efitick_t nowNt, int rpm); +angle_t getCltTimingCorrection(); +float getCrankingFuel(float baseFuel); +float getCrankingFuel3(float baseFuel, uint32_t revolutionCounterSinceStart); +float getInjectionMass(int rpm); +percent_t getInjectorDutyCycle(int rpm); -float getStandardAirCharge(DECLARE_ENGINE_PARAMETER_SIGNATURE); +float getStandardAirCharge(); struct AirmassModelBase; -AirmassModelBase* getAirmassModel(engine_load_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX); +AirmassModelBase* getAirmassModel(engine_load_mode_e mode); diff --git a/firmware/controllers/algo/launch_control.cpp b/firmware/controllers/algo/launch_control.cpp index ae20926eee..53cc6d6697 100644 --- a/firmware/controllers/algo/launch_control.cpp +++ b/firmware/controllers/algo/launch_control.cpp @@ -137,8 +137,8 @@ bool LaunchControlBase::isLaunchFuelRpmRetardCondition() const { return isLaunchRpmRetardCondition() && engineConfiguration->launchFuelCutEnable; } -void initLaunchControl(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - engine->launchController.inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void initLaunchControl() { + engine->launchController.inject(); } #endif /* EFI_LAUNCH_CONTROL */ diff --git a/firmware/controllers/algo/launch_control.h b/firmware/controllers/algo/launch_control.h index 4dd63668f7..dc70fba076 100644 --- a/firmware/controllers/algo/launch_control.h +++ b/firmware/controllers/algo/launch_control.h @@ -10,7 +10,7 @@ #include "engine_ptr.h" #include "timer.h" -void initLaunchControl(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initLaunchControl(); class LaunchControlBase : public EnginePtr { public: diff --git a/firmware/controllers/algo/wall_fuel.cpp b/firmware/controllers/algo/wall_fuel.cpp index c7928b88a8..c756bf6a9c 100644 --- a/firmware/controllers/algo/wall_fuel.cpp +++ b/firmware/controllers/algo/wall_fuel.cpp @@ -11,7 +11,7 @@ void WallFuel::resetWF() { wallFuel = 0; } -floatms_t WallFuel::adjust(floatms_t desiredFuel DECLARE_ENGINE_PARAMETER_SUFFIX) { +floatms_t WallFuel::adjust(floatms_t desiredFuel) { invocationCounter++; if (cisnan(desiredFuel)) { return desiredFuel; diff --git a/firmware/controllers/algo/wall_fuel.h b/firmware/controllers/algo/wall_fuel.h index 85efb6849d..43a6fd9889 100644 --- a/firmware/controllers/algo/wall_fuel.h +++ b/firmware/controllers/algo/wall_fuel.h @@ -15,7 +15,7 @@ public: * @param target desired squirt duration * @return total adjusted fuel squirt duration once wall wetting is taken into effect */ - floatms_t adjust(floatms_t target DECLARE_ENGINE_PARAMETER_SUFFIX); + floatms_t adjust(floatms_t target); floatms_t getWallFuel() const; void resetWF(); int invocationCounter = 0; diff --git a/firmware/controllers/buttonshift.cpp b/firmware/controllers/buttonshift.cpp index 0931e8a007..c374471dd6 100644 --- a/firmware/controllers/buttonshift.cpp +++ b/firmware/controllers/buttonshift.cpp @@ -20,12 +20,12 @@ ButtonShiftController::ButtonShiftController() : } -void ButtonShiftController::init(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void ButtonShiftController::init() { // 500 millisecond is maybe a little long? debounceUp.init(500, CONFIG(tcuUpshiftButtonPin), CONFIG(tcuUpshiftButtonPinMode)); debounceDown.init(500, CONFIG(tcuDownshiftButtonPin), CONFIG(tcuDownshiftButtonPinMode)); - GearControllerBase::init(PASS_ENGINE_PARAMETER_SIGNATURE); + GearControllerBase::init(); } void ButtonShiftController::update() { @@ -82,8 +82,8 @@ void ButtonShiftController::update() { } -void initButtonShift(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - buttonShiftController.init(PASS_ENGINE_PARAMETER_SIGNATURE); +void initButtonShift() { + buttonShiftController.init(); engine->gearController = &buttonShiftController; - buttonShiftController.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + buttonShiftController.inject(); } diff --git a/firmware/controllers/buttonshift.h b/firmware/controllers/buttonshift.h index e781cb5bf0..6896d66aa6 100644 --- a/firmware/controllers/buttonshift.h +++ b/firmware/controllers/buttonshift.h @@ -16,10 +16,10 @@ public: ButtonShiftController(); void update() override; - void init(DECLARE_ENGINE_PARAMETER_SIGNATURE) override; + void init() override; private: ButtonDebounce debounceUp; ButtonDebounce debounceDown; }; -void initButtonShift(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initButtonShift(); diff --git a/firmware/controllers/can/can_dash.cpp b/firmware/controllers/can/can_dash.cpp index 71ceda425e..0fd5ef4bc2 100644 --- a/firmware/controllers/can/can_dash.cpp +++ b/firmware/controllers/can/can_dash.cpp @@ -593,7 +593,7 @@ void canDashboardHaltech(CanCycle cycle) { CanTxMessage msg(0x362, 6); /* Injection Stage 1 Duty Cycle - y = x/10 */ uint16_t rpm = GET_RPM(); - tmp = (uint16_t)( getInjectorDutyCycle(rpm PASS_ENGINE_PARAMETER_SUFFIX) * 10) ; + tmp = (uint16_t)( getInjectorDutyCycle(rpm) * 10) ; msg[0] = (tmp >> 8); msg[1] = (tmp & 0x00ff); /* Injcetion Stage 2 Duty Cycle */ @@ -970,7 +970,7 @@ void canDashboardHaltech(CanCycle cycle) { msg[4] = 0x00; msg[5] = 0x00; /* Barometric pressure */ - tmp = (uint16_t)(getBaroPressure(PASS_ENGINE_PARAMETER_SIGNATURE)*10); + tmp = (uint16_t)(getBaroPressure()*10); msg[6] = (tmp >> 8); msg[7] = (tmp & 0x00ff); } diff --git a/firmware/controllers/can/can_rx.cpp b/firmware/controllers/can/can_rx.cpp index 1e30bfced9..617cd67e5b 100644 --- a/firmware/controllers/can/can_rx.cpp +++ b/firmware/controllers/can/can_rx.cpp @@ -14,7 +14,7 @@ typedef float SCRIPT_TABLE_8x8_f32t_linear[SCRIPT_TABLE_8 * SCRIPT_TABLE_8]; -bool acceptCanRx(int sid DECLARE_ENGINE_PARAMETER_SUFFIX) { +bool acceptCanRx(int sid) { if (!CONFIG(usescriptTableForCanSniffingFiltering)) { // accept anything if filtering is not enabled return true; diff --git a/firmware/controllers/can/can_rx.h b/firmware/controllers/can/can_rx.h index d606f3f435..c2dc2e743c 100644 --- a/firmware/controllers/can/can_rx.h +++ b/firmware/controllers/can/can_rx.h @@ -5,4 +5,4 @@ * @author Andrey Belomutskiy, (c) 2012-2021 */ -bool acceptCanRx(int sid DECLARE_ENGINE_PARAMETER_SUFFIX); +bool acceptCanRx(int sid); diff --git a/firmware/controllers/can/can_vss.cpp b/firmware/controllers/can/can_vss.cpp index e40380b0c6..976e73efd8 100644 --- a/firmware/controllers/can/can_vss.cpp +++ b/firmware/controllers/can/can_vss.cpp @@ -83,7 +83,7 @@ void processCanRxVss(const CANRxFrame& frame, efitick_t nowNt) { canSpeed.setValidValue(speed.Value, nowNt); #if EFI_DYNO_VIEW - updateDynoViewCan(PASS_ENGINE_PARAMETER_SIGNATURE); + updateDynoViewCan(); #endif } } diff --git a/firmware/controllers/can/obd2.cpp b/firmware/controllers/can/obd2.cpp index 78b73feadb..c47f50902d 100644 --- a/firmware/controllers/can/obd2.cpp +++ b/firmware/controllers/can/obd2.cpp @@ -117,7 +117,7 @@ static void handleGetDataRequest(const CANRxFrame& rx) { obdSendValue(_1_MODE, pid, 2, (2<<8)|(0)); // 2 = "Closed loop, using oxygen sensor feedback to determine fuel mix" break; case PID_ENGINE_LOAD: - obdSendValue(_1_MODE, pid, 1, getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE) * ODB_TPS_BYTE_PERCENT); + obdSendValue(_1_MODE, pid, 1, getFuelingLoad() * ODB_TPS_BYTE_PERCENT); break; case PID_COOLANT_TEMP: obdSendValue(_1_MODE, pid, 1, Sensor::getOrZero(SensorType::Clt) + ODB_TEMP_EXTRA); diff --git a/firmware/controllers/core/engine_ptr.h b/firmware/controllers/core/engine_ptr.h index 36bebd427d..8fc0a3a094 100644 --- a/firmware/controllers/core/engine_ptr.h +++ b/firmware/controllers/core/engine_ptr.h @@ -25,30 +25,14 @@ struct persistent_config_s; #if EFI_UNIT_TEST #ifdef __cplusplus - #define DECLARE_CONFIG_PARAMETER_SIGNATURE void - #define DECLARE_CONFIG_PARAMETER_SUFFIX - #define PASS_CONFIG_PARAMETER_SIGNATURE - #define PASS_CONFIG_PARAMETER_SUFFIX - - /** - * @see firmware/global.h for explanation - */ - #define DECLARE_ENGINE_PARAMETER_SIGNATURE void - #define DECLARE_ENGINE_PARAMETER_SUFFIX - #define PASS_ENGINE_PARAMETER_SIGNATURE - #define PASS_ENGINE_PARAMETER_SUFFIX - #define EXTERN_ENGINE extern engine_configuration_s & activeConfiguration struct EnginePtr { - void inject(DECLARE_ENGINE_PARAMETER_SIGNATURE) { + void inject() { } }; #endif // def __cplusplus - #define DEFINE_CONFIG_PARAM(x, y) - #define PASS_CONFIG_PARAM(x) - #define EXPAND_Engine #define CONFIG(x) engineConfiguration->x @@ -58,25 +42,10 @@ struct persistent_config_s; // These are the non-unit-test (AKA real firmware) noop versions #ifdef __cplusplus - // these macro are used when we should not have visibility to 'engine' - #define DECLARE_CONFIG_PARAMETER_SIGNATURE void - #define DECLARE_CONFIG_PARAMETER_SUFFIX - #define PASS_CONFIG_PARAMETER_SIGNATURE - #define PASS_CONFIG_PARAMETER_SUFFIX - - // Use this macro to declare a function which only takes magic references - #define DECLARE_ENGINE_PARAMETER_SIGNATURE void - // Use this version of the macro as the suffix if method has other parameters - #define DECLARE_ENGINE_PARAMETER_SUFFIX - // Pass this if only magic references are needed - #define PASS_ENGINE_PARAMETER_SIGNATURE - // Pass this after some other parameters are passed - #define PASS_ENGINE_PARAMETER_SUFFIX - #define ENGINE(x) ___engine.x struct EnginePtr { - void inject(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } + void inject() { } }; #endif // def __cplusplus @@ -90,9 +59,5 @@ struct persistent_config_s; */ #define CONFIG(x) persistentState.persistentConfiguration.engineConfiguration.x - #define DEFINE_CONFIG_PARAM(x, y) - #define CONFIG_PARAM(x) CONFIG(x) - #define PASS_CONFIG_PARAM(x) - #define EXPAND_Engine #endif // EFI_UNIT_TEST diff --git a/firmware/controllers/core/fsio_core.cpp b/firmware/controllers/core/fsio_core.cpp index e25187d88d..b212970093 100644 --- a/firmware/controllers/core/fsio_core.cpp +++ b/firmware/controllers/core/fsio_core.cpp @@ -156,7 +156,7 @@ static FsioResult doBinaryNumeric(le_action_e action, float v1, float v2) { /** * @return true in case of error, false otherwise */ -FsioResult LECalculator::processElement(const LEElement *element DECLARE_ENGINE_PARAMETER_SUFFIX) { +FsioResult LECalculator::processElement(const LEElement *element) { #if EFI_PROD_CODE efiAssert(CUSTOM_ERR_ASSERT, getCurrentRemainingStack() > 64, "FSIO logic", unexpected); #endif @@ -222,11 +222,11 @@ FsioResult LECalculator::processElement(const LEElement *element DECLARE_ENGINE_ warning(CUSTOM_UNKNOWN_FSIO, "FSIO undefined action"); return unexpected; default: - return getEngineValue(element->action PASS_ENGINE_PARAMETER_SUFFIX); + return getEngineValue(element->action); } } -float LECalculator::evaluate(const char * msg, float selfValue, const LEElement* element DECLARE_ENGINE_PARAMETER_SUFFIX) { +float LECalculator::evaluate(const char * msg, float selfValue, const LEElement* element) { if (!element) { warning(CUSTOM_NO_FSIO, "%s no FSIO code", msg); return NAN; @@ -243,7 +243,7 @@ float LECalculator::evaluate(const char * msg, float selfValue, const LEElement* if (element->action == LE_METHOD_SELF) { push(element->action, selfValue); } else { - FsioResult result = processElement(element PASS_ENGINE_PARAMETER_SUFFIX); + FsioResult result = processElement(element); if (!result) { // error already reported diff --git a/firmware/controllers/core/fsio_core.h b/firmware/controllers/core/fsio_core.h index 31bb37adf5..388cc868fd 100644 --- a/firmware/controllers/core/fsio_core.h +++ b/firmware/controllers/core/fsio_core.h @@ -128,7 +128,7 @@ typedef FLStack calc_stack_t; class LECalculator { public: LECalculator(); - float evaluate(const char * msg, float selfValue, const LEElement* element DECLARE_ENGINE_PARAMETER_SUFFIX); + float evaluate(const char * msg, float selfValue, const LEElement* element); void reset(); // Log history of calculation actions for debugging @@ -138,7 +138,7 @@ public: private: void push(le_action_e action, float value); - FsioResult processElement(const LEElement* element DECLARE_ENGINE_PARAMETER_SUFFIX); + FsioResult processElement(const LEElement* element); float pop(le_action_e action); calc_stack_t stack; diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index 035594ddf5..7fb5a392b3 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -85,7 +85,7 @@ static LEElement * mainRelayLogic; #if EFI_PROD_CODE || EFI_SIMULATOR -FsioResult getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) { +FsioResult getEngineValue(le_action_e action) { efiAssert(CUSTOM_ERR_ASSERT, engine!=NULL, "getLEValue", unexpected); switch (action) { case LE_METHOD_FAN: @@ -93,7 +93,7 @@ FsioResult getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) { case LE_METHOD_TIME_SINCE_AC_TOGGLE: return (getTimeNowUs() - engine->acSwitchLastChangeTime) / US_PER_SECOND_F; case LE_METHOD_AC_TOGGLE: - return getAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE); + return getAcToggle(); case LE_METHOD_COOLANT: return Sensor::getOrZero(SensorType::Clt); case LE_METHOD_IS_COOLANT_BROKEN: @@ -149,7 +149,7 @@ FsioResult getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) { #endif -void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX) { +void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfiguration) { (void)previousConfiguration; } @@ -182,7 +182,7 @@ static const char * action2String(le_action_e action) { return buffer; } -static void setPinState(const char * msg, OutputPin *pin, LEElement *element DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void setPinState(const char * msg, OutputPin *pin, LEElement *element) { #if EFI_PROD_CODE if (isRunningBenchTest()) { return; // let's not mess with bench testing @@ -192,7 +192,7 @@ static void setPinState(const char * msg, OutputPin *pin, LEElement *element DEC if (!element) { warning(CUSTOM_FSIO_INVALID_EXPRESSION, "invalid expression for %s", msg); } else { - int value = (int)calc.evaluate(msg, pin->getLogicValue(), element PASS_ENGINE_PARAMETER_SUFFIX); + int value = (int)calc.evaluate(msg, pin->getLogicValue(), element); if (pin->isInitialized() && value != pin->getLogicValue()) { for (int i = 0;i < calc.currentCalculationLogPosition;i++) { @@ -208,27 +208,27 @@ static void setPinState(const char * msg, OutputPin *pin, LEElement *element DEC /** * this method should be invoked periodically to calculate FSIO and toggle corresponding FSIO outputs */ -void runFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void runFsio() { #if EFI_FUEL_PUMP if (isBrainPinValid(CONFIG(fuelPumpPin))) { - setPinState("pump", &enginePins.fuelPumpRelay, fuelPumpLogic PASS_ENGINE_PARAMETER_SUFFIX); + setPinState("pump", &enginePins.fuelPumpRelay, fuelPumpLogic); } #endif /* EFI_FUEL_PUMP */ #if EFI_MAIN_RELAY_CONTROL if (isBrainPinValid(CONFIG(mainRelayPin))) // the MAIN_RELAY_LOGIC calls engine->isInShutdownMode() - setPinState("main_relay", &enginePins.mainRelay, mainRelayLogic PASS_ENGINE_PARAMETER_SUFFIX); + setPinState("main_relay", &enginePins.mainRelay, mainRelayLogic); #else /* EFI_MAIN_RELAY_CONTROL */ /** * main relay is always on if ECU is on, that's a good enough initial implementation */ if (isBrainPinValid(CONFIG(mainRelayPin))) - enginePins.mainRelay.setValue(!engine->isInMainRelayBench(PASS_ENGINE_PARAMETER_SIGNATURE)); + enginePins.mainRelay.setValue(!engine->isInMainRelayBench()); #endif /* EFI_MAIN_RELAY_CONTROL */ if (isBrainPinValid(CONFIG(starterRelayDisablePin))) - setPinState("starter_relay", &enginePins.starterRelayDisable, starterRelayDisableLogic PASS_ENGINE_PARAMETER_SUFFIX); + setPinState("starter_relay", &enginePins.starterRelayDisable, starterRelayDisableLogic); /** * o2 heater is off during cranking @@ -282,7 +282,7 @@ ValueProvider3D *getscriptTable(int index) { /** * @return zero-based index of curve with given name */ -int getCurveIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX) { +int getCurveIndexByName(const char *name) { for (int i = 0;iscriptCurveName[i])) { return i; @@ -291,7 +291,7 @@ int getCurveIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX) { return EFI_ERROR_CODE; } -int getTableIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX) { +int getTableIndexByName(const char *name) { for (int i = 0;iscriptTableName[i])) { return i; @@ -300,7 +300,7 @@ int getTableIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX) { return EFI_ERROR_CODE; } -int getSettingIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX) { +int getSettingIndexByName(const char *name) { for (int i = 0;iscriptSettingName[i])) { return i; @@ -309,7 +309,7 @@ int getSettingIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX) { return EFI_ERROR_CODE; } -float getCurveValue(int index, float key DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getCurveValue(int index, float key) { // not great code at all :( switch (index) { default: @@ -327,7 +327,7 @@ float getCurveValue(int index, float key DECLARE_ENGINE_PARAMETER_SUFFIX) { } } -void initFsioImpl(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initFsioImpl() { #if EFI_UNIT_TEST // only unit test needs this sysPool.reset(); @@ -358,7 +358,7 @@ void initFsioImpl(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #else /* !EFI_FSIO */ // "Limp-mode" implementation for some RAM-limited configs without FSIO -void runHardcodedFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void runHardcodedFsio() { #if EFI_PROD_CODE if (isRunningBenchTest()) { return; // let's not mess with bench testing diff --git a/firmware/controllers/core/fsio_impl.h b/firmware/controllers/core/fsio_impl.h index f125dd1f56..120c4e18d1 100644 --- a/firmware/controllers/core/fsio_impl.h +++ b/firmware/controllers/core/fsio_impl.h @@ -20,17 +20,17 @@ typedef Map3D fsio8_Map3D_f32t; typedef Map3D fsio8_Map3D_u8t; -expected getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX); +expected getEngineValue(le_action_e action); -void initFsioImpl(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void runFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initFsioImpl(); +void runFsio(); -void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX); -void runHardcodedFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfiguration); +void runHardcodedFsio(); -float getCurveValue(int index, float key DECLARE_ENGINE_PARAMETER_SUFFIX); -int getCurveIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX); -int getTableIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX); -int getSettingIndexByName(const char *name DECLARE_ENGINE_PARAMETER_SUFFIX); +float getCurveValue(int index, float key); +int getCurveIndexByName(const char *name); +int getTableIndexByName(const char *name); +int getSettingIndexByName(const char *name); ValueProvider3D *getscriptTable(int index); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index e401f57082..ad19c9ee27 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -107,17 +107,17 @@ Engine * engine; #endif /* EFI_UNIT_TEST */ -void initDataStructures(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initDataStructures() { #if EFI_ENGINE_CONTROL - initFuelMap(PASS_ENGINE_PARAMETER_SIGNATURE); - initTimingMap(PASS_ENGINE_PARAMETER_SIGNATURE); - initSpeedDensity(PASS_ENGINE_PARAMETER_SIGNATURE); + initFuelMap(); + initTimingMap(); + initSpeedDensity(); #endif // EFI_ENGINE_CONTROL } #if !EFI_UNIT_TEST -static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE); +static void doPeriodicSlowCallback(); class PeriodicFastController : public PeriodicTimerController { void PeriodicTask() override { @@ -131,7 +131,7 @@ class PeriodicFastController : public PeriodicTimerController { class PeriodicSlowController : public PeriodicTimerController { void PeriodicTask() override { - doPeriodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + doPeriodicSlowCallback(); } int getPeriodMs() override { @@ -194,11 +194,11 @@ static void resetAccel() { } } -static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void doPeriodicSlowCallback() { #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT efiAssertVoid(CUSTOM_ERR_6661, getCurrentRemainingStack() > 64, "lowStckOnEv"); - slowStartStopButtonCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + slowStartStopButtonCallback(); efitick_t nowNt = getTimeNowNt(); @@ -215,9 +215,9 @@ static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * Update engine RPM state if needed (check timeouts). */ - bool isSpinning = engine->rpmCalculator.checkIfSpinning(nowNt PASS_ENGINE_PARAMETER_SUFFIX); + bool isSpinning = engine->rpmCalculator.checkIfSpinning(nowNt); if (!isSpinning) { - engine->rpmCalculator.setStopSpinning(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->rpmCalculator.setStopSpinning(); } if (ENGINE(directSelfStimulation) || engine->rpmCalculator.isStopped()) { @@ -235,14 +235,14 @@ static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { if (engine->rpmCalculator.isStopped()) { resetAccel(); } else { - updatePrimeInjectionPulseState(PASS_ENGINE_PARAMETER_SIGNATURE); + updatePrimeInjectionPulseState(); } if (engine->versionForConfigurationListeners.isOld(engine->getGlobalConfigurationVersion())) { updateAccelParameters(); } - engine->periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicSlowCallback(); #endif /* if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT */ if (CONFIG(tcuEnabled)) { @@ -250,7 +250,7 @@ static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } } -void initPeriodicEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initPeriodicEvents() { slowController.Start(); fastController.Start(); } @@ -291,7 +291,7 @@ static void printAnalogChannelInfoExt(const char *name, adc_channel_e hwChannel, static void printAnalogChannelInfo(const char *name, adc_channel_e hwChannel) { #if HAL_USE_ADC - printAnalogChannelInfoExt(name, hwChannel, getVoltage(name, hwChannel PASS_ENGINE_PARAMETER_SUFFIX), engineConfiguration->analogInputDividerCoefficient); + printAnalogChannelInfoExt(name, hwChannel, getVoltage(name, hwChannel), engineConfiguration->analogInputDividerCoefficient); #endif /* HAL_USE_ADC */ } @@ -329,7 +329,7 @@ static void printAnalogInfo() { printAnalogChannelInfo("HIP9011", engineConfiguration->hipOutputChannel); - printAnalogChannelInfoExt("Vbatt", engineConfiguration->vbattAdcChannel, getVoltage("vbatt", engineConfiguration->vbattAdcChannel PASS_ENGINE_PARAMETER_SUFFIX), + printAnalogChannelInfoExt("Vbatt", engineConfiguration->vbattAdcChannel, getVoltage("vbatt", engineConfiguration->vbattAdcChannel), engineConfiguration->vbattDividerCoeff); } @@ -364,7 +364,7 @@ static void onConfigurationChanged() { // we have a bit of a mess here syncTunerStudioCopy(); #endif /* EFI_TUNER_STUDIO */ - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } static void setBit(const char *offsetStr, const char *bitStr, const char *valueStr) { @@ -490,7 +490,7 @@ static void initConfigActions() { #endif /* EFI_UNIT_TEST */ // this method is used by real firmware and simulator and unit test -void commonInitEngineController(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void commonInitEngineController() { initInterpolation(); #if EFI_SIMULATOR @@ -506,7 +506,7 @@ void commonInitEngineController(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * This has to go after 'enginePins.startPins()' in order to * properly detect un-assigned output pins */ - prepareShapes(PASS_ENGINE_PARAMETER_SIGNATURE); + prepareShapes(); #endif /* EFI_PROD_CODE && EFI_ENGINE_CONTROL */ #if EFI_SENSOR_CHART @@ -527,41 +527,41 @@ void commonInitEngineController(DECLARE_ENGINE_PARAMETER_SIGNATURE) { initNewSensors(); #endif /* EFI_UNIT_TEST */ - initSensors(PASS_ENGINE_PARAMETER_SIGNATURE); + initSensors(); - initAccelEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE); + initAccelEnrichment(); #if EFI_FSIO - initFsioImpl(PASS_ENGINE_PARAMETER_SIGNATURE); + initFsioImpl(); #endif /* EFI_FSIO */ - initGpPwm(PASS_ENGINE_PARAMETER_SIGNATURE); + initGpPwm(); #if EFI_IDLE_CONTROL - startIdleThread(PASS_ENGINE_PARAMETER_SIGNATURE); + startIdleThread(); #endif /* EFI_IDLE_CONTROL */ - initButtonShift(PASS_ENGINE_PARAMETER_SIGNATURE); + initButtonShift(); initButtonDebounce(); - initStartStopButton(PASS_ENGINE_PARAMETER_SIGNATURE); + initStartStopButton(); #if EFI_ELECTRONIC_THROTTLE_BODY - initElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE); + initElectronicThrottle(); #endif /* EFI_ELECTRONIC_THROTTLE_BODY */ #if EFI_MAP_AVERAGING if (engineConfiguration->isMapAveragingEnabled) { - initMapAveraging(PASS_ENGINE_PARAMETER_SIGNATURE); + initMapAveraging(); } #endif /* EFI_MAP_AVERAGING */ #if EFI_BOOST_CONTROL - initBoostCtrl(PASS_ENGINE_PARAMETER_SIGNATURE); + initBoostCtrl(); #endif /* EFI_BOOST_CONTROL */ #if EFI_LAUNCH_CONTROL - initLaunchControl(PASS_ENGINE_PARAMETER_SIGNATURE); + initLaunchControl(); #endif #if EFI_SHAFT_POSITION_INPUT @@ -569,27 +569,27 @@ void commonInitEngineController(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * there is an implicit dependency on the fact that 'tachometer' listener is the 1st listener - this case * other listeners can access current RPM value */ - initRpmCalculator(PASS_ENGINE_PARAMETER_SIGNATURE); + initRpmCalculator(); #endif /* EFI_SHAFT_POSITION_INPUT */ #if (EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT) || EFI_SIMULATOR || EFI_UNIT_TEST if (CONFIG(isEngineControlEnabled)) { - initAuxValves(PASS_ENGINE_PARAMETER_SIGNATURE); + initAuxValves(); /** * This method adds trigger listener which actually schedules ignition */ - initMainEventListener(PASS_ENGINE_PARAMETER_SIGNATURE); + initMainEventListener(); #if EFI_HPFP - initHPFP(PASS_ENGINE_PARAMETER_SIGNATURE); + initHPFP(); #endif // EFI_HPFP } #endif /* EFI_ENGINE_CONTROL */ - initTachometer(PASS_ENGINE_PARAMETER_SIGNATURE); + initTachometer(); } // Returns false if there's an obvious problem with the loaded configuration -bool validateConfig(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +bool validateConfig() { if (CONFIG(specs.cylindersCount) > MAX_CYLINDER_COUNT) { firmwareError(OBD_PCM_Processor_Fault, "Invalid cylinder count: %d", CONFIG(specs.cylindersCount)); return false; @@ -690,7 +690,7 @@ bool validateConfig(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #if !EFI_UNIT_TEST -void initEngineContoller(DECLARE_ENGINE_PARAMETER_SUFFIX) { +void initEngineContoller() { addConsoleAction("analoginfo", printAnalogInfo); #if EFI_PROD_CODE && EFI_ENGINE_CONTROL @@ -709,7 +709,7 @@ void initEngineContoller(DECLARE_ENGINE_PARAMETER_SUFFIX) { /** * this uses SimplePwm which depends on scheduler, has to be initialized after scheduler */ - initCJ125(PASS_ENGINE_PARAMETER_SIGNATURE); + initCJ125(); #endif /* EFI_CJ125 */ if (hasFirmwareError()) { @@ -718,14 +718,14 @@ void initEngineContoller(DECLARE_ENGINE_PARAMETER_SUFFIX) { engineStateBlinkingTask.Start(); - initVrPwm(PASS_ENGINE_PARAMETER_SIGNATURE); + initVrPwm(); #if EFI_PWM_TESTER initPwmTester(); #endif /* EFI_PWM_TESTER */ #if EFI_ALTERNATOR_CONTROL - initAlternatorCtrl(PASS_ENGINE_PARAMETER_SIGNATURE); + initAlternatorCtrl(); #endif /* EFI_ALTERNATOR_CONTROL */ #if EFI_AUX_PID @@ -736,7 +736,7 @@ void initEngineContoller(DECLARE_ENGINE_PARAMETER_SUFFIX) { initMalfunctionIndicator(); #endif /* EFI_MALFUNCTION_INDICATOR */ - initEgoAveraging(PASS_ENGINE_PARAMETER_SIGNATURE); + initEgoAveraging(); #if EFI_PROD_CODE addConsoleAction("reset_accel", resetAccel); diff --git a/firmware/controllers/engine_controller.h b/firmware/controllers/engine_controller.h index 42eef415d0..437d74e62b 100644 --- a/firmware/controllers/engine_controller.h +++ b/firmware/controllers/engine_controller.h @@ -8,23 +8,23 @@ #pragma once -bool validateConfig(DECLARE_CONFIG_PARAMETER_SIGNATURE); +bool validateConfig(); char * getPinNameByAdcChannel(const char *msg, adc_channel_e hwChannel, char *buffer); -void initPeriodicEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void initEngineContoller(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void commonInitEngineController(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void initStartStopButton(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initPeriodicEvents(); +void initEngineContoller(); +void commonInitEngineController(); +void initStartStopButton(); -void initDataStructures(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initDataStructures(); -void slowStartStopButtonCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void slowStartStopButtonCallback(); #if EFI_ENABLE_MOCK_ADC -void setMockVoltage(int hwChannel, float voltage DECLARE_ENGINE_PARAMETER_SUFFIX); +void setMockVoltage(int hwChannel, float voltage); #endif -void setMockMapVoltage(float voltage DECLARE_ENGINE_PARAMETER_SUFFIX); -void setMockAfrVoltage(float voltage DECLARE_ENGINE_PARAMETER_SUFFIX); -void setMockMafVoltage(float voltage DECLARE_ENGINE_PARAMETER_SUFFIX); +void setMockMapVoltage(float voltage); +void setMockAfrVoltage(float voltage); +void setMockMafVoltage(float voltage); void printCurrentState(Logging *logging, int seconds, const char *engineTypeName, const char *firmwareBuildId); diff --git a/firmware/controllers/engine_controller_misc.cpp b/firmware/controllers/engine_controller_misc.cpp index 9d826d0804..8011f2c2e6 100644 --- a/firmware/controllers/engine_controller_misc.cpp +++ b/firmware/controllers/engine_controller_misc.cpp @@ -37,20 +37,20 @@ void contextSwitchHook() {} #endif /* ENABLE_PERF_TRACE */ #if EFI_ENABLE_MOCK_ADC -void setMockVoltage(int hwChannel, float voltage DECLARE_ENGINE_PARAMETER_SUFFIX) { - engine->engineState.mockAdcState.setMockVoltage(hwChannel, voltage PASS_ENGINE_PARAMETER_SUFFIX); +void setMockVoltage(int hwChannel, float voltage) { + engine->engineState.mockAdcState.setMockVoltage(hwChannel, voltage); } -void setMockMafVoltage(float voltage DECLARE_ENGINE_PARAMETER_SUFFIX) { - setMockVoltage(engineConfiguration->mafAdcChannel, voltage PASS_ENGINE_PARAMETER_SUFFIX); +void setMockMafVoltage(float voltage) { + setMockVoltage(engineConfiguration->mafAdcChannel, voltage); } -void setMockAfrVoltage(float voltage DECLARE_ENGINE_PARAMETER_SUFFIX) { - setMockVoltage(engineConfiguration->afr.hwChannel, voltage PASS_ENGINE_PARAMETER_SUFFIX); +void setMockAfrVoltage(float voltage) { + setMockVoltage(engineConfiguration->afr.hwChannel, voltage); } -void setMockMapVoltage(float voltage DECLARE_ENGINE_PARAMETER_SUFFIX) { - setMockVoltage(engineConfiguration->map.sensor.hwChannel, voltage PASS_ENGINE_PARAMETER_SUFFIX); +void setMockMapVoltage(float voltage) { + setMockVoltage(engineConfiguration->map.sensor.hwChannel, voltage); } #endif /* EFI_ENABLE_MOCK_ADC */ @@ -71,7 +71,7 @@ efitick_t getTimeNowNt() { } #endif /* !EFI_UNIT_TEST */ -static void onStartStopButtonToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void onStartStopButtonToggle() { engine->startStopStateToggleCounter++; if (engine->rpmCalculator.isStopped()) { @@ -84,17 +84,17 @@ static void onStartStopButtonToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } } else if (engine->rpmCalculator.isRunning()) { efiPrintf("Let's stop this engine!"); - doScheduleStopEngine(PASS_ENGINE_PARAMETER_SIGNATURE); + doScheduleStopEngine(); } } -void slowStartStopButtonCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void slowStartStopButtonCallback() { bool startStopState = startStopButtonDebounce.readPinEvent(); if (startStopState && !engine->startStopState) { // we are here on transition from 0 to 1 - onStartStopButtonToggle(PASS_ENGINE_PARAMETER_SIGNATURE); + onStartStopButtonToggle(); } engine->startStopState = startStopState; diff --git a/firmware/controllers/engine_cycle/aux_valves.cpp b/firmware/controllers/engine_cycle/aux_valves.cpp index 0055292adf..e2e4afc2a9 100644 --- a/firmware/controllers/engine_cycle/aux_valves.cpp +++ b/firmware/controllers/engine_cycle/aux_valves.cpp @@ -30,7 +30,6 @@ static void scheduleOpen(AuxActor *current) { getTimeNowNt(), current->extra + engine->engineState.auxValveStart, { auxPlainPinTurnOn, current } - PASS_ENGINE_PARAMETER_SUFFIX ); } @@ -49,11 +48,10 @@ void auxPlainPinTurnOn(AuxActor *current) { getTimeNowNt(), current->extra + engine->engineState.auxValveEnd, { plainPinTurnOff, output } - PASS_ENGINE_PARAMETER_SUFFIX ); } -void initAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initAuxValves() { if (!isBrainPinValid(engineConfiguration->auxValves[0])) { return; } @@ -63,7 +61,7 @@ void initAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return; } - recalculateAuxValveTiming(PASS_ENGINE_PARAMETER_SIGNATURE); + recalculateAuxValveTiming(); for (int valveIndex = 0; valveIndex < AUX_DIGITAL_VALVE_COUNT; valveIndex++) { @@ -73,13 +71,13 @@ void initAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE) { actor->valveIndex = valveIndex; actor->extra = phaseIndex * 360 + valveIndex * 180; - actor->inject(PASS_ENGINE_PARAMETER_SIGNATURE); + actor->inject(); scheduleOpen(actor); } } } -void recalculateAuxValveTiming(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void recalculateAuxValveTiming() { if (!isBrainPinValid(engineConfiguration->auxValves[0])) { return; } diff --git a/firmware/controllers/engine_cycle/aux_valves.h b/firmware/controllers/engine_cycle/aux_valves.h index b581bf0d35..6a04d3ffc6 100644 --- a/firmware/controllers/engine_cycle/aux_valves.h +++ b/firmware/controllers/engine_cycle/aux_valves.h @@ -7,6 +7,6 @@ #pragma once -void initAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void recalculateAuxValveTiming(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initAuxValves(); +void recalculateAuxValveTiming(); void auxPlainPinTurnOn(AuxActor *current); diff --git a/firmware/controllers/engine_cycle/fuel_schedule.cpp b/firmware/controllers/engine_cycle/fuel_schedule.cpp index b707109d87..7ea2678f87 100644 --- a/firmware/controllers/engine_cycle/fuel_schedule.cpp +++ b/firmware/controllers/engine_cycle/fuel_schedule.cpp @@ -29,7 +29,7 @@ void FuelSchedule::resetOverlapping() { /** * @returns false in case of error, true if success */ -bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFFIX) { +bool FuelSchedule::addFuelEventsForCylinder(int i ) { efiAssert(CUSTOM_ERR_ASSERT, engine!=NULL, "engine is NULL", false); floatus_t oneDegreeUs = ENGINE(rpmCalculator.oneDegreeUs); // local copy @@ -60,7 +60,7 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFF efiAssert(CUSTOM_ERR_ASSERT, !cisnan(baseAngle), "NaN baseAngle", false); assertAngleRange(baseAngle, "baseAngle_r", CUSTOM_ERR_6554); - injection_mode_e mode = engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE); + injection_mode_e mode = engine->getCurrentInjectionMode(); int injectorIndex; if (mode == IM_SIMULTANEOUS || mode == IM_SINGLE_POINT) { @@ -68,7 +68,7 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFF injectorIndex = 0; } else if (mode == IM_SEQUENTIAL || (mode == IM_BATCH && CONFIG(twoWireBatchInjection))) { // Map order index -> cylinder index (firing order) - injectorIndex = getCylinderId(i PASS_ENGINE_PARAMETER_SUFFIX) - 1; + injectorIndex = getCylinderId(i) - 1; } else if (mode == IM_BATCH) { // Loop over the first half of the firing order twice injectorIndex = i % (engineConfiguration->specs.cylindersCount / 2); @@ -86,7 +86,7 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFF // Each injector gets fired as a primary (the same as sequential), but also // fires the injector 360 degrees later in the firing order. int secondOrder = (i + (CONFIG(specs.cylindersCount) / 2)) % CONFIG(specs.cylindersCount); - int secondIndex = getCylinderId(secondOrder PASS_ENGINE_PARAMETER_SUFFIX) - 1; + int secondIndex = getCylinderId(secondOrder) - 1; secondOutput = &enginePins.injectors[secondIndex]; } else { secondOutput = nullptr; @@ -96,7 +96,7 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFF bool isSimultanious = mode == IM_SIMULTANEOUS; InjectionEvent *ev = &elements[i]; - ev->inject(PASS_ENGINE_PARAMETER_SIGNATURE); + ev->inject(); ev->ownIndex = i; ev->outputs[0] = output; @@ -121,18 +121,18 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFF efiAssert(CUSTOM_ERR_ASSERT, !cisnan(angle), "findAngle#3", false); assertAngleRange(angle, "findAngle#a33", CUSTOM_ERR_6544); - ev->injectionStart.setAngle(angle PASS_ENGINE_PARAMETER_SUFFIX); + ev->injectionStart.setAngle(angle); #if EFI_UNIT_TEST printf("registerInjectionEvent angle=%.2f trgIndex=%d inj %d\r\n", angle, ev->injectionStart.triggerEventIndex, injectorIndex); #endif return true; } -void FuelSchedule::addFuelEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void FuelSchedule::addFuelEvents() { for (size_t cylinderIndex = 0; cylinderIndex < CONFIG(specs.cylindersCount); cylinderIndex++) { InjectionEvent *ev = &elements[cylinderIndex]; ev->ownIndex = cylinderIndex; // todo: is this assignment needed here? we now initialize in constructor - bool result = addFuelEventsForCylinder(cylinderIndex PASS_ENGINE_PARAMETER_SUFFIX); + bool result = addFuelEventsForCylinder(cylinderIndex); if (!result) { invalidate(); return; @@ -143,7 +143,7 @@ void FuelSchedule::addFuelEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE) { isReady = true; } -void FuelSchedule::onTriggerTooth(size_t toothIndex, int rpm, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { +void FuelSchedule::onTriggerTooth(size_t toothIndex, int rpm, efitick_t nowNt) { // Wait for schedule to be built - this happens the first time we get RPM if (!isReady) { return; diff --git a/firmware/controllers/engine_cycle/high_pressure_fuel_pump.cpp b/firmware/controllers/engine_cycle/high_pressure_fuel_pump.cpp index 0718e1e1e4..f117c759ce 100644 --- a/firmware/controllers/engine_cycle/high_pressure_fuel_pump.cpp +++ b/firmware/controllers/engine_cycle/high_pressure_fuel_pump.cpp @@ -16,7 +16,7 @@ #if EFI_HPFP -void initHPFP(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initHPFP() { // Deleted to make new code diff easier } diff --git a/firmware/controllers/engine_cycle/high_pressure_fuel_pump.h b/firmware/controllers/engine_cycle/high_pressure_fuel_pump.h index 50003abff2..1e094dd6ea 100644 --- a/firmware/controllers/engine_cycle/high_pressure_fuel_pump.h +++ b/firmware/controllers/engine_cycle/high_pressure_fuel_pump.h @@ -7,4 +7,4 @@ #pragma once -void initHPFP(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initHPFP(); diff --git a/firmware/controllers/engine_cycle/knock_logic.cpp b/firmware/controllers/engine_cycle/knock_logic.cpp index 81d68c086b..2bdcc62223 100644 --- a/firmware/controllers/engine_cycle/knock_logic.cpp +++ b/firmware/controllers/engine_cycle/knock_logic.cpp @@ -118,8 +118,6 @@ static uint8_t cylinderIndexCopy; // Called when its time to start listening for knock // Does some math, then hands off to the driver to start any sampling hardware static void startKnockSampling(Engine* engine) { - EXPAND_Engine; - if (!engine->rpmCalculator.isRunning()) { return; } @@ -141,7 +139,7 @@ void Engine::onSparkFireKnockSense(uint8_t cylinderIndex, efitick_t nowNt) { #if EFI_HIP_9011 || EFI_SOFTWARE_KNOCK scheduleByAngle(&startSampling, nowNt, - /*angle*/CONFIG(knockDetectionWindowStart), { startKnockSampling, engine } PASS_ENGINE_PARAMETER_SUFFIX); + /*angle*/CONFIG(knockDetectionWindowStart), { startKnockSampling, engine }); #endif #if EFI_HIP_9011 diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index ff3d04e200..378f70335f 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -56,33 +56,27 @@ //#define RAM_METHOD_PREFIX //#endif -void startSimultaniousInjection(Engine *engine) { -#if EFI_UNIT_TEST - EXPAND_Engine; -#endif // EFI_UNIT_TEST +void startSimultaniousInjection(void*) { efitick_t nowNt = getTimeNowNt(); for (size_t i = 0; i < CONFIG(specs.cylindersCount); i++) { - enginePins.injectors[i].open(nowNt PASS_ENGINE_PARAMETER_SUFFIX); + enginePins.injectors[i].open(nowNt); } } -static void endSimultaniousInjectionOnlyTogglePins(Engine *engine) { -#if EFI_UNIT_TEST - EXPAND_Engine; -#endif +static void endSimultaniousInjectionOnlyTogglePins(void*) { efitick_t nowNt = getTimeNowNt(); for (size_t i = 0; i < CONFIG(specs.cylindersCount); i++) { - enginePins.injectors[i].close(nowNt PASS_ENGINE_PARAMETER_SUFFIX); + enginePins.injectors[i].close(nowNt); } } void endSimultaniousInjection(InjectionEvent *event) { event->isScheduled = false; endSimultaniousInjectionOnlyTogglePins(engine); - engine->injectionEvents.addFuelEventsForCylinder(event->ownIndex PASS_ENGINE_PARAMETER_SUFFIX); + engine->injectionEvents.addFuelEventsForCylinder(event->ownIndex); } -void InjectorOutputPin::open(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { +void InjectorOutputPin::open(efitick_t nowNt) { overlappingCounter++; #if FUEL_MATH_EXTREME_LOGGING @@ -103,9 +97,9 @@ void InjectorOutputPin::open(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { #endif /* FUEL_MATH_EXTREME_LOGGING */ } else { #if EFI_TOOTH_LOGGER - LogTriggerInjectorState(nowNt, true PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerInjectorState(nowNt, true); #endif // EFI_TOOTH_LOGGER - this->inject(PASS_ENGINE_PARAMETER_SIGNATURE); + this->inject(); setHigh(); } } @@ -116,12 +110,12 @@ void turnInjectionPinHigh(InjectionEvent *event) { InjectorOutputPin *output = event->outputs[i]; if (output) { - output->open(nowNt PASS_ENGINE_PARAMETER_SUFFIX); + output->open(nowNt); } } } -void InjectorOutputPin::close(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { +void InjectorOutputPin::close(efitick_t nowNt) { #if FUEL_MATH_EXTREME_LOGGING if (printFuelDebug) { printf("InjectorOutputPin::close %s %d %d\r\n", name, overlappingCounter, (int)getTimeNowUs()); @@ -137,7 +131,7 @@ void InjectorOutputPin::close(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { #endif /* FUEL_MATH_EXTREME_LOGGING */ } else { #if EFI_TOOTH_LOGGER - LogTriggerInjectorState(nowNt, false PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerInjectorState(nowNt, false); #endif // EFI_TOOTH_LOGGER setLow(); } @@ -158,10 +152,10 @@ void turnInjectionPinLow(InjectionEvent *event) { for (int i = 0;ioutputs[i]; if (output) { - output->close(nowNt PASS_ENGINE_PARAMETER_SUFFIX); + output->close(nowNt); } } - ENGINE(injectionEvents.addFuelEventsForCylinder(event->ownIndex PASS_ENGINE_PARAMETER_SUFFIX)); + ENGINE(injectionEvents.addFuelEventsForCylinder(event->ownIndex)); } void InjectionEvent::onTriggerTooth(size_t trgEventIndex, int rpm, efitick_t nowNt) { @@ -178,7 +172,7 @@ void InjectionEvent::onTriggerTooth(size_t trgEventIndex, int rpm, efitick_t now // Perform wall wetting adjustment on fuel mass, not duration, so that // it's correct during fuel pressure (injector flow) or battery voltage (deadtime) transients - injectionMassGrams = wallFuel.adjust(injectionMassGrams PASS_ENGINE_PARAMETER_SUFFIX); + injectionMassGrams = wallFuel.adjust(injectionMassGrams); const floatms_t injectionDuration = ENGINE(injectorModel)->getInjectionDuration(injectionMassGrams); #if EFI_PRINTF_FUEL_DETAILS @@ -195,8 +189,8 @@ void InjectionEvent::onTriggerTooth(size_t trgEventIndex, int rpm, efitick_t now * todo: pre-calculate 'numberOfInjections' * see also injectorDutyCycle */ - int numberOfInjections = isCranking ? getNumberOfInjections(engineConfiguration->crankingInjectionMode PASS_ENGINE_PARAMETER_SUFFIX) : getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX); - if (injectionDuration * numberOfInjections > getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX)) { + int numberOfInjections = isCranking ? getNumberOfInjections(engineConfiguration->crankingInjectionMode) : getNumberOfInjections(engineConfiguration->injectionMode); + if (injectionDuration * numberOfInjections > getEngineCycleDuration(rpm)) { warning(CUSTOM_TOO_LONG_FUEL_INJECTION, "Too long fuel injection %.2fms", injectionDuration); } @@ -262,7 +256,7 @@ void InjectionEvent::onTriggerTooth(size_t trgEventIndex, int rpm, efitick_t now action_s startAction, endAction; // We use different callbacks based on whether we're running sequential mode or not - everything else is the same if (isSimultanious) { - startAction = { &startSimultaniousInjection, engine }; + startAction = startSimultaniousInjection; endAction = { &endSimultaniousInjection, this }; } else { // sequential or batch @@ -270,7 +264,7 @@ void InjectionEvent::onTriggerTooth(size_t trgEventIndex, int rpm, efitick_t now endAction = { &turnInjectionPinLow, this }; } - efitick_t startTime = scheduleByAngle(&signalTimerUp, nowNt, injectionStart.angleOffsetFromTriggerEvent, startAction PASS_ENGINE_PARAMETER_SUFFIX); + efitick_t startTime = scheduleByAngle(&signalTimerUp, nowNt, injectionStart.angleOffsetFromTriggerEvent, startAction); efitick_t turnOffTime = startTime + US2NT((int)durationUs); engine->executor.scheduleByTimestampNt("inj", &endOfInjectionEvent, turnOffTime, endAction); @@ -287,15 +281,15 @@ void InjectionEvent::onTriggerTooth(size_t trgEventIndex, int rpm, efitick_t now #endif /* EFI_DEFAILED_LOGGING */ } -static void handleFuel(const bool limitedFuel, uint32_t trgEventIndex, int rpm, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void handleFuel(const bool limitedFuel, uint32_t trgEventIndex, int rpm, efitick_t nowNt) { ScopePerf perf(PE::HandleFuel); efiAssertVoid(CUSTOM_STACK_6627, getCurrentRemainingStack() > 128, "lowstck#3"); efiAssertVoid(CUSTOM_ERR_6628, trgEventIndex < engine->engineCycleEventCount, "handleFuel/event index"); - ENGINE(tpsAccelEnrichment.onNewValue(Sensor::getOrZero(SensorType::Tps1) PASS_ENGINE_PARAMETER_SUFFIX)); + ENGINE(tpsAccelEnrichment.onNewValue(Sensor::getOrZero(SensorType::Tps1))); if (trgEventIndex == 0) { - ENGINE(tpsAccelEnrichment.onEngineCycleTps(PASS_ENGINE_PARAMETER_SIGNATURE)); + ENGINE(tpsAccelEnrichment.onEngineCycleTps()); } if (limitedFuel) { @@ -307,7 +301,7 @@ static void handleFuel(const bool limitedFuel, uint32_t trgEventIndex, int rpm, // If duty cycle is high, impose a fuel cut rev limiter. // This is safer than attempting to limp along with injectors or a pump that are out of flow. - if (getInjectorDutyCycle(rpm PASS_ENGINE_PARAMETER_SUFFIX) > 96.0f) { + if (getInjectorDutyCycle(rpm) > 96.0f) { warning(CUSTOM_OBD_63, "Injector Duty cycle cut"); return; } @@ -318,7 +312,7 @@ static void handleFuel(const bool limitedFuel, uint32_t trgEventIndex, int rpm, */ FuelSchedule *fs = &ENGINE(injectionEvents); if (!fs->isReady) { - fs->addFuelEvents(PASS_ENGINE_PARAMETER_SIGNATURE); + fs->addFuelEvents(); } #if FUEL_MATH_EXTREME_LOGGING @@ -327,7 +321,7 @@ static void handleFuel(const bool limitedFuel, uint32_t trgEventIndex, int rpm, } #endif /* FUEL_MATH_EXTREME_LOGGING */ - fs->onTriggerTooth(trgEventIndex, rpm, nowNt PASS_ENGINE_PARAMETER_SUFFIX); + fs->onTriggerTooth(trgEventIndex, rpm, nowNt); } #if EFI_PROD_CODE @@ -341,7 +335,7 @@ uint32_t *cyccnt = (uint32_t*) &DWT->CYCCNT; * This is the main trigger event handler. * Both injection and ignition are controlled from this method. */ -void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { +void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp) { ScopePerf perf(PE::MainTriggerCallback); if (CONFIG(vvtMode[0]) == VVT_MIATA_NB2 && ENGINE(triggerCentral.vvtSyncTimeNt) == 0) { @@ -413,14 +407,14 @@ void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE engine->triggerCentral.validateCamVvtCounters(); } - if (engine->triggerCentral.checkIfTriggerConfigChanged(PASS_ENGINE_PARAMETER_SIGNATURE)) { + if (engine->triggerCentral.checkIfTriggerConfigChanged()) { engine->ignitionEvents.isReady = false; // we need to rebuild complete ignition schedule engine->injectionEvents.isReady = false; // moved 'triggerIndexByAngle' into trigger initialization (why was it invoked from here if it's only about trigger shape & optimization?) - // see initializeTriggerWaveform() -> prepareOutputSignals(PASS_ENGINE_PARAMETER_SIGNATURE) + // see initializeTriggerWaveform() -> prepareOutputSignals() // we need this to apply new 'triggerIndexByAngle' values - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); } } @@ -428,15 +422,15 @@ void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE * For fuel we schedule start of injection based on trigger angle, and then inject for * specified duration of time */ - handleFuel(limitedFuel, trgEventIndex, rpm, edgeTimestamp PASS_ENGINE_PARAMETER_SUFFIX); + handleFuel(limitedFuel, trgEventIndex, rpm, edgeTimestamp); /** * For spark we schedule both start of coil charge and actual spark based on trigger angle */ - onTriggerEventSparkLogic(limitedSpark, trgEventIndex, rpm, edgeTimestamp PASS_ENGINE_PARAMETER_SUFFIX); + onTriggerEventSparkLogic(limitedSpark, trgEventIndex, rpm, edgeTimestamp); } // Check if the engine is not stopped or cylinder cleanup is activated -static bool isPrimeInjectionPulseSkipped(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static bool isPrimeInjectionPulseSkipped() { if (!engine->rpmCalculator.isStopped()) return true; return CONFIG(isCylinderCleanupEnabled) && (Sensor::getOrZero(SensorType::Tps1) > CLEANUP_MODE_TPS); @@ -446,8 +440,8 @@ static bool isPrimeInjectionPulseSkipped(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * Prime injection pulse, mainly needed for mono-injectors or long intake manifolds. * See testStartOfCrankingPrimingPulse() */ -void startPrimeInjectionPulse(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - engine->primeInjEvent.inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void startPrimeInjectionPulse() { + engine->primeInjEvent.inject(); // First, we need a protection against 'fake' ignition switch on and off (i.e. no engine started), to avoid repeated prime pulses. // So we check and update the ignition switch counter in non-volatile backup-RAM @@ -462,7 +456,7 @@ void startPrimeInjectionPulse(DECLARE_ENGINE_PARAMETER_SIGNATURE) { ignSwitchCounter = 0; // If we're going to skip this pulse, then save the counter as 0. // That's because we'll definitely need the prime pulse next time (either due to the cylinder cleanup or the engine spinning) - if (isPrimeInjectionPulseSkipped(PASS_ENGINE_PARAMETER_SIGNATURE)) + if (isPrimeInjectionPulseSkipped()) ignSwitchCounter = -1; // start prime injection if this is a 'fresh start' if (ignSwitchCounter == 0) { @@ -476,7 +470,7 @@ void startPrimeInjectionPulse(DECLARE_ENGINE_PARAMETER_SIGNATURE) { floatms_t pulseLength = interpolateClamped(maxPrimeInjAtTemperature, CONFIG(startOfCrankingPrimingPulse), CONFIG(primeInjFalloffTemperature), 0.0f, Sensor::get(SensorType::Clt).value_or(70)); if (pulseLength > 0) { - startSimultaniousInjection(engine); + startSimultaniousInjection(); int turnOffDelayUs = efiRound(MS2US(pulseLength), 1.0f); engine->executor.scheduleForLater(sDown, turnOffDelayUs, { &endSimultaniousInjectionOnlyTogglePins, engine }); } @@ -487,7 +481,7 @@ void startPrimeInjectionPulse(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif /* EFI_PROD_CODE */ } -void updatePrimeInjectionPulseState(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void updatePrimeInjectionPulseState() { #if EFI_PROD_CODE static bool counterWasReset = false; if (counterWasReset) @@ -507,13 +501,13 @@ void updatePrimeInjectionPulseState(DECLARE_ENGINE_PARAMETER_SIGNATURE) { static void showMainInfo(Engine *engine) { #if EFI_PROD_CODE int rpm = GET_RPM(); - float el = getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE); + float el = getFuelingLoad(); efiPrintf("rpm %d engine_load %.2f", rpm, el); efiPrintf("fuel %.2fms timing %.2f", ENGINE(injectionDuration), engine->engineState.timingAdvance); #endif /* EFI_PROD_CODE */ } -void initMainEventListener(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initMainEventListener() { efiAssertVoid(CUSTOM_ERR_6631, engine!=NULL, "null engine"); #if EFI_PROD_CODE @@ -522,7 +516,7 @@ void initMainEventListener(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // We start prime injection pulse at the early init stage - don't wait for the engine to start spinning! if (CONFIG(startOfCrankingPrimingPulse) > 0) - startPrimeInjectionPulse(PASS_ENGINE_PARAMETER_SIGNATURE); + startPrimeInjectionPulse(); } diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.h b/firmware/controllers/engine_cycle/main_trigger_callback.h index 6fa9567c61..b4469b877a 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.h +++ b/firmware/controllers/engine_cycle/main_trigger_callback.h @@ -11,20 +11,20 @@ #include "event_registry.h" -void initMainEventListener(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initMainEventListener(); -void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX); +void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp); -void startPrimeInjectionPulse(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void startPrimeInjectionPulse(); -void startSimultaniousInjection(Engine *engine); +void startSimultaniousInjection(void* = nullptr); void endSimultaniousInjection(InjectionEvent *event); void turnInjectionPinHigh(InjectionEvent *event); void turnInjectionPinLow(InjectionEvent *event); // reset injection switch counter if the engine started spinning -void updatePrimeInjectionPulseState(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void updatePrimeInjectionPulseState(); // Internal use only - exposed for tests void handleFuelInjectionEvent(int injEventIndex, InjectionEvent *event, - int rpm, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX); + int rpm, efitick_t nowNt); diff --git a/firmware/controllers/engine_cycle/map_averaging.cpp b/firmware/controllers/engine_cycle/map_averaging.cpp index 2288694c96..e2ccf84b6e 100644 --- a/firmware/controllers/engine_cycle/map_averaging.cpp +++ b/firmware/controllers/engine_cycle/map_averaging.cpp @@ -99,7 +99,7 @@ static void startAveraging(scheduling_s *endAveragingScheduling) { mapAveragingPin.setHigh(); scheduleByAngle(endAveragingScheduling, getTimeNowNt(), ENGINE(engineState.mapAveragingDuration), - endAveraging PASS_ENGINE_PARAMETER_SUFFIX); + endAveraging); } #if HAL_USE_ADC @@ -124,7 +124,7 @@ void mapAveragingAdcCallback(adcsample_t adcValue) { float voltage = adcToVoltsDivided(adcValue); float currentPressure = convertMap(voltage).value_or(0); scAddData( - getCrankshaftAngleNt(getTimeNowNt() PASS_ENGINE_PARAMETER_SUFFIX), + getCrankshaftAngleNt(getTimeNowNt()), currentPressure); } } @@ -172,7 +172,7 @@ static void endAveraging(void*) { mapAveragingPin.setLow(); } -static void applyMapMinBufferLength(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void applyMapMinBufferLength() { // check range mapMinBufferLength = maxI(minI(CONFIG(mapMinBufferLength), MAX_MAP_BUFFER_LENGTH), 1); // reset index @@ -192,7 +192,7 @@ void postMapState(TunerStudioOutputChannels *tsOutputChannels) { } #endif /* EFI_TUNER_STUDIO */ -void refreshMapAveragingPreCalc(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void refreshMapAveragingPreCalc() { int rpm = GET_RPM(); if (isValidRpm(rpm)) { MAP_sensor_config_s * c = &engineConfiguration->map; @@ -203,7 +203,7 @@ void refreshMapAveragingPreCalc(DECLARE_ENGINE_PARAMETER_SIGNATURE) { efiAssertVoid(CUSTOM_ERR_MAP_AVG_OFFSET, !cisnan(offsetAngle), "offsetAngle"); for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) { - angle_t cylinderOffset = getEngineCycle(engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE)) * i / engineConfiguration->specs.cylindersCount; + angle_t cylinderOffset = getEngineCycle(engine->getOperationMode()) * i / engineConfiguration->specs.cylindersCount; efiAssertVoid(CUSTOM_ERR_MAP_CYL_OFFSET, !cisnan(cylinderOffset), "cylinderOffset"); // part of this formula related to specific cylinder offset is never changing - we can // move the loop into start-up calculation and not have this loop as part of periodic calculation @@ -226,7 +226,7 @@ void refreshMapAveragingPreCalc(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * Shaft Position callback used to schedule start and end of MAP averaging */ void mapAveragingTriggerCallback( - uint32_t index, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { + uint32_t index, efitick_t edgeTimestamp) { #if EFI_ENGINE_CONTROL // this callback is invoked on interrupt thread if (index != (uint32_t)CONFIG(mapAveragingSchedulingAtIndex)) @@ -240,7 +240,7 @@ void mapAveragingTriggerCallback( ScopePerf perf(PE::MapAveragingTriggerCallback); if (CONFIG(mapMinBufferLength) != mapMinBufferLength) { - applyMapMinBufferLength(PASS_ENGINE_PARAMETER_SIGNATURE); + applyMapMinBufferLength(); } measurementsPerRevolution = measurementsPerRevolutionCounter; @@ -275,15 +275,15 @@ void mapAveragingTriggerCallback( scheduling_s *starTimer = &startTimers[i][structIndex]; scheduling_s *endTimer = &endTimers[i][structIndex]; - mapAveragingPin.inject(PASS_ENGINE_PARAMETER_SIGNATURE); - starTimer->inject(PASS_ENGINE_PARAMETER_SIGNATURE); - endTimer->inject(PASS_ENGINE_PARAMETER_SIGNATURE); + mapAveragingPin.inject(); + starTimer->inject(); + endTimer->inject(); // at the moment we schedule based on time prediction based on current RPM and angle // we are loosing precision in case of changing RPM - the further away is the event the worse is precision // todo: schedule this based on closest trigger event, same as ignition works scheduleByAngle(starTimer, edgeTimestamp, samplingStart, - { startAveraging, endTimer } PASS_ENGINE_PARAMETER_SUFFIX); + { startAveraging, endTimer }); } #endif } @@ -292,12 +292,12 @@ static void showMapStats() { efiPrintf("per revolution %d", measurementsPerRevolution); } -void initMapAveraging(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initMapAveraging() { #if !EFI_UNIT_TEST addConsoleAction("faststat", showMapStats); #endif /* EFI_UNIT_TEST */ - applyMapMinBufferLength(PASS_ENGINE_PARAMETER_SIGNATURE); + applyMapMinBufferLength(); } #endif /* EFI_MAP_AVERAGING */ diff --git a/firmware/controllers/engine_cycle/map_averaging.h b/firmware/controllers/engine_cycle/map_averaging.h index 0dd7e5ca0f..fda757e1b0 100644 --- a/firmware/controllers/engine_cycle/map_averaging.h +++ b/firmware/controllers/engine_cycle/map_averaging.h @@ -13,11 +13,11 @@ void mapAveragingAdcCallback(adcsample_t newValue); #endif -void initMapAveraging(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void refreshMapAveragingPreCalc(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initMapAveraging(); +void refreshMapAveragingPreCalc(); void mapAveragingTriggerCallback( - uint32_t index, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX); + uint32_t index, efitick_t edgeTimestamp); void onMapAveraged(float mapKpa, efitick_t nowNt); SensorResult convertMap(float volts); diff --git a/firmware/controllers/engine_cycle/rpm_calculator.cpp b/firmware/controllers/engine_cycle/rpm_calculator.cpp index 047bb3547a..e5b1a416cd 100644 --- a/firmware/controllers/engine_cycle/rpm_calculator.cpp +++ b/firmware/controllers/engine_cycle/rpm_calculator.cpp @@ -83,7 +83,7 @@ RpmCalculator::RpmCalculator() : #if !EFI_PROD_CODE mockRpm = MOCK_UNDEFINED; #endif /* EFI_PROD_CODE */ - // todo: reuse assignRpmValue() method which needs PASS_ENGINE_PARAMETER_SUFFIX + // todo: reuse assignRpmValue() method which needs // which we cannot provide inside this parameter-less constructor. need a solution for this minor mess setValidValue(0, 0); // 0 for current time since RPM sensor never times out } @@ -139,7 +139,7 @@ void RpmCalculator::assignRpmValue(float floatRpmValue) { * this would make sure that we have good numbers for first cranking revolution * #275 cranking could be improved */ - ENGINE(periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE)); + ENGINE(periodicFastCallback()); } } } @@ -175,7 +175,7 @@ void RpmCalculator::setRpmValue(float value) { engine->injectionEvents.resetOverlapping(); // reschedule all injection events now that we've reset them - engine->injectionEvents.addFuelEvents(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->injectionEvents.addFuelEvents(); } #endif } @@ -223,12 +223,12 @@ void RpmCalculator::setSpinningUp(efitick_t nowNt) { } // update variables needed by early instant RPM calc. if (isSpinningUp()) { - engine->triggerCentral.triggerState.setLastEventTimeForInstantRpm(nowNt PASS_ENGINE_PARAMETER_SUFFIX); + engine->triggerCentral.triggerState.setLastEventTimeForInstantRpm(nowNt); } /** * Update ignition pin indices if needed. Here we potentially switch to wasted spark temporarily. */ - prepareIgnitionPinIndices(getCurrentIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX); + prepareIgnitionPinIndices(getCurrentIgnitionMode()); } /** @@ -239,7 +239,7 @@ void RpmCalculator::setSpinningUp(efitick_t nowNt) { * This callback is invoked on interrupt thread. */ void rpmShaftPositionCallback(trigger_event_e ckpSignalType, - uint32_t index, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { + uint32_t index, efitick_t nowNt) { RpmCalculator *rpmState = &engine->rpmCalculator; @@ -260,7 +260,7 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType, rpmState->setRpmValue(NOISY_RPM); rpmState->rpmRate = 0; } else { - int mult = (int)getEngineCycle(engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE)) / 360; + int mult = (int)getEngineCycle(engine->getOperationMode()) / 360; float rpm = 60 * mult / periodSeconds; auto rpmDelta = rpm - rpmState->previousRpmValue; @@ -271,7 +271,7 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType, } else { // we are here only once trigger is synchronized for the first time // while transitioning from 'spinning' to 'running' - engine->triggerCentral.triggerState.movePreSynchTimestamps(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->triggerCentral.triggerState.movePreSynchTimestamps(); } rpmState->onNewEngineCycle(); @@ -281,7 +281,7 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType, // this 'index==0' case is here so that it happens after cycle callback so // it goes into sniffer report into the first position if (ENGINE(sensorChartMode) == SC_TRIGGER) { - angle_t crankAngle = getCrankshaftAngleNt(nowNt PASS_ENGINE_PARAMETER_SUFFIX); + angle_t crankAngle = getCrankshaftAngleNt(nowNt); int signal = 1000 * ckpSignalType + index; scAddData(crankAngle, signal); } @@ -290,7 +290,7 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType, // Always update instant RPM even when not spinning up engine->triggerCentral.triggerState.updateInstantRpm( engine->triggerCentral.triggerShape, &engine->triggerCentral.triggerFormDetails, - index, nowNt PASS_ENGINE_PARAMETER_SUFFIX); + index, nowNt); if (rpmState->isSpinningUp()) { float instantRpm = engine->triggerCentral.triggerState.getInstantRpm(); @@ -312,21 +312,20 @@ static char rpmBuffer[_MAX_FILLER]; * This callback has nothing to do with actual engine control, it just sends a Top Dead Center mark to the rusEfi console * digital sniffer. */ -static void onTdcCallback(Engine *engine) { - UNUSED(engine); +static void onTdcCallback(void *) { #if EFI_UNIT_TEST if (!engine->needTdcCallback) { return; } #endif /* EFI_UNIT_TEST */ - EXPAND_Engine; + itoa10(rpmBuffer, GET_RPM()); #if EFI_ENGINE_SNIFFER waveChart.startDataCollection(); #endif addEngineSnifferEvent(TOP_DEAD_CENTER_MESSAGE, (char* ) rpmBuffer); #if EFI_TOOTH_LOGGER - LogTriggerTopDeadCenter(getTimeNowNt() PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerTopDeadCenter(getTimeNowNt()); #endif /* EFI_TOOTH_LOGGER */ } @@ -334,7 +333,7 @@ static void onTdcCallback(Engine *engine) { * This trigger callback schedules the actual physical TDC callback in relation to trigger synchronization point. */ void tdcMarkCallback( - uint32_t index0, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { + uint32_t index0, efitick_t edgeTimestamp) { bool isTriggerSynchronizationPoint = index0 == 0; if (isTriggerSynchronizationPoint && ENGINE(isEngineChartEnabled) && ENGINE(tdcMarkEnabled)) { // two instances of scheduling_s are needed to properly handle event overlap @@ -345,8 +344,7 @@ void tdcMarkCallback( angle_t tdcPosition = tdcPosition(); // we need a positive angle offset here fixAngle(tdcPosition, "tdcPosition", CUSTOM_ERR_6553); - scheduleByAngle(&engine->tdcScheduler[revIndex2], edgeTimestamp, tdcPosition, - { onTdcCallback, engine } PASS_ENGINE_PARAMETER_SUFFIX); + scheduleByAngle(&engine->tdcScheduler[revIndex2], edgeTimestamp, tdcPosition, onTdcCallback); } } } @@ -355,7 +353,7 @@ void tdcMarkCallback( /** * @return Current crankshaft angle, 0 to 720 for four-stroke */ -float getCrankshaftAngleNt(efitick_t timeNt DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getCrankshaftAngleNt(efitick_t timeNt) { float timeSinceZeroAngle = engine->rpmCalculator.lastTdcTimer.getElapsedSeconds(timeNt); int rpm = GET_RPM(); @@ -365,8 +363,8 @@ float getCrankshaftAngleNt(efitick_t timeNt DECLARE_ENGINE_PARAMETER_SUFFIX) { return rpm == 0 ? NAN : timeSinceZeroAngle / oneDegreeSeconds; } -void initRpmCalculator(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - ENGINE(rpmCalculator).inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void initRpmCalculator() { + ENGINE(rpmCalculator).inject(); #if ! HW_CHECK_MODE if (hasFirmwareError()) { @@ -387,7 +385,7 @@ void initRpmCalculator(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * it takes the crankshaft to rotate to the specified angle. */ efitick_t scheduleByAngle(scheduling_s *timer, efitick_t edgeTimestamp, angle_t angle, - action_s action DECLARE_ENGINE_PARAMETER_SUFFIX) { + action_s action) { float delayUs = ENGINE(rpmCalculator.oneDegreeUs) * angle; // 'delayNt' is below 10 seconds here so we use 32 bit type for performance reasons diff --git a/firmware/controllers/engine_cycle/rpm_calculator.h b/firmware/controllers/engine_cycle/rpm_calculator.h index c4b6ca0370..f4c7414b6c 100644 --- a/firmware/controllers/engine_cycle/rpm_calculator.h +++ b/firmware/controllers/engine_cycle/rpm_calculator.h @@ -164,17 +164,17 @@ private: #define isValidRpm(rpm) ((rpm) > 0 && (rpm) < UNREALISTIC_RPM) -void rpmShaftPositionCallback(trigger_event_e ckpSignalType, uint32_t index, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX); +void rpmShaftPositionCallback(trigger_event_e ckpSignalType, uint32_t index, efitick_t edgeTimestamp); void tdcMarkCallback( - uint32_t index0, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX); + uint32_t index0, efitick_t edgeTimestamp); /** * @brief Initialize RPM calculator */ -void initRpmCalculator(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initRpmCalculator(); -float getCrankshaftAngleNt(efitick_t timeNt DECLARE_ENGINE_PARAMETER_SUFFIX); +float getCrankshaftAngleNt(efitick_t timeNt); #define getRevolutionCounter() ENGINE(rpmCalculator.getRevolutionCounterM()) @@ -184,5 +184,5 @@ float getCrankshaftAngleNt(efitick_t timeNt DECLARE_ENGINE_PARAMETER_SUFFIX); #define addEngineSnifferEvent(n, msg) {} #endif /* EFI_ENGINE_SNIFFER */ -efitick_t scheduleByAngle(scheduling_s *timer, efitick_t edgeTimestamp, angle_t angle, action_s action DECLARE_ENGINE_PARAMETER_SUFFIX); +efitick_t scheduleByAngle(scheduling_s *timer, efitick_t edgeTimestamp, angle_t angle, action_s action); diff --git a/firmware/controllers/engine_cycle/spark_logic.cpp b/firmware/controllers/engine_cycle/spark_logic.cpp index c5a65235fc..4896775dee 100644 --- a/firmware/controllers/engine_cycle/spark_logic.cpp +++ b/firmware/controllers/engine_cycle/spark_logic.cpp @@ -67,7 +67,7 @@ static void fireSparkBySettingPinLow(IgnitionEvent *event, IgnitionOutputPin *ou } \ } -static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_t sparkDwell, IgnitionEvent *event DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_t sparkDwell, IgnitionEvent *event) { // todo: clean up this implementation? does not look too nice as is. // let's save planned duration so that we can later compare it with reality @@ -83,13 +83,13 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_ efiAssertVoid(CUSTOM_SPARK_ANGLE_1, !cisnan(sparkAngle), "sparkAngle#1"); const int index = ENGINE(ignitionPin[event->cylinderIndex]); - const int coilIndex = ID2INDEX(getCylinderId(index PASS_ENGINE_PARAMETER_SUFFIX)); + const int coilIndex = ID2INDEX(getCylinderId(index)); IgnitionOutputPin *output = &enginePins.coils[coilIndex]; IgnitionOutputPin *secondOutput; - if (getCurrentIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE) == IM_WASTED_SPARK && CONFIG(twoWireBatchIgnition)) { + if (getCurrentIgnitionMode() == IM_WASTED_SPARK && CONFIG(twoWireBatchIgnition)) { int secondIndex = index + CONFIG(specs.cylindersCount) / 2; - int secondCoilIndex = ID2INDEX(getCylinderId(secondIndex PASS_ENGINE_PARAMETER_SUFFIX)); + int secondCoilIndex = ID2INDEX(getCylinderId(secondIndex)); secondOutput = &enginePins.coils[secondCoilIndex]; assertPinAssigned(secondOutput); } else { @@ -108,7 +108,7 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_ angle_t dwellStartAngle = sparkAngle - dwellAngleDuration; efiAssertVoid(CUSTOM_ERR_6590, !cisnan(dwellStartAngle), "findAngle#5"); assertAngleRange(dwellStartAngle, "findAngle#a6", CUSTOM_ERR_6550); - event->dwellPosition.setAngle(dwellStartAngle PASS_ENGINE_PARAMETER_SUFFIX); + event->dwellPosition.setAngle(dwellStartAngle); #if FUEL_MATH_EXTREME_LOGGING if (printFuelDebug) { @@ -151,7 +151,7 @@ void fireSparkAndPrepareNextSchedule(IgnitionEvent *event) { efitick_t nowNt = getTimeNowNt(); #if EFI_TOOTH_LOGGER - LogTriggerCoilState(nowNt, false PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerCoilState(nowNt, false); #endif // EFI_TOOTH_LOGGER #if !EFI_UNIT_TEST @@ -214,12 +214,11 @@ if (engineConfiguration->debugMode == DBG_DWELL_METRIC) { scheduleByAngle( &event->trailingSparkFire, nowNt, ENGINE(engineState.trailingSparkAngle), { &fireTrailingSpark, &enginePins.trailingCoils[event->cylinderNumber] } - PASS_ENGINE_PARAMETER_SUFFIX ); } // If all events have been scheduled, prepare for next time. - prepareCylinderIgnitionSchedule(dwellAngleDuration, sparkDwell, event PASS_ENGINE_PARAMETER_SUFFIX); + prepareCylinderIgnitionSchedule(dwellAngleDuration, sparkDwell, event); } engine->onSparkFireKnockSense(event->cylinderNumber, nowNt); @@ -231,7 +230,7 @@ static void startDwellByTurningSparkPinHigh(IgnitionEvent *event, IgnitionOutput if (GET_RPM() > 2 * engineConfiguration->cranking.rpm) { const char *outputName = output->getName(); - if (prevSparkName == outputName && getCurrentIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE) != IM_ONE_COIL) { + if (prevSparkName == outputName && getCurrentIgnitionMode() != IM_ONE_COIL) { warning(CUSTOM_OBD_SKIPPED_SPARK, "looks like skipped spark event %d %s", getRevolutionCounter(), outputName); } prevSparkName = outputName; @@ -252,7 +251,7 @@ static void startDwellByTurningSparkPinHigh(IgnitionEvent *event, IgnitionOutput } } - output->inject(PASS_ENGINE_PARAMETER_SIGNATURE); + output->inject(); output->setHigh(); } @@ -262,7 +261,7 @@ void turnSparkPinHigh(IgnitionEvent *event) { efitick_t nowNt = getTimeNowNt(); #if EFI_TOOTH_LOGGER - LogTriggerCoilState(nowNt, true PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerCoilState(nowNt, true); #endif // EFI_TOOTH_LOGGER for (int i = 0; i< MAX_OUTPUTS_FOR_IGNITION;i++) { @@ -274,12 +273,11 @@ void turnSparkPinHigh(IgnitionEvent *event) { if (CONFIG(enableTrailingSparks)) { IgnitionOutputPin *output = &enginePins.trailingCoils[event->cylinderNumber]; - output->inject(PASS_ENGINE_PARAMETER_SIGNATURE); + output->inject(); // Trailing sparks are enabled - schedule an event for the corresponding trailing coil scheduleByAngle( &event->trailingSparkCharge, nowNt, ENGINE(engineState.trailingSparkAngle), { &chargeTrailingSpark, output } - PASS_ENGINE_PARAMETER_SUFFIX ); } } @@ -296,9 +294,8 @@ bool scheduleOrQueue(AngleBasedEvent *event, uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_t angle, - action_s action - DECLARE_ENGINE_PARAMETER_SUFFIX) { - event->position.setAngle(angle PASS_ENGINE_PARAMETER_SUFFIX); + action_s action) { + event->position.setAngle(angle); /** * Here's the status as of Jan 2020: @@ -317,7 +314,6 @@ bool scheduleOrQueue(AngleBasedEvent *event, edgeTimestamp, event->position.angleOffsetFromTriggerEvent, action - PASS_ENGINE_PARAMETER_SUFFIX ); return true; @@ -339,7 +335,7 @@ bool scheduleOrQueue(AngleBasedEvent *event, } static void handleSparkEvent(bool limitedSpark, uint32_t trgEventIndex, IgnitionEvent *event, - int rpm, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { + int rpm, efitick_t edgeTimestamp) { angle_t sparkAngle = event->sparkAngle; const floatms_t dwellMs = ENGINE(engineState.sparkDwell); @@ -381,7 +377,7 @@ static void handleSparkEvent(bool limitedSpark, uint32_t trgEventIndex, Ignition * This way we make sure that coil dwell started while spark was enabled would fire and not burn * the coil. */ - chargeTime = scheduleByAngle(&event->dwellStartTimer, edgeTimestamp, angleOffset, { &turnSparkPinHigh, event } PASS_ENGINE_PARAMETER_SUFFIX); + chargeTime = scheduleByAngle(&event->dwellStartTimer, edgeTimestamp, angleOffset, { &turnSparkPinHigh, event }); event->sparksRemaining = ENGINE(engineState.multispark.count); } else { @@ -396,7 +392,7 @@ static void handleSparkEvent(bool limitedSpark, uint32_t trgEventIndex, Ignition efiAssertVoid(CUSTOM_ERR_6591, !cisnan(sparkAngle), "findAngle#4"); assertAngleRange(sparkAngle, "findAngle#a5", CUSTOM_ERR_6549); - bool scheduled = scheduleOrQueue(&event->sparkEvent, trgEventIndex, edgeTimestamp, sparkAngle, { fireSparkAndPrepareNextSchedule, event } PASS_ENGINE_PARAMETER_SUFFIX); + bool scheduled = scheduleOrQueue(&event->sparkEvent, trgEventIndex, edgeTimestamp, sparkAngle, { fireSparkAndPrepareNextSchedule, event }); if (scheduled) { #if SPARK_EXTREME_LOGGING @@ -423,7 +419,7 @@ static void handleSparkEvent(bool limitedSpark, uint32_t trgEventIndex, Ignition #endif } -void initializeIgnitionActions(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initializeIgnitionActions() { IgnitionEventList *list = &engine->ignitionEvents; angle_t dwellAngle = ENGINE(engineState.dwellAngle); floatms_t sparkDwell = ENGINE(engineState.sparkDwell); @@ -437,12 +433,12 @@ void initializeIgnitionActions(DECLARE_ENGINE_PARAMETER_SIGNATURE) { for (size_t cylinderIndex = 0; cylinderIndex < CONFIG(specs.cylindersCount); cylinderIndex++) { list->elements[cylinderIndex].cylinderIndex = cylinderIndex; - prepareCylinderIgnitionSchedule(dwellAngle, sparkDwell, &list->elements[cylinderIndex] PASS_ENGINE_PARAMETER_SUFFIX); + prepareCylinderIgnitionSchedule(dwellAngle, sparkDwell, &list->elements[cylinderIndex]); } list->isReady = true; } -static void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void prepareIgnitionSchedule() { ScopePerf perf(PE::PrepareIgnitionSchedule); /** @@ -452,10 +448,10 @@ static void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * but we are already re-purposing the output signals, but everything works because we * are not affecting that space in memory. todo: use two instances of 'ignitionSignals' */ - operation_mode_e operationMode = engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE); + operation_mode_e operationMode = engine->getOperationMode(); float maxAllowedDwellAngle = (int) (getEngineCycle(operationMode) / 2); // the cast is about making Coverity happy - if (getCurrentIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE) == IM_ONE_COIL) { + if (getCurrentIgnitionMode() == IM_ONE_COIL) { maxAllowedDwellAngle = getEngineCycle(operationMode) / engineConfiguration->specs.cylindersCount / 1.1; } @@ -468,10 +464,10 @@ static void prepareIgnitionSchedule(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // todo: add some check for dwell overflow? like 4 times 6 ms while engine cycle is less then that - initializeIgnitionActions(PASS_ENGINE_PARAMETER_SIGNATURE); + initializeIgnitionActions(); } -static void scheduleAllSparkEventsUntilNextTriggerTooth(uint32_t trgEventIndex, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void scheduleAllSparkEventsUntilNextTriggerTooth(uint32_t trgEventIndex, efitick_t edgeTimestamp) { AngleBasedEvent *current, *tmp; LL_FOREACH_SAFE2(ENGINE(angleBasedEventsHead), current, tmp, nextToothEvent) @@ -494,14 +490,13 @@ static void scheduleAllSparkEventsUntilNextTriggerTooth(uint32_t trgEventIndex, edgeTimestamp, current->position.angleOffsetFromTriggerEvent, current->action - PASS_ENGINE_PARAMETER_SUFFIX ); } } } void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm, efitick_t edgeTimestamp - DECLARE_ENGINE_PARAMETER_SUFFIX) { + ) { ScopePerf perf(PE::OnTriggerEventSparkLogic); @@ -511,7 +506,7 @@ void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm } if (!ENGINE(ignitionEvents.isReady)) { - prepareIgnitionSchedule(PASS_ENGINE_PARAMETER_SIGNATURE); + prepareIgnitionSchedule(); } @@ -519,7 +514,7 @@ void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm * Ignition schedule is defined once per revolution * See initializeIgnitionActions() */ - scheduleAllSparkEventsUntilNextTriggerTooth(trgEventIndex, edgeTimestamp PASS_ENGINE_PARAMETER_SUFFIX); + scheduleAllSparkEventsUntilNextTriggerTooth(trgEventIndex, edgeTimestamp); // scheduleSimpleMsg(&logger, "eventId spark ", eventIndex); @@ -537,7 +532,7 @@ void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm continue; } - handleSparkEvent(limitedSpark, trgEventIndex, event, rpm, edgeTimestamp PASS_ENGINE_PARAMETER_SUFFIX); + handleSparkEvent(limitedSpark, trgEventIndex, event, rpm, edgeTimestamp); } } } @@ -546,7 +541,7 @@ void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm * Number of sparks per physical coil * @see getNumberOfInjections */ -int getNumberOfSparks(ignition_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX) { +int getNumberOfSparks(ignition_mode_e mode) { switch (mode) { case IM_ONE_COIL: return engineConfiguration->specs.cylindersCount; @@ -565,9 +560,9 @@ int getNumberOfSparks(ignition_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX) { /** * @see getInjectorDutyCycle */ -percent_t getCoilDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { - floatms_t totalPerCycle = ENGINE(engineState.sparkDwell) * getNumberOfSparks(getCurrentIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX); - floatms_t engineCycleDuration = getCrankshaftRevolutionTimeMs(rpm) * (engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE) == TWO_STROKE ? 1 : 2); +percent_t getCoilDutyCycle(int rpm) { + floatms_t totalPerCycle = ENGINE(engineState.sparkDwell) * getNumberOfSparks(getCurrentIgnitionMode()); + floatms_t engineCycleDuration = getCrankshaftRevolutionTimeMs(rpm) * (engine->getOperationMode() == TWO_STROKE ? 1 : 2); return 100 * totalPerCycle / engineCycleDuration; } diff --git a/firmware/controllers/engine_cycle/spark_logic.h b/firmware/controllers/engine_cycle/spark_logic.h index 345dc83697..7424d024ea 100644 --- a/firmware/controllers/engine_cycle/spark_logic.h +++ b/firmware/controllers/engine_cycle/spark_logic.h @@ -7,12 +7,12 @@ #pragma once -void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX); +void onTriggerEventSparkLogic(bool limitedSpark, uint32_t trgEventIndex, int rpm, efitick_t edgeTimestamp); void turnSparkPinHigh(IgnitionEvent *event); void fireSparkAndPrepareNextSchedule(IgnitionEvent *event); -int getNumberOfSparks(ignition_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX); -percent_t getCoilDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); -void initializeIgnitionActions(DECLARE_ENGINE_PARAMETER_SIGNATURE); +int getNumberOfSparks(ignition_mode_e mode); +percent_t getCoilDutyCycle(int rpm); +void initializeIgnitionActions(); int isIgnitionTimingError(void); @@ -21,5 +21,4 @@ bool scheduleOrQueue(AngleBasedEvent *event, uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_t angle, - action_s action - DECLARE_ENGINE_PARAMETER_SUFFIX); + action_s action); diff --git a/firmware/controllers/flash_main.cpp b/firmware/controllers/flash_main.cpp index f244b03c26..654e26d18b 100644 --- a/firmware/controllers/flash_main.cpp +++ b/firmware/controllers/flash_main.cpp @@ -212,7 +212,7 @@ static bool isValidCrc(persistent_config_container_s *state) { } static void doResetConfiguration() { - resetConfigurationExt(engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX); + resetConfigurationExt(engineConfiguration->engineType); } typedef enum { @@ -293,7 +293,7 @@ void readFromFlash() { auto firstCopyAddr = getFlashAddrFirstCopy(); auto secondyCopyAddr = getFlashAddrSecondCopy(); - resetConfigurationExt(DEFAULT_ENGINE_TYPE PASS_ENGINE_PARAMETER_SUFFIX); + resetConfigurationExt(DEFAULT_ENGINE_TYPE); #else result = readConfiguration(); #endif @@ -301,20 +301,20 @@ void readFromFlash() { if (result == CRC_FAILED) { // we are here on first boot on brand new chip warning(CUSTOM_ERR_FLASH_CRC_FAILED, "flash CRC failed"); - resetConfigurationExt(DEFAULT_ENGINE_TYPE PASS_ENGINE_PARAMETER_SUFFIX); + resetConfigurationExt(DEFAULT_ENGINE_TYPE); } else if (result == INCOMPATIBLE_VERSION) { - resetConfigurationExt(engineConfiguration->engineType PASS_ENGINE_PARAMETER_SUFFIX); + resetConfigurationExt(engineConfiguration->engineType); } else { /** * At this point we know that CRC and version number is what we expect. Safe to assume it's a valid configuration. */ - applyNonPersistentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); + applyNonPersistentConfiguration(); } // we can only change the state after the CRC check engineConfiguration->byFirmwareVersion = getRusEfiVersion(); memset(persistentState.persistentConfiguration.warning_message , 0, ERROR_BUFFER_SIZE); - validateConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); + validateConfiguration(); if (result == CRC_FAILED) { efiPrintf("Need to reset flash to default due to CRC"); diff --git a/firmware/controllers/gauges/lcd_controller.cpp b/firmware/controllers/gauges/lcd_controller.cpp index 12b24fae50..0680cd583d 100644 --- a/firmware/controllers/gauges/lcd_controller.cpp +++ b/firmware/controllers/gauges/lcd_controller.cpp @@ -183,10 +183,10 @@ static void showLine(lcd_line_e line, int /*screenY*/) { lcdPrintf("Throttle %s %.2f%%", buffer, Sensor::getOrZero(SensorType::Tps1)); return; case LL_FUEL_CLT_CORRECTION: - lcdPrintf("CLT corr %.2f", getCltFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE)); + lcdPrintf("CLT corr %.2f", getCltFuelCorrection()); return; case LL_FUEL_IAT_CORRECTION: - lcdPrintf("IAT corr %.2f", getIatFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE)); + lcdPrintf("IAT corr %.2f", getIatFuelCorrection()); return; case LL_FUEL_INJECTOR_LAG: lcdPrintf("ING LAG %.2f", engine->engineState.running.injectorLag); diff --git a/firmware/controllers/gauges/tachometer.cpp b/firmware/controllers/gauges/tachometer.cpp index 0aa20655ac..c84b6a5d46 100644 --- a/firmware/controllers/gauges/tachometer.cpp +++ b/firmware/controllers/gauges/tachometer.cpp @@ -28,7 +28,7 @@ float getTachDuty() { static bool tachHasInit = false; -void tachSignalCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void tachSignalCallback() { // Only do anything if tach enabled if (!tachHasInit) { return; @@ -64,7 +64,7 @@ void tachSignalCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { tachControl.setFrequency(tachFreq); } -void initTachometer(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initTachometer() { tachHasInit = false; if (!isBrainPinValid(CONFIG(tachOutputPin))) { return; diff --git a/firmware/controllers/gauges/tachometer.h b/firmware/controllers/gauges/tachometer.h index 87be69aa47..86d6941cb6 100644 --- a/firmware/controllers/gauges/tachometer.h +++ b/firmware/controllers/gauges/tachometer.h @@ -7,5 +7,5 @@ #pragma once -void initTachometer(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void tachSignalCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initTachometer(); +void tachSignalCallback(); diff --git a/firmware/controllers/gear_controller.cpp b/firmware/controllers/gear_controller.cpp index 7e2cee220e..2085685897 100644 --- a/firmware/controllers/gear_controller.cpp +++ b/firmware/controllers/gear_controller.cpp @@ -2,8 +2,8 @@ #include "gear_controller.h" -void GearControllerBase::init(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - transmissionController.inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void GearControllerBase::init() { + transmissionController.inject(); transmissionController.init(); } diff --git a/firmware/controllers/gear_controller.h b/firmware/controllers/gear_controller.h index d58430c30b..ad0230085e 100644 --- a/firmware/controllers/gear_controller.h +++ b/firmware/controllers/gear_controller.h @@ -11,7 +11,7 @@ class GearControllerBase : public EnginePtr { public: virtual void update(); gear_e getDesiredGear() const; - virtual void init(DECLARE_ENGINE_PARAMETER_SIGNATURE); + virtual void init(); private: gear_e desiredGear = NEUTRAL; protected: diff --git a/firmware/controllers/lua/lua_hooks.cpp b/firmware/controllers/lua/lua_hooks.cpp index 98ea38072a..018006a927 100644 --- a/firmware/controllers/lua/lua_hooks.cpp +++ b/firmware/controllers/lua/lua_hooks.cpp @@ -100,7 +100,7 @@ static int lua_curve2d(lua_State* l) { auto humanCurveIdx = luaL_checkinteger(l, 1); auto x = luaL_checknumber(l, 2); - auto result = getCurveValue(humanCurveIdx - HUMAN_OFFSET, x PASS_ENGINE_PARAMETER_SUFFIX); + auto result = getCurveValue(humanCurveIdx - HUMAN_OFFSET, x); lua_pushnumber(l, result); return 1; @@ -108,7 +108,7 @@ static int lua_curve2d(lua_State* l) { static int lua_findCurveIndex(lua_State* l) { auto name = luaL_checklstring(l, 1, nullptr); - auto result = getCurveIndexByName(name PASS_ENGINE_PARAMETER_SUFFIX); + auto result = getCurveIndexByName(name); if (result == EFI_ERROR_CODE) { lua_pushnil(l); } else { @@ -461,7 +461,7 @@ void configureRusefiLuaHooks(lua_State* l) { lua_register(l, "findTableIndex", [](lua_State* l) { auto name = luaL_checklstring(l, 1, nullptr); - auto index = getTableIndexByName(name PASS_ENGINE_PARAMETER_SUFFIX); + auto index = getTableIndexByName(name); if (index == EFI_ERROR_CODE) { lua_pushnil(l); } else { @@ -476,7 +476,7 @@ void configureRusefiLuaHooks(lua_State* l) { auto name = luaL_checklstring(l, 1, nullptr); auto defaultValue = luaL_checknumber(l, 2); - auto index = getSettingIndexByName(name PASS_ENGINE_PARAMETER_SUFFIX); + auto index = getSettingIndexByName(name); if (index == EFI_ERROR_CODE) { lua_pushnumber(l, defaultValue); } else { diff --git a/firmware/controllers/math/closed_loop_fuel.cpp b/firmware/controllers/math/closed_loop_fuel.cpp index 66bbcbd1a6..5f2e88beb2 100644 --- a/firmware/controllers/math/closed_loop_fuel.cpp +++ b/firmware/controllers/math/closed_loop_fuel.cpp @@ -45,7 +45,7 @@ size_t computeStftBin(int rpm, float load, stft_s& cfg) { return 3; } -static bool shouldCorrect(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static bool shouldCorrect() { const auto& cfg = CONFIG(stft); // User disable bit @@ -73,7 +73,7 @@ static bool shouldCorrect(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return true; } -bool shouldUpdateCorrection(SensorType sensor DECLARE_ENGINE_PARAMETER_SUFFIX) { +bool shouldUpdateCorrection(SensorType sensor) { const auto& cfg = CONFIG(stft); // Pause (but don't reset) correction if the AFR is off scale. @@ -86,12 +86,12 @@ bool shouldUpdateCorrection(SensorType sensor DECLARE_ENGINE_PARAMETER_SUFFIX) { return true; } -ClosedLoopFuelResult fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - if (!shouldCorrect(PASS_ENGINE_PARAMETER_SIGNATURE)) { +ClosedLoopFuelResult fuelClosedLoopCorrection() { + if (!shouldCorrect()) { return {}; } - size_t binIdx = computeStftBin(GET_RPM(), getFuelingLoad(PASS_ENGINE_PARAMETER_SIGNATURE), CONFIG(stft)); + size_t binIdx = computeStftBin(GET_RPM(), getFuelingLoad(), CONFIG(stft)); #if EFI_TUNER_STUDIO if (engineConfiguration->debugMode == DBG_FUEL_PID_CORRECTION) { @@ -109,8 +109,8 @@ ClosedLoopFuelResult fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE // todo: push configuration at startup cell.configure(&CONFIG(stft.cellCfgs[binIdx]), sensor); - if (shouldUpdateCorrection(sensor PASS_ENGINE_PARAMETER_SUFFIX)) { - cell.update(CONFIG(stft.deadband) * 0.001f, CONFIG(stftIgnoreErrorMagnitude) PASS_ENGINE_PARAMETER_SUFFIX); + if (shouldUpdateCorrection(sensor)) { + cell.update(CONFIG(stft.deadband) * 0.001f, CONFIG(stftIgnoreErrorMagnitude)); } result.banks[i] = cell.getAdjustment(); diff --git a/firmware/controllers/math/closed_loop_fuel.h b/firmware/controllers/math/closed_loop_fuel.h index 94cb4d4c97..7118479d88 100644 --- a/firmware/controllers/math/closed_loop_fuel.h +++ b/firmware/controllers/math/closed_loop_fuel.h @@ -13,6 +13,6 @@ struct ClosedLoopFuelResult { float banks[STFT_BANK_COUNT]; }; -ClosedLoopFuelResult fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE); +ClosedLoopFuelResult fuelClosedLoopCorrection(); size_t computeStftBin(int rpm, float load, stft_s& cfg); -bool shouldUpdateCorrection(SensorType sensor DECLARE_ENGINE_PARAMETER_SUFFIX); +bool shouldUpdateCorrection(SensorType sensor); diff --git a/firmware/controllers/math/closed_loop_fuel_cell.cpp b/firmware/controllers/math/closed_loop_fuel_cell.cpp index c820aa71aa..cbb9e7acff 100644 --- a/firmware/controllers/math/closed_loop_fuel_cell.cpp +++ b/firmware/controllers/math/closed_loop_fuel_cell.cpp @@ -4,10 +4,10 @@ constexpr float integrator_dt = FAST_CALLBACK_PERIOD_MS * 0.001f; -void ClosedLoopFuelCellBase::update(float lambdaDeadband, bool ignoreErrorMagnitude DECLARE_ENGINE_PARAMETER_SUFFIX) +void ClosedLoopFuelCellBase::update(float lambdaDeadband, bool ignoreErrorMagnitude) { // Compute how far off target we are - float lambdaError = getLambdaError(PASS_ENGINE_PARAMETER_SIGNATURE); + float lambdaError = getLambdaError(); // If we're within the deadband, make no adjustment. if (absF(lambdaError) < lambdaDeadband) { @@ -45,7 +45,7 @@ float ClosedLoopFuelCellBase::getAdjustment() const { return 1.0f + m_adjustment; } -float ClosedLoopFuelCellImpl::getLambdaError(DECLARE_ENGINE_PARAMETER_SIGNATURE) const { +float ClosedLoopFuelCellImpl::getLambdaError() const { auto lambda = Sensor::get(m_lambdaSensor); // Failed sensor -> no error diff --git a/firmware/controllers/math/closed_loop_fuel_cell.h b/firmware/controllers/math/closed_loop_fuel_cell.h index e7e24d5135..19d2543c39 100644 --- a/firmware/controllers/math/closed_loop_fuel_cell.h +++ b/firmware/controllers/math/closed_loop_fuel_cell.h @@ -6,14 +6,14 @@ class ClosedLoopFuelCellBase { public: // Update the cell's internal state - adjusting fuel up/down as appropriate - void update(float lambdaDeadband, bool ignoreErrorMagnitude DECLARE_ENGINE_PARAMETER_SUFFIX); + void update(float lambdaDeadband, bool ignoreErrorMagnitude); // Get the current adjustment amount, without altering internal state. float getAdjustment() const; protected: // Helpers - virtual for mocking - virtual float getLambdaError(DECLARE_ENGINE_PARAMETER_SIGNATURE) const = 0; + virtual float getLambdaError() const = 0; virtual float getMaxAdjustment() const = 0; virtual float getMinAdjustment() const = 0; virtual float getIntegratorGain() const = 0; @@ -39,7 +39,7 @@ private: SensorType m_lambdaSensor = SensorType::Invalid; protected: - float getLambdaError(DECLARE_ENGINE_PARAMETER_SIGNATURE) const override; + float getLambdaError() const override; float getMaxAdjustment() const override; float getMinAdjustment() const override; float getIntegratorGain() const override; diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index e618999dff..2d2599d316 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -29,8 +29,8 @@ extern bool verboseMode; #endif /* EFI_UNIT_TEST */ -floatms_t getEngineCycleDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { - return getCrankshaftRevolutionTimeMs(rpm) * (engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE) == TWO_STROKE ? 1 : 2); +floatms_t getEngineCycleDuration(int rpm) { + return getCrankshaftRevolutionTimeMs(rpm) * (engine->getOperationMode() == TWO_STROKE ? 1 : 2); } /** @@ -43,18 +43,18 @@ floatms_t getCrankshaftRevolutionTimeMs(int rpm) { return 360 * getOneDegreeTimeMs(rpm); } -float getFuelingLoad(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getFuelingLoad() { return ENGINE(engineState.fuelingLoad); } -float getIgnitionLoad(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getIgnitionLoad() { return ENGINE(engineState.ignitionLoad); } /** * see also setConstantDwell */ -void setSingleCoilDwell(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void setSingleCoilDwell() { for (int i = 0; i < DWELL_CURVE_SIZE; i++) { engineConfiguration->sparkDwellRpmBins[i] = i + 1; engineConfiguration->sparkDwellValues[i] = 4; @@ -73,7 +73,7 @@ void setSingleCoilDwell(DECLARE_CONFIG_PARAMETER_SIGNATURE) { /** * @return Spark dwell time, in milliseconds. 0 if tables are not ready. */ -floatms_t getSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { +floatms_t getSparkDwell(int rpm) { #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT float dwellMs; if (ENGINE(rpmCalculator).isCranking()) { @@ -158,7 +158,7 @@ static const int order_1_2_3_4_5_6_7_8_9_10_11_12[] = {1, 2, 3, 4, 5, 6, 7, 8, 9 // no comments static const int order_1_14_9_4_7_12_15_6_13_8_3_16_11_2_5_10[] = {1, 14, 9, 4, 7, 12, 15, 6, 13, 8, 3, 16, 11, 2, 5, 10}; -static int getFiringOrderLength(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static int getFiringOrderLength() { switch (CONFIG(specs.firingOrder)) { case FO_1: @@ -226,7 +226,7 @@ static int getFiringOrderLength(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return 1; } -static const int *getFiringOrderTable(DECLARE_ENGINE_PARAMETER_SIGNATURE) +static const int *getFiringOrderTable() { switch (CONFIG(specs.firingOrder)) { case FO_1: @@ -323,9 +323,9 @@ static const int *getFiringOrderTable(DECLARE_ENGINE_PARAMETER_SIGNATURE) * @param index from zero to cylindersCount - 1 * @return cylinderId from one to cylindersCount */ -int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX) { +int getCylinderId(int index) { - const int firingOrderLength = getFiringOrderLength(PASS_ENGINE_PARAMETER_SIGNATURE); + const int firingOrderLength = getFiringOrderLength(); if (firingOrderLength < 1 || firingOrderLength > MAX_CYLINDER_COUNT) { firmwareError(CUSTOM_FIRING_LENGTH, "fol %d", firingOrderLength); @@ -343,7 +343,7 @@ int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX) { return 1; } - const int *firingOrderTable = getFiringOrderTable(PASS_ENGINE_PARAMETER_SIGNATURE); + const int *firingOrderTable = getFiringOrderTable(); if (firingOrderTable) return firingOrderTable[index]; /* else @@ -356,9 +356,9 @@ int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX) { * @param prevCylinderId from one to cylindersCount * @return cylinderId from one to cylindersCount */ -int getNextFiringCylinderId(int prevCylinderId DECLARE_ENGINE_PARAMETER_SUFFIX) { - const int firingOrderLength = getFiringOrderLength(PASS_ENGINE_PARAMETER_SIGNATURE); - const int *firingOrderTable = getFiringOrderTable(PASS_ENGINE_PARAMETER_SIGNATURE); +int getNextFiringCylinderId(int prevCylinderId) { + const int firingOrderLength = getFiringOrderLength(); + const int *firingOrderTable = getFiringOrderTable(); if (firingOrderTable) { for (size_t i = 0; i < firingOrderLength; i++) @@ -371,8 +371,8 @@ int getNextFiringCylinderId(int prevCylinderId DECLARE_ENGINE_PARAMETER_SUFFIX) /** * @param cylinderIndex from 0 to cylinderCount, not cylinder number */ -static int getIgnitionPinForIndex(int cylinderIndex DECLARE_ENGINE_PARAMETER_SUFFIX) { - switch (getCurrentIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE)) { +static int getIgnitionPinForIndex(int cylinderIndex) { + switch (getCurrentIgnitionMode()) { case IM_ONE_COIL: return 0; case IM_WASTED_SPARK: { @@ -393,11 +393,11 @@ static int getIgnitionPinForIndex(int cylinderIndex DECLARE_ENGINE_PARAMETER_SUF } } -void prepareIgnitionPinIndices(ignition_mode_e ignitionMode DECLARE_ENGINE_PARAMETER_SUFFIX) { +void prepareIgnitionPinIndices(ignition_mode_e ignitionMode) { (void)ignitionMode; #if EFI_ENGINE_CONTROL for (size_t cylinderIndex = 0; cylinderIndex < CONFIG(specs.cylindersCount); cylinderIndex++) { - ENGINE(ignitionPin[cylinderIndex]) = getIgnitionPinForIndex(cylinderIndex PASS_ENGINE_PARAMETER_SUFFIX); + ENGINE(ignitionPin[cylinderIndex]) = getIgnitionPinForIndex(cylinderIndex); } #endif /* EFI_ENGINE_CONTROL */ } @@ -406,7 +406,7 @@ void prepareIgnitionPinIndices(ignition_mode_e ignitionMode DECLARE_ENGINE_PARAM * @return IM_WASTED_SPARK if in SPINNING mode and IM_INDIVIDUAL_COILS setting * @return CONFIG(ignitionMode) otherwise */ -ignition_mode_e getCurrentIgnitionMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +ignition_mode_e getCurrentIgnitionMode() { ignition_mode_e ignitionMode = CONFIG(ignitionMode); #if EFI_SHAFT_POSITION_INPUT // In spin-up cranking mode we don't have full phase sync. info yet, so wasted spark mode is better @@ -421,8 +421,8 @@ ignition_mode_e getCurrentIgnitionMode(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * This heavy method is only invoked in case of a configuration change or initialization. */ -void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - ENGINE(engineCycle) = getEngineCycle(engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE)); +void prepareOutputSignals() { + ENGINE(engineCycle) = getEngineCycle(engine->getOperationMode()); angle_t maxTimingCorrMap = -FOUR_STROKE_CYCLE_DURATION; angle_t maxTimingMap = -FOUR_STROKE_CYCLE_DURATION; @@ -444,34 +444,34 @@ void prepareOutputSignals(DECLARE_ENGINE_PARAMETER_SIGNATURE) { ENGINE(ignitionPositionWithinEngineCycle[i]) = ENGINE(engineCycle) * i / CONFIG(specs.cylindersCount); } - prepareIgnitionPinIndices(CONFIG(ignitionMode) PASS_ENGINE_PARAMETER_SUFFIX); + prepareIgnitionPinIndices(CONFIG(ignitionMode)); - TRIGGER_WAVEFORM(prepareShape(&ENGINE(triggerCentral.triggerFormDetails) PASS_ENGINE_PARAMETER_SUFFIX)); + TRIGGER_WAVEFORM(prepareShape(&ENGINE(triggerCentral.triggerFormDetails))); // Fuel schedule may now be completely wrong, force a reset ENGINE(injectionEvents).invalidate(); } -void setTimingRpmBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setTimingRpmBin(float from, float to) { setRpmBin(config->ignitionRpmBins, IGN_RPM_COUNT, from, to); } -void setTimingLoadBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setTimingLoadBin(float from, float to) { setLinearCurve(config->ignitionLoadBins, from, to); } /** * this method sets algorithm and ignition table scale */ -void setAlgorithm(engine_load_mode_e algo DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setAlgorithm(engine_load_mode_e algo) { engineConfiguration->fuelAlgorithm = algo; if (algo == LM_SPEED_DENSITY) { setLinearCurve(config->ignitionLoadBins, 20, 120, 3); - buildTimingMap(35 PASS_CONFIG_PARAMETER_SUFFIX); + buildTimingMap(35); } } -void setFlatInjectorLag(float value DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setFlatInjectorLag(float value) { setArrayValues(engineConfiguration->injector.battLagCorr, value); } diff --git a/firmware/controllers/math/engine_math.h b/firmware/controllers/math/engine_math.h index 478e3f6267..c65e692f39 100644 --- a/firmware/controllers/math/engine_math.h +++ b/firmware/controllers/math/engine_math.h @@ -9,11 +9,11 @@ #include "trigger_structure.h" -void setAlgorithm(engine_load_mode_e algo DECLARE_CONFIG_PARAMETER_SUFFIX); +void setAlgorithm(engine_load_mode_e algo); #define assertEngineReference() efiAssertVoid(CUSTOM_ENGINE_REF, engine != NULL, "engine is NULL") -void setFlatInjectorLag(float value DECLARE_CONFIG_PARAMETER_SUFFIX); +void setFlatInjectorLag(float value); #define fixAngle(angle, msg, code) fixAngle2(angle, msg, code, ENGINE(engineCycle)) @@ -31,28 +31,28 @@ void setFlatInjectorLag(float value DECLARE_CONFIG_PARAMETER_SUFFIX); #define getOneDegreeTimeUs(rpm) (1000000.0f * 60 / 360 / (rpm)) floatms_t getCrankshaftRevolutionTimeMs(int rpm); -floatms_t getEngineCycleDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); +floatms_t getEngineCycleDuration(int rpm); -float getFuelingLoad(DECLARE_ENGINE_PARAMETER_SIGNATURE); -float getIgnitionLoad(DECLARE_ENGINE_PARAMETER_SIGNATURE); +float getFuelingLoad(); +float getIgnitionLoad(); -floatms_t getSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); +floatms_t getSparkDwell(int rpm); -ignition_mode_e getCurrentIgnitionMode(DECLARE_ENGINE_PARAMETER_SIGNATURE); +ignition_mode_e getCurrentIgnitionMode(); /** * This lightweight method is invoked in case of a configuration change or initialization. * But also it's used for "Spinning-up to Cranking" transition. */ -void prepareIgnitionPinIndices(ignition_mode_e ignitionMode DECLARE_ENGINE_PARAMETER_SUFFIX); +void prepareIgnitionPinIndices(ignition_mode_e ignitionMode); -int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX); -int getNextFiringCylinderId(int prevCylinderId DECLARE_ENGINE_PARAMETER_SUFFIX); +int getCylinderId(int index); +int getNextFiringCylinderId(int prevCylinderId); -void setTimingRpmBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX); -void setTimingLoadBin(float from, float to DECLARE_CONFIG_PARAMETER_SUFFIX); +void setTimingRpmBin(float from, float to); +void setTimingLoadBin(float from, float to); -void setSingleCoilDwell(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setSingleCoilDwell(); // we combine trigger-defined triggerShape.tdcPosition with user-defined CONFIG(globalTriggerAngleOffset) // expectation is that for well-known triggers CONFIG(globalTriggerAngleOffset) would usually be zero diff --git a/firmware/controllers/math/speed_density.cpp b/firmware/controllers/math/speed_density.cpp index f8dd337998..e605195ab2 100644 --- a/firmware/controllers/math/speed_density.cpp +++ b/firmware/controllers/math/speed_density.cpp @@ -26,7 +26,7 @@ baroCorr_Map3D_t baroCorrMap; #define tpMax 100 // http://rusefi.com/math/t_charge.html /***panel:Charge Temperature*/ -temperature_t getTCharge(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX) { +temperature_t getTCharge(int rpm, float tps) { const auto clt = Sensor::get(SensorType::Clt); const auto iat = Sensor::get(SensorType::Iat); @@ -54,7 +54,7 @@ temperature_t getTCharge(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX) { floatms_t airMassForEngine = engine->engineState.sd.airMassInOneCylinder * CONFIG(specs.cylindersCount); // airMass is in grams per 1 cycle for 1 cyl. Convert it to airFlow in kg/h for the engine. // And if the engine is stopped (0 rpm), then airFlow is also zero (avoiding NaN division) - floatms_t airFlow = (rpm == 0) ? 0 : airMassForEngine * gramsPerMsToKgPerHour / getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX); + floatms_t airFlow = (rpm == 0) ? 0 : airMassForEngine * gramsPerMsToKgPerHour / getEngineCycleDuration(rpm); // just interpolate between user-specified min and max coefs, based on the max airFlow value engine->engineState.airFlow = airFlow; engine->engineState.sd.Tcharge_coff = interpolateClamped(0.0, @@ -90,7 +90,7 @@ temperature_t getTCharge(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX) { return Tcharge; } -void initSpeedDensity(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initSpeedDensity() { veMap.init(config->veTable, config->veLoadBins, config->veRpmBins); // ve2Map.init(engineConfiguration->ve2Table, engineConfiguration->ve2LoadBins, engineConfiguration->ve2RpmBins); lambdaMap.init(config->lambdaTable, config->lambdaLoadBins, config->lambdaRpmBins); diff --git a/firmware/controllers/math/speed_density.h b/firmware/controllers/math/speed_density.h index d8ced7cc08..94fc9661a6 100644 --- a/firmware/controllers/math/speed_density.h +++ b/firmware/controllers/math/speed_density.h @@ -13,6 +13,6 @@ #define gramm_second_to_cc_minute(gs) ((gs) / 0.0119997981) #define cc_minute_to_gramm_second(ccm) ((ccm) * 0.0119997981) -temperature_t getTCharge(int rpm, float tps DECLARE_ENGINE_PARAMETER_SUFFIX); +temperature_t getTCharge(int rpm, float tps); -void initSpeedDensity(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initSpeedDensity(); diff --git a/firmware/controllers/sensors/allsensors.cpp b/firmware/controllers/sensors/allsensors.cpp index ef8a7113b4..3de46ccecc 100644 --- a/firmware/controllers/sensors/allsensors.cpp +++ b/firmware/controllers/sensors/allsensors.cpp @@ -11,15 +11,15 @@ ButtonDebounce acDebounce("ac_switch"); -void initSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - initMapDecoder(PASS_ENGINE_PARAMETER_SIGNATURE); +void initSensors() { + initMapDecoder(); acDebounce.init(15, CONFIG(acSwitch), CONFIG(acSwitchMode)); } -bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +bool getAcToggle() { return acDebounce.readPinState(); } -bool hasAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +bool hasAcToggle() { return (isBrainPinValid(CONFIG(acSwitch))); } diff --git a/firmware/controllers/sensors/allsensors.h b/firmware/controllers/sensors/allsensors.h index edaca92a56..d419d78536 100644 --- a/firmware/controllers/sensors/allsensors.h +++ b/firmware/controllers/sensors/allsensors.h @@ -21,8 +21,8 @@ #define LOW_VBATT 7 -void initSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initSensors(); -bool hasAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE); -bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE); +bool hasAcToggle(); +bool getAcToggle(); diff --git a/firmware/controllers/sensors/ego.cpp b/firmware/controllers/sensors/ego.cpp index 4456d695df..5f2ea62ea6 100644 --- a/firmware/controllers/sensors/ego.cpp +++ b/firmware/controllers/sensors/ego.cpp @@ -44,7 +44,7 @@ static const int maxAvgSize = (EGO_AVG_BUF_SIZE - 1); // the whole buffer static float lastAfr = stoichAfr; #endif -void initEgoAveraging(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initEgoAveraging() { // Our averaging is intended for use only with Narrow EGOs. if (CONFIG(afr_type) == ES_NarrowBand) { totalEgoCnt = prevEgoCnt = 0; @@ -87,18 +87,18 @@ static float updateEgoAverage(float afr) { return egoAfrSum / float(totalEgoCnt - startAvgCnt); } #else -void initEgoAveraging(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initEgoAveraging() { } #endif -bool hasAfrSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +bool hasAfrSensor() { if (CONFIG(enableAemXSeries) || CONFIG(enableInnovateLC2)) { return true; } #if EFI_CJ125 && HAL_USE_SPI if (CONFIG(isCJ125Enabled)) { - return cjHasAfrSensor(PASS_ENGINE_PARAMETER_SIGNATURE); + return cjHasAfrSensor(); } #endif /* EFI_CJ125 && HAL_USE_SPI */ return isAdcChannelValid(engineConfiguration->afr.hwChannel); @@ -106,7 +106,7 @@ bool hasAfrSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) { extern float InnovateLC2AFR; -float getAfr(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getAfr() { #if EFI_AUX_SERIAL if (CONFIG(enableInnovateLC2)) return InnovateLC2AFR; @@ -114,7 +114,7 @@ float getAfr(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #if EFI_CJ125 && HAL_USE_SPI if (CONFIG(isCJ125Enabled)) { - return cjGetAfr(PASS_ENGINE_PARAMETER_SIGNATURE); + return cjGetAfr(); } #endif /* EFI_CJ125 && HAL_USE_SPI */ afr_sensor_s * sensor = &CONFIG(afr); @@ -123,7 +123,7 @@ float getAfr(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return 0; } - float volts = getVoltageDivided("ego", sensor->hwChannel PASS_ENGINE_PARAMETER_SUFFIX); + float volts = getVoltageDivided("ego", sensor->hwChannel); if (CONFIG(afr_type) == ES_NarrowBand) { float afr = interpolate2d(volts, engineConfiguration->narrowToWideOxygenBins, engineConfiguration->narrowToWideOxygen); @@ -184,7 +184,7 @@ static void initEgoSensor(afr_sensor_s *sensor, ego_sensor_e type) { } } -void setEgoSensor(ego_sensor_e type DECLARE_CONFIG_PARAMETER_SUFFIX) { +void setEgoSensor(ego_sensor_e type) { CONFIG(afr_type) = type; initEgoSensor(&engineConfiguration->afr, type); } diff --git a/firmware/controllers/sensors/ego.h b/firmware/controllers/sensors/ego.h index ef1cf42bc5..dc11171e2f 100644 --- a/firmware/controllers/sensors/ego.h +++ b/firmware/controllers/sensors/ego.h @@ -12,7 +12,7 @@ #include "global.h" #include "engine_configuration.h" -float getAfr(DECLARE_ENGINE_PARAMETER_SIGNATURE); -bool hasAfrSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void setEgoSensor(ego_sensor_e type DECLARE_CONFIG_PARAMETER_SUFFIX); -void initEgoAveraging(DECLARE_ENGINE_PARAMETER_SIGNATURE); +float getAfr(); +bool hasAfrSensor(); +void setEgoSensor(ego_sensor_e type); +void initEgoAveraging(); diff --git a/firmware/controllers/sensors/map.cpp b/firmware/controllers/sensors/map.cpp index 61bdde3fd0..0a44d42b2e 100644 --- a/firmware/controllers/sensors/map.cpp +++ b/firmware/controllers/sensors/map.cpp @@ -75,7 +75,7 @@ static FastInterpolation bosch2_5(0.4 /* volts */, 20 /* kPa */, 4.65 /* volts * static FastInterpolation *getDecoder(air_pressure_sensor_type_e type); -float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DECLARE_ENGINE_PARAMETER_SUFFIX) { +float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig) { switch (mapConfig->type) { case MT_CUSTOM: // todo: migrate to 'FastInterpolation customMap' @@ -106,7 +106,7 @@ float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DEC * This function checks if Baro/MAP sensor value is inside of expected range * @return unchanged mapKPa parameter or NaN */ -static float validateBaroMap(float mapKPa DECLARE_ENGINE_PARAMETER_SUFFIX) { +static float validateBaroMap(float mapKPa) { const float atmoPressure = 100.0f; const float atmoPressureRange = 15.0f; // 85..115 if (cisnan(mapKPa) || absF(mapKPa - atmoPressure) > atmoPressureRange) { @@ -116,12 +116,12 @@ static float validateBaroMap(float mapKPa DECLARE_ENGINE_PARAMETER_SUFFIX) { return mapKPa; } -float getBaroPressure(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getBaroPressure() { // Override the real Baro sensor with the stored initial MAP value, if the option is set. if (CONFIG(useFixedBaroCorrFromMap)) return storedInitialBaroPressure; - float voltage = getVoltageDivided("baro", engineConfiguration->baroSensor.hwChannel PASS_ENGINE_PARAMETER_SUFFIX); - return decodePressure(voltage, &engineConfiguration->baroSensor PASS_ENGINE_PARAMETER_SUFFIX); + float voltage = getVoltageDivided("baro", engineConfiguration->baroSensor.hwChannel); + return decodePressure(voltage, &engineConfiguration->baroSensor); } static FastInterpolation *getDecoder(air_pressure_sensor_type_e type) { @@ -160,7 +160,7 @@ static FastInterpolation *getDecoder(air_pressure_sensor_type_e type) { } } -static void applyConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void applyConfiguration() { air_pressure_sensor_config_s * apConfig = &engineConfiguration->map.sensor; customMap.init(0, apConfig->lowValue, 5, apConfig->highValue); } @@ -183,7 +183,7 @@ static void printMAPInfo() { adc_channel_e mapAdc = engineConfiguration->map.sensor.hwChannel; char pinNameBuffer[16]; - efiPrintf("MAP %.2fv @%s", getVoltage("mapinfo", mapAdc PASS_ENGINE_PARAMETER_SUFFIX), + efiPrintf("MAP %.2fv @%s", getVoltage("mapinfo", mapAdc), getPinNameByAdcChannel("map", mapAdc, pinNameBuffer)); if (engineConfiguration->map.sensor.type == MT_CUSTOM) { efiPrintf("at %.2fv=%.2f at %.2fv=%.2f", @@ -208,15 +208,15 @@ static void printMAPInfo() { #endif /* EFI_PROD_CODE */ -void initMapDecoder(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - applyConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); +void initMapDecoder() { + applyConfiguration(); if (CONFIG(useFixedBaroCorrFromMap)) { // Read initial MAP sensor value and store it for Baro correction. storedInitialBaroPressure = Sensor::get(SensorType::MapSlow).value_or(101.325); efiPrintf("Get initial baro MAP pressure = %.2fkPa", storedInitialBaroPressure); // validate if it's within a reasonable range (the engine should not be spinning etc.) - storedInitialBaroPressure = validateBaroMap(storedInitialBaroPressure PASS_ENGINE_PARAMETER_SUFFIX); + storedInitialBaroPressure = validateBaroMap(storedInitialBaroPressure); if (!cisnan(storedInitialBaroPressure)) { efiPrintf("Using this fixed MAP pressure to override the baro correction!"); } else { @@ -231,7 +231,7 @@ void initMapDecoder(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #else /* EFI_ANALOG_SENSORS */ -void initMapDecoder(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initMapDecoder() { } #endif /* EFI_ANALOG_SENSORS */ diff --git a/firmware/controllers/sensors/map.h b/firmware/controllers/sensors/map.h index 5e6b3573ff..047662df3e 100644 --- a/firmware/controllers/sensors/map.h +++ b/firmware/controllers/sensors/map.h @@ -10,11 +10,11 @@ struct air_pressure_sensor_config_s; -void initMapDecoder(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initMapDecoder(); -float getBaroPressure(DECLARE_ENGINE_PARAMETER_SIGNATURE); +float getBaroPressure(); -float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DECLARE_ENGINE_PARAMETER_SUFFIX); +float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig); #define KPA_PER_PSI 6.89475728f diff --git a/firmware/controllers/sensors/vr_pwm.cpp b/firmware/controllers/sensors/vr_pwm.cpp index 98eb91714d..a55a37f6be 100644 --- a/firmware/controllers/sensors/vr_pwm.cpp +++ b/firmware/controllers/sensors/vr_pwm.cpp @@ -5,7 +5,7 @@ static OutputPin pins[VR_THRESHOLD_COUNT]; static SimplePwm pwms[VR_THRESHOLD_COUNT]; -static void updateVrPwm(int rpm, size_t index DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void updateVrPwm(int rpm, size_t index) { auto& cfg = CONFIG(vrThreshold)[index]; if (cfg.pin == GPIO_UNASSIGNED) { @@ -21,15 +21,15 @@ static void updateVrPwm(int rpm, size_t index DECLARE_ENGINE_PARAMETER_SUFFIX) { pwms[index].setSimplePwmDutyCycle(duty); } -void updateVrPwm(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void updateVrPwm() { auto rpm = GET_RPM(); for (size_t i = 0; i < efi::size(CONFIG(vrThreshold)); i++) { - updateVrPwm(rpm, i PASS_ENGINE_PARAMETER_SUFFIX); + updateVrPwm(rpm, i); } } -void initVrPwm(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initVrPwm() { for (size_t i = 0; i < efi::size(CONFIG(vrThreshold)); i++) { auto& cfg = CONFIG(vrThreshold)[i]; diff --git a/firmware/controllers/sensors/vr_pwm.h b/firmware/controllers/sensors/vr_pwm.h index 89fba27b27..b77f4f8987 100644 --- a/firmware/controllers/sensors/vr_pwm.h +++ b/firmware/controllers/sensors/vr_pwm.h @@ -1,4 +1,4 @@ #pragma once -void initVrPwm(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void updateVrPwm(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initVrPwm(); +void updateVrPwm(); diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 7bf2502e7f..fba7ff39dc 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -100,7 +100,7 @@ void printConfiguration(const engine_configuration_s *engineConfiguration) { efiPrintf("configurationVersion=%d", engine->getGlobalConfigurationVersion()); efiPrintf("rpmHardLimit: %d/operationMode=%d", engineConfiguration->rpmHardLimit, - engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + engine->getOperationMode()); efiPrintf("globalTriggerAngleOffset=%.2f", engineConfiguration->globalTriggerAngleOffset); @@ -151,25 +151,25 @@ void printConfiguration(const engine_configuration_s *engineConfiguration) { #endif /* EFI_PROD_CODE */ } -static void doPrintConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void doPrintConfiguration() { printConfiguration(engineConfiguration); } static void setFixedModeTiming(int value) { engineConfiguration->fixedModeTiming = value; doPrintConfiguration(); - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } static void setTimingMode(int value) { engineConfiguration->timingMode = (timing_mode_e) value; doPrintConfiguration(); - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } static void setIdleSolenoidFrequency(int value) { engineConfiguration->idle.solenoidFrequency = value; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } static void setInjectionPinMode(int value) { @@ -190,7 +190,7 @@ static void setIdlePinMode(int value) { static void setInjectionOffset(float value) { engineConfiguration->extraInjectionOffset = value; doPrintConfiguration(); - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } static void setFuelPumpPinMode(int value) { @@ -304,37 +304,37 @@ static void setGlobalTriggerAngleOffset(float value) { return; } engineConfiguration->globalTriggerAngleOffset = value; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); doPrintConfiguration(); } static void setCrankingPrimingPulse(float value) { engineConfiguration->startOfCrankingPrimingPulse = value; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } static void setCrankingTimingAngle(float value) { engineConfiguration->crankingTimingAngle = value; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); doPrintConfiguration(); } static void setCrankingInjectionMode(int value) { engineConfiguration->crankingInjectionMode = (injection_mode_e) value; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); doPrintConfiguration(); } static void setInjectionMode(int value) { engineConfiguration->injectionMode = (injection_mode_e) value; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); doPrintConfiguration(); } static void setIgnitionMode(int value) { engineConfiguration->ignitionMode = (ignition_mode_e) value; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); - prepareOutputSignals(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); + prepareOutputSignals(); doPrintConfiguration(); } @@ -352,7 +352,7 @@ static void setIndividualCoilsIgnition() { static void setTriggerType(int value) { engineConfiguration->trigger.type = (trigger_type_e) value; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); doPrintConfiguration(); efiPrintf("Do you need to also invoke set operation_mode X?"); engine->resetEngineSnifferIfInTestMode(); @@ -366,7 +366,7 @@ static void setInjectorLag(float voltage, float value) { setCurveValue(INJECTOR_LAG_CURVE, voltage, value); } -static void setToothedWheel(int total, int skipped DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void setToothedWheel(int total, int skipped) { if (total < 1 || skipped >= total) { efiPrintf("invalid parameters %d %d", total, skipped); return; @@ -377,7 +377,7 @@ static void setToothedWheel(int total, int skipped DECLARE_ENGINE_PARAMETER_SUFF efiPrintf("toothed: total=%d/skipped=%d", total, skipped); setToothedWheelConfiguration(&engine->triggerCentral.triggerShape, total, skipped, engineConfiguration->ambiguousOperationMode); - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); doPrintConfiguration(); } @@ -461,7 +461,7 @@ static void setIgnitionPin(const char *indexStr, const char *pinName) { } efiPrintf("setting ignition pin[%d] to %s please save&restart", index, hwPortname(pin)); engineConfiguration->ignitionPins[index] = pin; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } // this method is useful for desperate time debugging @@ -501,7 +501,7 @@ static void setIndividualPin(const char *pinName, brain_pin_e *targetPin, const } efiPrintf("setting %s pin to %s please save&restart", name, hwPortname(pin)); *targetPin = pin; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } // set vss_pin @@ -572,7 +572,7 @@ static void setInjectionPin(const char *indexStr, const char *pinName) { } efiPrintf("setting injection pin[%d] to %s please save&restart", index, hwPortname(pin)); engineConfiguration->injectionPins[index] = pin; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } /** @@ -591,7 +591,7 @@ static void setTriggerInputPin(const char *indexStr, const char *pinName) { } efiPrintf("setting trigger pin[%d] to %s please save&restart", index, hwPortname(pin)); engineConfiguration->triggerInputPins[index] = pin; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } static void setTriggerSimulatorMode(const char *indexStr, const char *modeCode) { @@ -616,7 +616,7 @@ static void setEgtCSPin(const char *indexStr, const char *pinName) { } efiPrintf("setting EGT CS pin[%d] to %s please save&restart", index, hwPortname(pin)); engineConfiguration->max31855_cs[index] = pin; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } static void setTriggerSimulatorPin(const char *indexStr, const char *pinName) { @@ -629,7 +629,7 @@ static void setTriggerSimulatorPin(const char *indexStr, const char *pinName) { } efiPrintf("setting trigger simulator pin[%d] to %s please save&restart", index, hwPortname(pin)); engineConfiguration->triggerSimulatorPins[index] = pin; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } #if HAL_USE_ADC @@ -667,7 +667,7 @@ static void setAnalogInputPin(const char *sensorStr, const char *pinName) { engineConfiguration->tps2_1AdcChannel = channel; efiPrintf("setting TPS2 to %s/%d", pinName, channel); } - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } #endif @@ -682,7 +682,7 @@ static void setLogicInputPin(const char *indexStr, const char *pinName) { } efiPrintf("setting logic input pin[%d] to %s please save&restart", index, hwPortname(pin)); engineConfiguration->logicAnalyzerPins[index] = pin; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } static void showPinFunction(const char *pinName) { @@ -762,16 +762,16 @@ static void enableOrDisable(const char *param, bool isEnabled) { engineConfiguration->useStepperIdle = isEnabled; } else if (strEqualCaseInsensitive(param, "trigger_only_front")) { engineConfiguration->useOnlyRisingEdgeForTrigger = isEnabled; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } else if (strEqualCaseInsensitive(param, "use_only_first_channel")) { engineConfiguration->trigger.useOnlyFirstChannel = isEnabled; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } else if (strEqualCaseInsensitive(param, "two_wire_batch_injection")) { engineConfiguration->twoWireBatchInjection = isEnabled; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } else if (strEqualCaseInsensitive(param, "two_wire_wasted_spark")) { engineConfiguration->twoWireBatchIgnition = isEnabled; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } else if (strEqualCaseInsensitive(param, "HIP9011")) { engineConfiguration->isHip9011Enabled = isEnabled; } else if (strEqualCaseInsensitive(param, "verbose_etb")) { @@ -858,7 +858,7 @@ static void disableSpi(int index) { * weird: we stop pins from here? we probably should stop engine from the code which is actually stopping engine? */ void scheduleStopEngine(void) { - doScheduleStopEngine(PASS_ENGINE_PARAMETER_SIGNATURE); + doScheduleStopEngine(); } static void printAllInfo() { @@ -1168,7 +1168,7 @@ static void setValue(const char *paramStr, const char *valueStr) { } else if (strEqualCaseInsensitive(paramStr, "warning_period")) { engineConfiguration->warningPeriod = valueI; } else if (strEqualCaseInsensitive(paramStr, "dwell")) { - setConstantDwell(valueF PASS_CONFIG_PARAMETER_SUFFIX); + setConstantDwell(valueF); } else if (strEqualCaseInsensitive(paramStr, CMD_ENGINESNIFFERRPMTHRESHOLD)) { engineConfiguration->engineSnifferRpmThreshold = valueI; // migrate to new laucnh fields? @@ -1299,21 +1299,21 @@ void initSettings(void) { #endif /* !EFI_UNIT_TEST */ -void setEngineType(int value DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setEngineType(int value) { { #if EFI_PROD_CODE chibios_rt::CriticalSectionLocker csl; #endif /* EFI_PROD_CODE */ engineConfiguration->engineType = (engine_type_e)value; - resetConfigurationExt((engine_type_e)value PASS_ENGINE_PARAMETER_SUFFIX); + resetConfigurationExt((engine_type_e)value); engine->resetEngineSnifferIfInTestMode(); #if EFI_INTERNAL_FLASH writeToFlashNow(); #endif /* EFI_INTERNAL_FLASH */ } - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); #if ! EFI_UNIT_TEST doPrintConfiguration(); #endif /* EFI_UNIT_TEST */ diff --git a/firmware/controllers/settings.h b/firmware/controllers/settings.h index 1258615084..8169b4dfed 100644 --- a/firmware/controllers/settings.h +++ b/firmware/controllers/settings.h @@ -16,5 +16,5 @@ void printConfiguration(const engine_configuration_s *engineConfiguration); void scheduleStopEngine(void); void setCallFromPitStop(int durationMs); void printTPSInfo(void); -void setEngineType(int value DECLARE_ENGINE_PARAMETER_SUFFIX); +void setEngineType(int value); void readPin(const char *pinName); diff --git a/firmware/controllers/start_stop.cpp b/firmware/controllers/start_stop.cpp index 8ff5650de2..edcac3fc75 100644 --- a/firmware/controllers/start_stop.cpp +++ b/firmware/controllers/start_stop.cpp @@ -4,7 +4,7 @@ ButtonDebounce startStopButtonDebounce("start_button"); -void initStartStopButton(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initStartStopButton() { /* startCrankingDuration is efitimesec_t, so we need to multiply it by 1000 to get milliseconds*/ startStopButtonDebounce.init((CONFIG(startCrankingDuration)*1000), CONFIG(startStopButtonPin), CONFIG(startStopButtonMode)); } diff --git a/firmware/controllers/start_stop.h b/firmware/controllers/start_stop.h index 823f6c1a84..7e2e295785 100644 --- a/firmware/controllers/start_stop.h +++ b/firmware/controllers/start_stop.h @@ -3,4 +3,4 @@ #include "debounce.h" #include "globalaccess.h" -void initStartStopButton(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initStartStopButton(); diff --git a/firmware/controllers/system/efi_gpio.cpp b/firmware/controllers/system/efi_gpio.cpp index 579728ee4b..bd5a08913b 100644 --- a/firmware/controllers/system/efi_gpio.cpp +++ b/firmware/controllers/system/efi_gpio.cpp @@ -81,7 +81,7 @@ bool RegisteredOutputPin::isPinConfigurationChanged() { #endif // EFI_PROD_CODE } -void RegisteredOutputPin::init(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void RegisteredOutputPin::init() { brain_pin_e newPin = *(brain_pin_e *) ((void *) (&((char*) engineConfiguration)[pinOffset])); pin_output_mode_e *newMode = (pin_output_mode_e *) ((void *) (&((char*) engineConfiguration)[pinModeOffset])); @@ -209,7 +209,7 @@ void EnginePins::startPins() { RegisteredOutputPin * pin = registeredOutputHead; while (pin != nullptr) { - pin->init(PASS_ENGINE_PARAMETER_SIGNATURE); + pin->init(); pin = pin->next; } } @@ -464,7 +464,7 @@ void OutputPin::setDefaultPinState(const pin_output_mode_e *outputMode) { setValue(false); // initial state } -void initOutputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initOutputPins() { #if EFI_GPIO_HARDWARE #if HAL_USE_SPI diff --git a/firmware/controllers/system/efi_gpio.h b/firmware/controllers/system/efi_gpio.h index cceb478b64..56c0715c1b 100644 --- a/firmware/controllers/system/efi_gpio.h +++ b/firmware/controllers/system/efi_gpio.h @@ -15,7 +15,7 @@ #include "smart_gpio.h" void initPrimaryPins(); -void initOutputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initOutputPins(); #if EFI_GPIO_HARDWARE void turnAllPinsOff(void); @@ -114,8 +114,8 @@ public: InjectorOutputPin(); void reset(); - void open(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX); - void close(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX); + void open(efitick_t nowNt); + void close(efitick_t nowNt); int8_t getOverlappingCounter() const { return overlappingCounter; } @@ -140,7 +140,7 @@ public: class RegisteredOutputPin : public virtual OutputPin { public: RegisteredOutputPin(const char *registrationName, short pinOffset, short pinModeOffset); - void init(DECLARE_ENGINE_PARAMETER_SIGNATURE); + void init(); void unregister(); RegisteredOutputPin *next; const char *registrationName; diff --git a/firmware/controllers/trigger/decoders/trigger_chrysler.cpp b/firmware/controllers/trigger/decoders/trigger_chrysler.cpp index 8a6f1bcf1f..fb990f315c 100644 --- a/firmware/controllers/trigger/decoders/trigger_chrysler.cpp +++ b/firmware/controllers/trigger/decoders/trigger_chrysler.cpp @@ -24,7 +24,7 @@ void initDodgeRam(TriggerWaveform *s) { s->addEvent720(720, T_PRIMARY, TV_FALL); } -void configureNeon2003TriggerWaveformCrank(TriggerWaveform *s DECLARE_ENGINE_PARAMETER_SUFFIX) { +void configureNeon2003TriggerWaveformCrank(TriggerWaveform *s) { s->initialize(FOUR_STROKE_CRANK_SENSOR); s->useRiseEdge = true; diff --git a/firmware/controllers/trigger/decoders/trigger_nissan.cpp b/firmware/controllers/trigger/decoders/trigger_nissan.cpp index 409cb9c686..544105e9c9 100644 --- a/firmware/controllers/trigger/decoders/trigger_nissan.cpp +++ b/firmware/controllers/trigger/decoders/trigger_nissan.cpp @@ -54,7 +54,7 @@ static void initializeNissanSR20VE_4_optional_360(TriggerWaveform *s, bool with2 right = base - width; if (with2nd) { // addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720, -// left, right PASS_ENGINE_PARAMETER_SUFFIX); +// left, right); } s->addEvent720(right, T_PRIMARY, TV_RISE); @@ -62,7 +62,7 @@ static void initializeNissanSR20VE_4_optional_360(TriggerWaveform *s, bool with2 right = base; if (with2nd) { // addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720, -// left, right PASS_ENGINE_PARAMETER_SUFFIX); +// left, right); } s->addEvent720(right, T_PRIMARY, TV_FALL); @@ -71,7 +71,7 @@ static void initializeNissanSR20VE_4_optional_360(TriggerWaveform *s, bool with2 right = base - width; if (with2nd) { // addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720, -// left, right PASS_ENGINE_PARAMETER_SUFFIX); +// left, right); } s->addEvent720(right, T_PRIMARY, TV_RISE); @@ -79,7 +79,7 @@ static void initializeNissanSR20VE_4_optional_360(TriggerWaveform *s, bool with2 right = base; if (with2nd) { // addSkippedToothTriggerEvents(T_SECONDARY, s, total, 0, 0.5, 0, 720, -// left, right PASS_ENGINE_PARAMETER_SUFFIX); +// left, right); } s->addEvent720(right, T_PRIMARY, TV_FALL); diff --git a/firmware/controllers/trigger/decoders/trigger_structure.cpp b/firmware/controllers/trigger/decoders/trigger_structure.cpp index f985a01380..71ed963672 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.cpp +++ b/firmware/controllers/trigger/decoders/trigger_structure.cpp @@ -43,10 +43,10 @@ #include "sensor_chart.h" #endif /* EFI_SENSOR_CHART */ -void event_trigger_position_s::setAngle(angle_t angle DECLARE_ENGINE_PARAMETER_SUFFIX) { +void event_trigger_position_s::setAngle(angle_t angle) { findTriggerPosition(&ENGINE(triggerCentral.triggerShape), &ENGINE(triggerCentral.triggerFormDetails), - this, angle PASS_CONFIG_PARAM(engineConfiguration->globalTriggerAngleOffset)); + this, angle); } trigger_shape_helper::trigger_shape_helper() { @@ -393,18 +393,18 @@ void TriggerWaveform::setShapeDefinitionError(bool value) { void findTriggerPosition(TriggerWaveform *triggerShape, TriggerFormDetails *details, event_trigger_position_s *position, - angle_t angle DEFINE_CONFIG_PARAM(angle_t, globalTriggerAngleOffset)) { + angle_t angle) { efiAssertVoid(CUSTOM_ERR_6574, !cisnan(angle), "findAngle#1"); assertAngleRange(angle, "findAngle#a1", CUSTOM_ERR_6545); efiAssertVoid(CUSTOM_ERR_6575, !cisnan(triggerShape->tdcPosition), "tdcPos#1") assertAngleRange(triggerShape->tdcPosition, "tdcPos#a1", CUSTOM_UNEXPECTED_TDC_ANGLE); - efiAssertVoid(CUSTOM_ERR_6576, !cisnan(CONFIG_PARAM(globalTriggerAngleOffset)), "tdcPos#2") - assertAngleRange(CONFIG_PARAM(globalTriggerAngleOffset), "tdcPos#a2", CUSTOM_INVALID_GLOBAL_OFFSET); + efiAssertVoid(CUSTOM_ERR_6576, !cisnan(CONFIG(globalTriggerAngleOffset)), "tdcPos#2") + assertAngleRange(CONFIG(globalTriggerAngleOffset), "tdcPos#a2", CUSTOM_INVALID_GLOBAL_OFFSET); // convert engine cycle angle into trigger cycle angle - angle += triggerShape->tdcPosition + CONFIG_PARAM(globalTriggerAngleOffset); + angle += triggerShape->tdcPosition + CONFIG(globalTriggerAngleOffset); efiAssertVoid(CUSTOM_ERR_6577, !cisnan(angle), "findAngle#2"); fixAngle2(angle, "addFuel#2", CUSTOM_ERR_6555, getEngineCycle(triggerShape->getOperationMode())); @@ -427,14 +427,14 @@ void findTriggerPosition(TriggerWaveform *triggerShape, } } -void TriggerWaveform::prepareShape(TriggerFormDetails *details DECLARE_ENGINE_PARAMETER_SUFFIX) { +void TriggerWaveform::prepareShape(TriggerFormDetails *details) { #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT if (shapeDefinitionError) { // Nothing to do here if there's a problem with the trigger shape return; } - prepareEventAngles(this, details PASS_ENGINE_PARAMETER_SUFFIX); + prepareEventAngles(this, details); #endif } diff --git a/firmware/controllers/trigger/decoders/trigger_structure.h b/firmware/controllers/trigger/decoders/trigger_structure.h index ce8cfeb4a4..6df220cbe8 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.h +++ b/firmware/controllers/trigger/decoders/trigger_structure.h @@ -56,7 +56,7 @@ public: angle_t angleOffsetFromTriggerEvent = 0; - void setAngle(angle_t angle DECLARE_ENGINE_PARAMETER_SUFFIX); + void setAngle(angle_t angle); }; #define TRIGGER_CHANNEL_COUNT 3 @@ -249,7 +249,7 @@ public: size_t getSize() const; int getTriggerWaveformSynchPointIndex() const; - void prepareShape(TriggerFormDetails *details DECLARE_ENGINE_PARAMETER_SUFFIX); + void prepareShape(TriggerFormDetails *details); /** * This private method should only be used to prepare the array of pre-calculated values @@ -318,7 +318,7 @@ void findTriggerPosition( TriggerWaveform *shape, TriggerFormDetails *details, event_trigger_position_s *position, - angle_t angle DEFINE_CONFIG_PARAM(angle_t, globalTriggerAngleOffset)); + angle_t angle); void setToothedWheelConfiguration(TriggerWaveform *s, int total, int skipped, operation_mode_e operationMode); diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index cea276a0a1..95ae38b496 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -51,11 +51,11 @@ TriggerCentral::TriggerCentral() : trigger_central_s(), noiseFilter.resetAccumSignalData(); } -void TriggerCentral::init(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - triggerState.inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void TriggerCentral::init() { + triggerState.inject(); for (int bankIndex = 0; bankIndex < BANKS_COUNT; bankIndex++) { for (int camIndex = 0; camIndex < CAMS_PER_BANK; camIndex++) { - vvtState[bankIndex][camIndex].inject(PASS_ENGINE_PARAMETER_SIGNATURE); + vvtState[bankIndex][camIndex].inject(); } } } @@ -117,8 +117,8 @@ static bool vvtWithRealDecoder(vvt_mode_e vvtMode) { && vvtMode != VVT_FIRST_HALF; } -static angle_t syncAndReport(TriggerCentral *tc, int divider, int remainder DECLARE_ENGINE_PARAMETER_SUFFIX) { - angle_t engineCycle = getEngineCycle(engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE)); +static angle_t syncAndReport(TriggerCentral *tc, int divider, int remainder) { + angle_t engineCycle = getEngineCycle(engine->getOperationMode()); angle_t offset = tc->triggerState.syncSymmetricalCrank(divider, remainder, engineCycle); if (offset > 0 && engineConfiguration->debugMode == DBG_VVT) { @@ -145,22 +145,22 @@ static void turnOffAllDebugFields(void *arg) { #endif /* EFI_PROD_CODE */ } -static angle_t adjustCrankPhase(int camIndex DECLARE_ENGINE_PARAMETER_SUFFIX) { +static angle_t adjustCrankPhase(int camIndex) { TriggerCentral *tc = &engine->triggerCentral; - operation_mode_e operationMode = engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE); + operation_mode_e operationMode = engine->getOperationMode(); switch (engineConfiguration->vvtMode[camIndex]) { case VVT_FIRST_HALF: - return syncAndReport(tc, getCrankDivider(operationMode), 1 PASS_ENGINE_PARAMETER_SUFFIX); + return syncAndReport(tc, getCrankDivider(operationMode), 1); case VVT_SECOND_HALF: - return syncAndReport(tc, getCrankDivider(operationMode), 0 PASS_ENGINE_PARAMETER_SUFFIX); + return syncAndReport(tc, getCrankDivider(operationMode), 0); case VVT_MIATA_NB2: /** * NB2 is a symmetrical crank, there are four phases total */ - return syncAndReport(tc, getCrankDivider(operationMode), 0 PASS_ENGINE_PARAMETER_SUFFIX); + return syncAndReport(tc, getCrankDivider(operationMode), 0); case VVT_NISSAN_VQ: - return syncAndReport(tc, getCrankDivider(operationMode), 0 PASS_ENGINE_PARAMETER_SUFFIX); + return syncAndReport(tc, getCrankDivider(operationMode), 0); default: case VVT_INACTIVE: // do nothing @@ -179,7 +179,7 @@ static angle_t wrapVvt(angle_t vvtPosition, int period) { return vvtPosition; } -static void logFront(bool isImportantFront, efitick_t nowNt, int index DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void logFront(bool isImportantFront, efitick_t nowNt, int index) { extern const char *vvtNames[]; const char *vvtName = vvtNames[index]; @@ -195,15 +195,15 @@ static void logFront(bool isImportantFront, efitick_t nowNt, int index DECLARE_E // todo: unify TS composite logger code with console Engine Sniffer // todo: better API to reduce copy/paste? #if EFI_TOOTH_LOGGER - LogTriggerTooth(SHAFT_SECONDARY_RISING, nowNt PASS_ENGINE_PARAMETER_SUFFIX); - LogTriggerTooth(SHAFT_SECONDARY_FALLING, nowNt PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerTooth(SHAFT_SECONDARY_RISING, nowNt); + LogTriggerTooth(SHAFT_SECONDARY_FALLING, nowNt); #endif /* EFI_TOOTH_LOGGER */ addEngineSnifferEvent(vvtName, PROTOCOL_ES_UP); addEngineSnifferEvent(vvtName, PROTOCOL_ES_DOWN); } else { #if EFI_TOOTH_LOGGER - LogTriggerTooth(SHAFT_SECONDARY_FALLING, nowNt PASS_ENGINE_PARAMETER_SUFFIX); - LogTriggerTooth(SHAFT_SECONDARY_RISING, nowNt PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerTooth(SHAFT_SECONDARY_FALLING, nowNt); + LogTriggerTooth(SHAFT_SECONDARY_RISING, nowNt); #endif /* EFI_TOOTH_LOGGER */ addEngineSnifferEvent(vvtName, PROTOCOL_ES_DOWN); @@ -212,7 +212,7 @@ static void logFront(bool isImportantFront, efitick_t nowNt, int index DECLARE_E } } -void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index DECLARE_ENGINE_PARAMETER_SUFFIX) { +void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index) { int bankIndex = index / CAMS_PER_BANK; int camIndex = index % CAMS_PER_BANK; TriggerCentral *tc = &engine->triggerCentral; @@ -255,7 +255,7 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index DECL tooth = front == TV_RISE ? SHAFT_3RD_RISING : SHAFT_3RD_FALLING; } - LogTriggerTooth(tooth, nowNt PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerTooth(tooth, nowNt); #endif /* EFI_TOOTH_LOGGER */ } @@ -267,7 +267,7 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index DECL return; } - logFront(isImportantFront, nowNt, index PASS_ENGINE_PARAMETER_SUFFIX); + logFront(isImportantFront, nowNt, index); auto currentPhase = tc->getCurrentEnginePhase(nowNt); @@ -346,7 +346,7 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index DECL return; } - angle_t crankOffset = adjustCrankPhase(camIndex PASS_ENGINE_PARAMETER_SUFFIX); + angle_t crankOffset = adjustCrankPhase(camIndex); // vvtPosition was calculated against wrong crank zero position. Now that we have adjusted crank position we // shall adjust vvt position as well vvtPosition -= crankOffset; @@ -385,7 +385,7 @@ uint32_t triggerMaxDuration = 0; * - Hardware triggers * - Trigger replay from CSV (unit tests) */ -void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { +void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp) { ScopePerf perf(PE::HandleShaftSignal); #if VR_HW_CHECK_MODE // some boards do not have hardware VR input LEDs which makes such boards harder to validate @@ -406,11 +406,11 @@ void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp DEC palWritePad(criticalErrorLedPort, criticalErrorLedPin, 0); #endif // VR_HW_CHECK_MODE - handleShaftSignal(signalIndex, isRising, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + handleShaftSignal(signalIndex, isRising, timestamp); } // Handle all shaft signals - hardware or emulated both -void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { +void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp) { bool isPrimary = signalIndex == 0; if (!isPrimary && !TRIGGER_WAVEFORM(needSecondTriggerInput)) { return; @@ -442,7 +442,7 @@ void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp DECLA if (!logLogicState) { // we log physical state even if displayLogicLevelsInEngineSniffer if both fronts are used by decoder - LogTriggerTooth(signal, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerTooth(signal, timestamp); } #endif /* EFI_TOOTH_LOGGER */ @@ -467,11 +467,11 @@ void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp DECLA #if EFI_TOOTH_LOGGER if (logLogicState) { - LogTriggerTooth(signal, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerTooth(signal, timestamp); if (signal == SHAFT_PRIMARY_RISING) { - LogTriggerTooth(SHAFT_PRIMARY_FALLING, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerTooth(SHAFT_PRIMARY_FALLING, timestamp); } else { - LogTriggerTooth(SHAFT_SECONDARY_FALLING, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerTooth(SHAFT_SECONDARY_FALLING, timestamp); } } #endif /* EFI_TOOTH_LOGGER */ @@ -481,7 +481,7 @@ void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp DECLA maxTriggerReentraint = triggerReentraint; triggerReentraint++; - ENGINE(triggerCentral).handleShaftSignal(signal, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + ENGINE(triggerCentral).handleShaftSignal(signal, timestamp); triggerReentraint--; triggerDuration = getTimeNowLowerNt() - triggerHandlerEntryTime; @@ -497,7 +497,7 @@ static char shaft_signal_msg_index[15]; static const bool isUpEvent[6] = { false, true, false, true, false, true }; static const char *eventId[6] = { PROTOCOL_CRANK1, PROTOCOL_CRANK1, PROTOCOL_CRANK2, PROTOCOL_CRANK2, PROTOCOL_CRANK3, PROTOCOL_CRANK3 }; -static void reportEventToWaveChart(trigger_event_e ckpSignalType, int index DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void reportEventToWaveChart(trigger_event_e ckpSignalType, int index) { if (!ENGINE(isEngineChartEnabled)) { // this is here just as a shortcut so that we avoid engine sniffer as soon as possible return; // engineSnifferRpmThreshold is accounted for inside ENGINE(isEngineChartEnabled) } @@ -524,7 +524,7 @@ static void reportEventToWaveChart(trigger_event_e ckpSignalType, int index DECL */ bool TriggerNoiseFilter::noiseFilter(efitick_t nowNt, TriggerState * triggerState, - trigger_event_e signal DECLARE_ENGINE_PARAMETER_SUFFIX) { + trigger_event_e signal) { // todo: find a better place for these defs static const trigger_event_e opposite[6] = { SHAFT_PRIMARY_RISING, SHAFT_PRIMARY_FALLING, SHAFT_SECONDARY_RISING, SHAFT_SECONDARY_FALLING, SHAFT_3RD_RISING, SHAFT_3RD_FALLING }; @@ -582,7 +582,7 @@ bool TriggerNoiseFilter::noiseFilter(efitick_t nowNt, /** * This method is NOT invoked for VR falls. */ -void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { +void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timestamp) { if (triggerShape.shapeDefinitionError) { // trigger is broken, we cannot do anything here warning(CUSTOM_ERR_UNEXPECTED_SHAFT_EVENT, "Shaft event while trigger is mis-configured"); @@ -593,7 +593,7 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta // This code gathers some statistics on signals and compares accumulated periods to filter interference if (CONFIG(useNoiselessTriggerDecoder)) { - if (!noiseFilter.noiseFilter(timestamp, &triggerState, signal PASS_ENGINE_PARAMETER_SUFFIX)) { + if (!noiseFilter.noiseFilter(timestamp, &triggerState, signal)) { return; } if (!isUsefulSignal(signal, ENGINE(primaryTriggerConfiguration))) { @@ -623,14 +623,14 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta * If we only have a crank position sensor with four stroke, here we are extending crank revolutions with a 360 degree * cycle into a four stroke, 720 degrees cycle. */ - operation_mode_e operationMode = engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE); + operation_mode_e operationMode = engine->getOperationMode(); int crankDivider = getCrankDivider(operationMode); int crankInternalIndex = triggerState.getTotalRevolutionCounter() % crankDivider; int triggerIndexForListeners = triggerState.getCurrentIndex() + (crankInternalIndex * getTriggerSize()); if (triggerIndexForListeners == 0) { m_virtualZeroTimer.reset(timestamp); } - reportEventToWaveChart(signal, triggerIndexForListeners PASS_ENGINE_PARAMETER_SUFFIX); + reportEventToWaveChart(signal, triggerIndexForListeners); if (!triggerState.getShaftSynchronized()) { // we should not propagate event if we do not know where we are @@ -644,24 +644,24 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta efiPrintf("trigger %d %d %d", triggerIndexForListeners, getRevolutionCounter(), (int)getTimeNowUs()); #endif /* TRIGGER_EXTREME_LOGGING */ - rpmShaftPositionCallback(signal, triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + rpmShaftPositionCallback(signal, triggerIndexForListeners, timestamp); - tdcMarkCallback(triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + tdcMarkCallback(triggerIndexForListeners, timestamp); #if !EFI_UNIT_TEST #if EFI_MAP_AVERAGING - mapAveragingTriggerCallback(triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + mapAveragingTriggerCallback(triggerIndexForListeners, timestamp); #endif /* EFI_MAP_AVERAGING */ #endif /* EFI_UNIT_TEST */ #if EFI_LOGIC_ANALYZER - waTriggerEventListener(signal, triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + waTriggerEventListener(signal, triggerIndexForListeners, timestamp); #endif - mainTriggerCallback(triggerIndexForListeners, timestamp PASS_ENGINE_PARAMETER_SUFFIX); + mainTriggerCallback(triggerIndexForListeners, timestamp); #if EFI_TUNER_STUDIO - updateCurrentEnginePhase(PASS_ENGINE_PARAMETER_SIGNATURE); + updateCurrentEnginePhase(); #endif } } @@ -796,7 +796,7 @@ static void resetRunningTriggerCounters() { #endif } -void onConfigurationChangeTriggerCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void onConfigurationChangeTriggerCallback() { bool changed = false; // todo: how do we static_assert here? efiAssertVoid(OBD_PCM_Processor_Fault, efi::size(CONFIG(camInputs)) == efi::size(CONFIG(vvtOffsets)), "sizes"); @@ -832,7 +832,7 @@ void onConfigurationChangeTriggerCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { assertEngineReference(); #if EFI_ENGINE_CONTROL - ENGINE(initializeTriggerWaveform(PASS_ENGINE_PARAMETER_SIGNATURE)); + ENGINE(initializeTriggerWaveform()); engine->triggerCentral.noiseFilter.resetAccumSignalData(); #endif } @@ -847,17 +847,17 @@ void onConfigurationChangeTriggerCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * @returns true if configuration just changed, and if that change has affected trigger */ -bool TriggerCentral::checkIfTriggerConfigChanged(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +bool TriggerCentral::checkIfTriggerConfigChanged() { bool result = triggerVersion.isOld(engine->getGlobalConfigurationVersion()) && triggerConfigChanged; triggerConfigChanged = false; // whoever has called the method is supposed to react to changes return result; } -bool TriggerCentral::isTriggerConfigChanged(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +bool TriggerCentral::isTriggerConfigChanged() { return triggerConfigChanged; } -void validateTriggerInputs(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void validateTriggerInputs() { if (CONFIG(triggerInputPins[0]) == GPIO_UNASSIGNED && CONFIG(triggerInputPins[1]) != GPIO_UNASSIGNED) { firmwareError(OBD_PCM_Processor_Fault, "First trigger channel is missing"); } @@ -889,7 +889,7 @@ void initTriggerCentral() { /** * @return TRUE is something is wrong with trigger decoding */ -bool TriggerCentral::isTriggerDecoderError(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +bool TriggerCentral::isTriggerDecoderError() { return engine->triggerErrorDetection.sum(6) > 4; } diff --git a/firmware/controllers/trigger/trigger_central.h b/firmware/controllers/trigger/trigger_central.h index 8f6f228eb0..6d0a51a895 100644 --- a/firmware/controllers/trigger/trigger_central.h +++ b/firmware/controllers/trigger/trigger_central.h @@ -16,7 +16,7 @@ #include "local_version_holder.h" class Engine; -typedef void (*ShaftPositionListener)(trigger_event_e signal, uint32_t index, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX); +typedef void (*ShaftPositionListener)(trigger_event_e signal, uint32_t index, efitick_t edgeTimestamp); #define HAVE_CAM_INPUT() (isBrainPinValid(engineConfiguration->camInputs[0])) @@ -25,7 +25,7 @@ public: void resetAccumSignalData(); bool noiseFilter(efitick_t nowNt, TriggerState * triggerState, - trigger_event_e signal DECLARE_ENGINE_PARAMETER_SUFFIX); + trigger_event_e signal); efitick_t lastSignalTimes[HW_EVENT_TYPES]; efitick_t accumSignalPeriods[HW_EVENT_TYPES]; @@ -40,8 +40,8 @@ public: class TriggerCentral final : public trigger_central_s, public EnginePtr { public: TriggerCentral(); - void init(DECLARE_ENGINE_PARAMETER_SIGNATURE); - void handleShaftSignal(trigger_event_e signal, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX); + void init(); + void handleShaftSignal(trigger_event_e signal, efitick_t timestamp); int getHwEventCounter(int index) const; void resetCounters(); void validateCamVvtCounters(); @@ -53,10 +53,10 @@ public: bool triggerConfigChanged = false; LocalVersionHolder triggerVersion; - bool checkIfTriggerConfigChanged(DECLARE_ENGINE_PARAMETER_SIGNATURE); - bool isTriggerConfigChanged(DECLARE_ENGINE_PARAMETER_SIGNATURE); + bool checkIfTriggerConfigChanged(); + bool isTriggerConfigChanged(); - bool isTriggerDecoderError(DECLARE_ENGINE_PARAMETER_SIGNATURE); + bool isTriggerDecoderError(); expected getCurrentEnginePhase(efitick_t nowNt) const; @@ -106,17 +106,17 @@ private: }; void triggerInfo(void); -void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX); -void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX); -void hwHandleVvtCamSignal(trigger_value_e front, efitick_t timestamp, int index DECLARE_ENGINE_PARAMETER_SUFFIX); +void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp); +void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp); +void hwHandleVvtCamSignal(trigger_value_e front, efitick_t timestamp, int index); -void validateTriggerInputs(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void validateTriggerInputs(); void initTriggerCentral(); int isSignalDecoderError(void); -void onConfigurationChangeTriggerCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void onConfigurationChangeTriggerCallback(); #define SYMMETRICAL_CRANK_SENSOR_DIVIDER 4 #define SYMMETRICAL_THREE_TIMES_CRANK_SENSOR_DIVIDER 6 diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index e556679bc9..7bb87df178 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -124,8 +124,7 @@ void TriggerWaveform::initializeSyncPoint(TriggerState& state, */ void calculateTriggerSynchPoint( TriggerWaveform& shape, - TriggerState& state - DECLARE_ENGINE_PARAMETER_SUFFIX) { + TriggerState& state) { state.resetTriggerState(); #if EFI_PROD_CODE @@ -153,7 +152,7 @@ void calculateTriggerSynchPoint( } void prepareEventAngles(TriggerWaveform *shape, - TriggerFormDetails *details DECLARE_ENGINE_PARAMETER_SUFFIX) { + TriggerFormDetails *details) { int triggerShapeSynchPointIndex = shape->triggerShapeSynchPointIndex; if (triggerShapeSynchPointIndex == EFI_ERROR_CODE) { return; @@ -219,7 +218,7 @@ int TriggerState::getTotalRevolutionCounter() const { return totalRevolutionCounter; } -void TriggerStateWithRunningStatistics::movePreSynchTimestamps(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void TriggerStateWithRunningStatistics::movePreSynchTimestamps() { // here we take timestamps of events which happened prior to synchronization and place them // at appropriate locations auto triggerSize = getTriggerSize(); @@ -244,7 +243,7 @@ void TriggerStateWithRunningStatistics::movePreSynchTimestamps(DECLARE_ENGINE_PA float TriggerStateWithRunningStatistics::calculateInstantRpm( TriggerWaveform const & triggerShape, TriggerFormDetails *triggerFormDetails, - uint32_t current_index, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { + uint32_t current_index, efitick_t nowNt) { assertIsInBoundsWithResult((int)current_index, timeOfLastEvent, "calc timeOfLastEvent", 0); @@ -296,7 +295,7 @@ float TriggerStateWithRunningStatistics::calculateInstantRpm( return instantRpm; } -void TriggerStateWithRunningStatistics::setLastEventTimeForInstantRpm(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { +void TriggerStateWithRunningStatistics::setLastEventTimeForInstantRpm(efitick_t nowNt) { if (getShaftSynchronized()) { return; } @@ -312,10 +311,10 @@ void TriggerStateWithRunningStatistics::setLastEventTimeForInstantRpm(efitick_t void TriggerStateWithRunningStatistics::updateInstantRpm( TriggerWaveform const & triggerShape, TriggerFormDetails *triggerFormDetails, - uint32_t index, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX) { + uint32_t index, efitick_t nowNt) { m_instantRpm = calculateInstantRpm(triggerShape, triggerFormDetails, index, - nowNt PASS_ENGINE_PARAMETER_SUFFIX); + nowNt); #if EFI_SENSOR_CHART @@ -572,7 +571,7 @@ void TriggerState::decodeTriggerEvent( if (triggerConfiguration.VerboseTriggerSynchDetails || (someSortOfTriggerError && !silentTriggerError)) { int rpm = GET_RPM(); - floatms_t engineCycleDuration = getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX); + floatms_t engineCycleDuration = getEngineCycleDuration(rpm); if (!engineConfiguration->useOnlyRisingEdgeForTrigger) { int time = currentCycle.totalTimeNt[0]; efiPrintf("%s duty %f %d", diff --git a/firmware/controllers/trigger/trigger_decoder.h b/firmware/controllers/trigger/trigger_decoder.h index 71c641156e..f6a2f55f0b 100644 --- a/firmware/controllers/trigger/trigger_decoder.h +++ b/firmware/controllers/trigger/trigger_decoder.h @@ -195,23 +195,23 @@ public: * Stores last non-zero instant RPM value to fix early instability */ float prevInstantRpmValue = 0; - void movePreSynchTimestamps(DECLARE_ENGINE_PARAMETER_SIGNATURE); + void movePreSynchTimestamps(); #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT void updateInstantRpm( TriggerWaveform const & triggerShape, TriggerFormDetails *triggerFormDetails, - uint32_t index, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX); + uint32_t index, efitick_t nowNt); #endif /** * Update timeOfLastEvent[] on every trigger event - even without synchronization * Needed for early spin-up RPM detection. */ - void setLastEventTimeForInstantRpm(efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX); + void setLastEventTimeForInstantRpm(efitick_t nowNt); private: float calculateInstantRpm( TriggerWaveform const & triggerShape, TriggerFormDetails *triggerFormDetails, - uint32_t index, efitick_t nowNt DECLARE_ENGINE_PARAMETER_SUFFIX); + uint32_t index, efitick_t nowNt); float m_instantRpm = 0; float m_instantRpmRatio = 0; @@ -224,7 +224,6 @@ class Engine; void calculateTriggerSynchPoint( TriggerWaveform& shape, - TriggerState& state - DECLARE_ENGINE_PARAMETER_SUFFIX); + TriggerState& state); -void prepareEventAngles(TriggerWaveform *shape, TriggerFormDetails *details DECLARE_ENGINE_PARAMETER_SUFFIX); +void prepareEventAngles(TriggerWaveform *shape, TriggerFormDetails *details); diff --git a/firmware/controllers/trigger/trigger_emulator_algo.cpp b/firmware/controllers/trigger/trigger_emulator_algo.cpp index 2b4a2dfec2..ee217b51c3 100644 --- a/firmware/controllers/trigger/trigger_emulator_algo.cpp +++ b/firmware/controllers/trigger/trigger_emulator_algo.cpp @@ -39,7 +39,7 @@ TriggerEmulatorHelper::TriggerEmulatorHelper() { static OutputPin emulatorOutputs[PWM_PHASE_MAX_WAVE_PER_PWM]; -void TriggerEmulatorHelper::handleEmulatorCallback(const MultiChannelStateSequence& multiChannelStateSequence, int stateIndex DECLARE_ENGINE_PARAMETER_SUFFIX) { +void TriggerEmulatorHelper::handleEmulatorCallback(const MultiChannelStateSequence& multiChannelStateSequence, int stateIndex) { efitick_t stamp = getTimeNowNt(); // todo: code duplication with TriggerStimulatorHelper::feedSimulatedEvent? @@ -48,7 +48,7 @@ void TriggerEmulatorHelper::handleEmulatorCallback(const MultiChannelStateSequen if (needEvent(stateIndex, multiChannelStateSequence, i)) { pin_state_t currentValue = multiChannelStateSequence.getChannelState(/*phaseIndex*/i, stateIndex); - handleShaftSignal(i, currentValue, stamp PASS_ENGINE_PARAMETER_SUFFIX); + handleShaftSignal(i, currentValue, stamp); } } } @@ -80,7 +80,7 @@ static float getRpmMultiplier(operation_mode_e mode) { return 1; } -void setTriggerEmulatorRPM(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setTriggerEmulatorRPM(int rpm) { engineConfiguration->triggerSimulatorFrequency = rpm; /** * All we need to do here is to change the periodMs @@ -89,7 +89,7 @@ void setTriggerEmulatorRPM(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { if (rpm == 0) { triggerSignal.setFrequency(NAN); } else { - float rpmM = getRpmMultiplier(engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + float rpmM = getRpmMultiplier(engine->getOperationMode()); float rPerSecond = rpm * rpmM / 60.0; // per minute converted to per second triggerSignal.setFrequency(rPerSecond); } @@ -98,7 +98,7 @@ void setTriggerEmulatorRPM(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { efiPrintf("Emulating position sensor(s). RPM=%d", rpm); } -static void updateTriggerWaveformIfNeeded(PwmConfig *state DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void updateTriggerWaveformIfNeeded(PwmConfig *state) { if (atTriggerVersion < engine->triggerCentral.triggerShape.version) { atTriggerVersion = engine->triggerCentral.triggerShape.version; efiPrintf("Stimulator: updating trigger shape: %d/%d %d", atTriggerVersion, @@ -136,14 +136,14 @@ static void emulatorApplyPinState(int stateIndex, PwmConfig *state) /* pwm_gen_c #endif /* EFI_PROD_CODE */ } -static void initTriggerPwm(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void initTriggerPwm() { // No need to start more than once if (hasInitTriggerEmulator) { return; } TriggerWaveform *s = &engine->triggerCentral.triggerShape; - setTriggerEmulatorRPM(engineConfiguration->triggerSimulatorFrequency PASS_ENGINE_PARAMETER_SUFFIX); + setTriggerEmulatorRPM(engineConfiguration->triggerSimulatorFrequency); triggerSignal.weComplexInit("position sensor", &engine->executor, s->wave, @@ -168,7 +168,7 @@ void disableTriggerStimulator() { hasInitTriggerEmulator = false; } -void initTriggerEmulatorLogic(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initTriggerEmulatorLogic() { addConsoleActionI(CMD_RPM, setTriggerEmulatorRPM); } @@ -180,17 +180,17 @@ void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousCo setTriggerEmulatorRPM(engineConfiguration->triggerSimulatorFrequency); } -void initTriggerEmulator(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initTriggerEmulator() { efiPrintf("Emulating %s", getEngine_type_e(engineConfiguration->engineType)); - startTriggerEmulatorPins(PASS_ENGINE_PARAMETER_SIGNATURE); + startTriggerEmulatorPins(); - initTriggerEmulatorLogic(PASS_ENGINE_PARAMETER_SIGNATURE); + initTriggerEmulatorLogic(); } #endif /* EFI_UNIT_TEST */ -void startTriggerEmulatorPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void startTriggerEmulatorPins() { hasStimPins = false; for (size_t i = 0; i < efi::size(emulatorOutputs); i++) { triggerSignal.outputPins[i] = &emulatorOutputs[i]; diff --git a/firmware/controllers/trigger/trigger_emulator_algo.h b/firmware/controllers/trigger/trigger_emulator_algo.h index 9834a44f71..31788e6e7c 100644 --- a/firmware/controllers/trigger/trigger_emulator_algo.h +++ b/firmware/controllers/trigger/trigger_emulator_algo.h @@ -10,10 +10,10 @@ class PwmConfig; class MultiChannelStateSequence; -void initTriggerEmulator(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void startTriggerEmulatorPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initTriggerEmulator(); +void startTriggerEmulatorPins(); void stopTriggerEmulatorPins(); -void setTriggerEmulatorRPM(int value DECLARE_ENGINE_PARAMETER_SUFFIX); +void setTriggerEmulatorRPM(int value); void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousConfiguration); // Start & stop trigger emulation @@ -24,10 +24,10 @@ void disableTriggerStimulator(); class TriggerEmulatorHelper { public: TriggerEmulatorHelper(); - void handleEmulatorCallback(const MultiChannelStateSequence& mcss, int stateIndex DECLARE_ENGINE_PARAMETER_SUFFIX); + void handleEmulatorCallback(const MultiChannelStateSequence& mcss, int stateIndex); }; -void initTriggerEmulatorLogic(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initTriggerEmulatorLogic(); int getPreviousIndex(const int currentIndex, const int size); bool needEvent(const int currentIndex, const MultiChannelStateSequence& mcss, int channelIndex); diff --git a/firmware/development/engine_emulator.cpp b/firmware/development/engine_emulator.cpp index b4283cc30b..3481477a83 100644 --- a/firmware/development/engine_emulator.cpp +++ b/firmware/development/engine_emulator.cpp @@ -14,13 +14,13 @@ #include "poten.h" #include "trigger_emulator_algo.h" -void initEngineEmulator(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initEngineEmulator() { if (hasFirmwareError()) return; #if EFI_POTENTIOMETER && HAL_USE_SPI - initPotentiometers(PASS_ENGINE_PARAMETER_SIGNATURE); + initPotentiometers(); #endif /* EFI_POTENTIOMETER && HAL_USE_SPI*/ - initTriggerEmulator(PASS_ENGINE_PARAMETER_SIGNATURE); + initTriggerEmulator(); } diff --git a/firmware/development/engine_emulator.h b/firmware/development/engine_emulator.h index b7508121eb..f224886c77 100644 --- a/firmware/development/engine_emulator.h +++ b/firmware/development/engine_emulator.h @@ -8,5 +8,5 @@ #pragma once #include "engine_ptr.h" -void initEngineEmulator(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initEngineEmulator(); diff --git a/firmware/development/hw_layer/poten.cpp b/firmware/development/hw_layer/poten.cpp index 0361e34fd5..03dc05e8d1 100644 --- a/firmware/development/hw_layer/poten.cpp +++ b/firmware/development/hw_layer/poten.cpp @@ -87,7 +87,7 @@ static void setPotValue1(int value) { #endif /* EFI_POTENTIOMETER */ -void initPotentiometers(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initPotentiometers() { #if EFI_POTENTIOMETER if (CONFIG(digitalPotentiometerSpiDevice) == SPI_NONE) { efiPrintf("digiPot spi disabled"); diff --git a/firmware/development/hw_layer/poten.h b/firmware/development/hw_layer/poten.h index 435d0450f3..0758621b39 100644 --- a/firmware/development/hw_layer/poten.h +++ b/firmware/development/hw_layer/poten.h @@ -20,7 +20,7 @@ typedef struct { } Mcp42010Driver; //void initPotentiometer(Mcp42010Driver *driver, SPIDriver *spi, ioportid_t port, ioportmask_t pin); -void initPotentiometers(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initPotentiometers(); void setPotResistance(Mcp42010Driver *driver, int channel, int resistance); #endif diff --git a/firmware/development/logic_analyzer.cpp b/firmware/development/logic_analyzer.cpp index 57c3b5e781..1cb5c6ff4a 100644 --- a/firmware/development/logic_analyzer.cpp +++ b/firmware/development/logic_analyzer.cpp @@ -126,7 +126,7 @@ WaveReader::WaveReader() { hw = nullptr; } -void waTriggerEventListener(trigger_event_e ckpSignalType, uint32_t index, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX) { +void waTriggerEventListener(trigger_event_e ckpSignalType, uint32_t index, efitick_t edgeTimestamp) { (void)ckpSignalType; if (index != 0) { return; diff --git a/firmware/development/logic_analyzer.h b/firmware/development/logic_analyzer.h index edcc8a7d77..f248361703 100644 --- a/firmware/development/logic_analyzer.h +++ b/firmware/development/logic_analyzer.h @@ -57,7 +57,7 @@ void printWave(Logging *logging); void showWaveInfo(void); void reportLogicAnalyzerToTS(void); -void waTriggerEventListener(trigger_event_e ckpSignalType, uint32_t index, efitick_t edgeTimestamp DECLARE_ENGINE_PARAMETER_SUFFIX); +void waTriggerEventListener(trigger_event_e ckpSignalType, uint32_t index, efitick_t edgeTimestamp); #endif /* EFI_LOGIC_ANALYZER */ diff --git a/firmware/global.h b/firmware/global.h index 96ad6456a3..1a9d54df2e 100644 --- a/firmware/global.h +++ b/firmware/global.h @@ -5,9 +5,6 @@ * * Simulator and unit tests have their own version of this header * - * While this header contains 'EXTERN_ENGINE' and 'DECLARE_ENGINE_PARAMETER_SIGNATURE' magic, - * this header is not allowed to actually include higher-level engine related headers - * * @date May 27, 2013 * @author Andrey Belomutskiy, (c) 2012-2020 */ diff --git a/firmware/globalaccess.h b/firmware/globalaccess.h index 98a62609cb..34c3de0cf8 100644 --- a/firmware/globalaccess.h +++ b/firmware/globalaccess.h @@ -1,7 +1,5 @@ /* * @file globalaccess.h - * @bried version of global.h with DECLARE_ENGINE_PARAMETER_SIGNATURE & PASS_ENGINE_PARAMETER_SUFFIX - * * * unit_tests have a more meaningful version of this header * diff --git a/firmware/hw_layer/adc/adc_inputs.cpp b/firmware/hw_layer/adc/adc_inputs.cpp index 413ef78790..1683327421 100644 --- a/firmware/hw_layer/adc/adc_inputs.cpp +++ b/firmware/hw_layer/adc/adc_inputs.cpp @@ -40,12 +40,12 @@ static NO_CACHE adcsample_t fastAdcSampleBuf[ADC_BUF_DEPTH_FAST * ADC_MAX_CHANNE static adc_channel_mode_e adcHwChannelEnabled[HW_MAX_ADC_INDEX]; // Board voltage, with divider coefficient accounted for -float getVoltageDivided(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) { - return getVoltage(msg, hwChannel PASS_ENGINE_PARAMETER_SUFFIX) * engineConfiguration->analogInputDividerCoefficient; +float getVoltageDivided(const char *msg, adc_channel_e hwChannel) { + return getVoltage(msg, hwChannel) * engineConfiguration->analogInputDividerCoefficient; } // voltage in MCU universe, from zero to VDD -float getVoltage(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getVoltage(const char *msg, adc_channel_e hwChannel) { return adcToVolts(getAdcValue(msg, hwChannel)); } @@ -489,12 +489,12 @@ void printFullAdcReportIfNeeded(void) { #else /* not HAL_USE_ADC */ -__attribute__((weak)) float getVoltageDivided(const char*, adc_channel_e DECLARE_ENGINE_PARAMETER_SUFFIX) { +__attribute__((weak)) float getVoltageDivided(const char*, adc_channel_e) { return 0; } // voltage in MCU universe, from zero to VDD -__attribute__((weak)) float getVoltage(const char*, adc_channel_e DECLARE_ENGINE_PARAMETER_SUFFIX) { +__attribute__((weak)) float getVoltage(const char*, adc_channel_e) { return 0; } diff --git a/firmware/hw_layer/algo/adc_math.h b/firmware/hw_layer/algo/adc_math.h index 27ea354324..0886bc8d3b 100644 --- a/firmware/hw_layer/algo/adc_math.h +++ b/firmware/hw_layer/algo/adc_math.h @@ -21,7 +21,7 @@ #define voltsToAdc(volts) ((volts) * (ADC_MAX_VALUE / (engineConfiguration->adcVcc))) -float getVoltage(const char *msg, adc_channel_e channel DECLARE_ENGINE_PARAMETER_SUFFIX); +float getVoltage(const char *msg, adc_channel_e channel); -float getVoltageDivided(const char *msg, adc_channel_e channel DECLARE_ENGINE_PARAMETER_SUFFIX); +float getVoltageDivided(const char *msg, adc_channel_e channel); diff --git a/firmware/hw_layer/digital_input/trigger/trigger_input.cpp b/firmware/hw_layer/digital_input/trigger/trigger_input.cpp index 1d697f83c0..c5c9e7f9dc 100644 --- a/firmware/hw_layer/digital_input/trigger/trigger_input.cpp +++ b/firmware/hw_layer/digital_input/trigger/trigger_input.cpp @@ -131,7 +131,7 @@ static void turnOffTriggerInputPin(int index, bool isTriggerShaft) { /* Exported functions. */ /*==========================================================================*/ -void stopTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void stopTriggerInputPins() { for (int i = 0; i < TRIGGER_SUPPORTED_CHANNELS; i++) { if (isConfigurationChanged(triggerInputPins[i])) { turnOffTriggerInputPin(i, true); @@ -146,7 +146,7 @@ void stopTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { static const char* const camNames[] = { "cam1", "cam2", "cam3", "cam4"}; -void startTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void startTriggerInputPins() { for (int i = 0; i < TRIGGER_SUPPORTED_CHANNELS; i++) { if (isConfigurationChanged(triggerInputPins[i])) { const char * msg = (i == 0 ? "Trigger #1" : (i == 1 ? "Trigger #2" : "Trigger #3")); @@ -161,18 +161,18 @@ void startTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } } -void turnOnTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void turnOnTriggerInputPins() { /* init all trigger HW available */ icuTriggerTurnOnInputPins(); extiTriggerTurnOnInputPins(); - applyNewTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE); + applyNewTriggerInputPins(); } #endif /* (HAL_USE_ICU == TRUE) || (HAL_TRIGGER_USE_PAL == TRUE) */ -void stopTriggerDebugPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void stopTriggerDebugPins() { for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) { efiSetPadUnusedIfConfigurationChanged(triggerInputDebugPins[i]); } @@ -181,7 +181,7 @@ void stopTriggerDebugPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } } -void startTriggerDebugPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void startTriggerDebugPins() { for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) { efiSetPadModeIfConfigurationChanged("trigger debug", triggerInputDebugPins[i], PAL_MODE_OUTPUT_PUSHPULL); } @@ -190,12 +190,12 @@ void startTriggerDebugPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } } -void applyNewTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void applyNewTriggerInputPins() { #if EFI_PROD_CODE // first we will turn off all the changed pins - stopTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE); + stopTriggerInputPins(); // then we will enable all the changed pins - startTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE); + startTriggerInputPins(); #endif /* EFI_PROD_CODE */ } diff --git a/firmware/hw_layer/digital_input/trigger/trigger_input.h b/firmware/hw_layer/digital_input/trigger/trigger_input.h index 2e3e28d5eb..78fe98d7d5 100644 --- a/firmware/hw_layer/digital_input/trigger/trigger_input.h +++ b/firmware/hw_layer/digital_input/trigger/trigger_input.h @@ -25,13 +25,13 @@ #define TRIGGER_SUPPORTED_CHANNELS 2 -void turnOnTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void applyNewTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void startTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void stopTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void turnOnTriggerInputPins(); +void applyNewTriggerInputPins(); +void startTriggerInputPins(); +void stopTriggerInputPins(); -void stopTriggerDebugPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void startTriggerDebugPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void stopTriggerDebugPins(); +void startTriggerDebugPins(); #if HAL_TRIGGER_USE_ADC && HAL_USE_ADC // This detector has 2 modes for low-RPM (ADC) and fast-RPM (EXTI) diff --git a/firmware/hw_layer/digital_input/trigger/trigger_input_comp.cpp b/firmware/hw_layer/digital_input/trigger/trigger_input_comp.cpp index dc366ada8c..a91f1452ba 100644 --- a/firmware/hw_layer/digital_input/trigger/trigger_input_comp.cpp +++ b/firmware/hw_layer/digital_input/trigger/trigger_input_comp.cpp @@ -95,7 +95,7 @@ void turnOnTriggerInputPins() { applyNewTriggerInputPins(); } -static int getDacValue(uint8_t voltage DECLARE_ENGINE_PARAMETER_SUFFIX) { +static int getDacValue(uint8_t voltage) { constexpr float maxDacValue = 255.0f; // 8-bit DAC return (int)efiRound(maxDacValue * (float)voltage * VOLTAGE_1_BYTE_PACKING_DIV / CONFIG(adcVcc), 1.0f); } @@ -107,10 +107,10 @@ void startTriggerInputPins(void) { return; } - centeredDacValue = getDacValue(CONFIG(triggerCompCenterVolt) PASS_ENGINE_PARAMETER_SUFFIX); // usually 2.5V resistor divider + centeredDacValue = getDacValue(CONFIG(triggerCompCenterVolt)); // usually 2.5V resistor divider - dacHysteresisMin = getDacValue(CONFIG(triggerCompHystMin) PASS_ENGINE_PARAMETER_SUFFIX); // usually ~20mV - dacHysteresisMax = getDacValue(CONFIG(triggerCompHystMax) PASS_ENGINE_PARAMETER_SUFFIX); // usually ~300mV + dacHysteresisMin = getDacValue(CONFIG(triggerCompHystMin)); // usually ~20mV + dacHysteresisMax = getDacValue(CONFIG(triggerCompHystMax)); // usually ~300mV dacHysteresisDelta = dacHysteresisMin; // 20 rpm (60_2) = 1000*60/((2*60)*20) = 25 ms for 1 tooth event diff --git a/firmware/hw_layer/drivers/can/can_hw.cpp b/firmware/hw_layer/drivers/can/can_hw.cpp index 9ea6719c25..ec7b0fb6a8 100644 --- a/firmware/hw_layer/drivers/can/can_hw.cpp +++ b/firmware/hw_layer/drivers/can/can_hw.cpp @@ -190,19 +190,19 @@ void postCanState(TunerStudioOutputChannels *tsOutputChannels) { } #endif /* EFI_TUNER_STUDIO */ -void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void enableFrankensoCan() { CONFIG(canTxPin) = GPIOB_6; CONFIG(canRxPin) = GPIOB_12; engineConfiguration->canReadEnabled = false; } -void stopCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void stopCanPins() { efiSetPadUnusedIfConfigurationChanged(canTxPin); efiSetPadUnusedIfConfigurationChanged(canRxPin); } // at the moment we support only very limited runtime configuration change, still not supporting online CAN toggle -void startCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void startCanPins() { // nothing to do if we aren't enabled... if (!isCanEnabled) { return; diff --git a/firmware/hw_layer/drivers/can/can_hw.h b/firmware/hw_layer/drivers/can/can_hw.h index 223cb3fc69..7ef9980346 100644 --- a/firmware/hw_layer/drivers/can/can_hw.h +++ b/firmware/hw_layer/drivers/can/can_hw.h @@ -14,9 +14,9 @@ void setCanType(int type); void setCanVss(int type); #if EFI_CAN_SUPPORT -void stopCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void startCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void stopCanPins(); +void startCanPins(); +void enableFrankensoCan(); #if EFI_TUNER_STUDIO void postCanState(TunerStudioOutputChannels *tsOutputChannels); #endif /* EFI_TUNER_STUDIO */ diff --git a/firmware/hw_layer/drivers/lcd/HD44780.cpp b/firmware/hw_layer/drivers/lcd/HD44780.cpp index cf7736e8f0..e07ecdf5e8 100644 --- a/firmware/hw_layer/drivers/lcd/HD44780.cpp +++ b/firmware/hw_layer/drivers/lcd/HD44780.cpp @@ -173,7 +173,7 @@ void lcd_HD44780_print_string(const char* string) { } //getHwPin(CONFIG(HD44780_db7)) -static void lcdInfo(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void lcdInfo() { efiPrintf("HD44780 RS=%s", hwPortname(CONFIG(HD44780_rs))); efiPrintf("HD44780 E=%s", hwPortname(CONFIG(HD44780_e))); efiPrintf("HD44780 D4=%s", hwPortname(CONFIG(HD44780_db4))); diff --git a/firmware/hw_layer/drivers/serial/serial_hw.cpp b/firmware/hw_layer/drivers/serial/serial_hw.cpp index 095264f25e..98c12ca5dd 100644 --- a/firmware/hw_layer/drivers/serial/serial_hw.cpp +++ b/firmware/hw_layer/drivers/serial/serial_hw.cpp @@ -32,7 +32,7 @@ static void auxInfo() { efiPrintf("AUX Serial RX %s", hwPortname(CONFIG(auxSerialRxPin))); } -void enableAuxSerial(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void enableAuxSerial() { engineConfiguration->auxSerialTxPin = CONFIG(auxSerialTxPin); engineConfiguration->auxSerialRxPin = CONFIG(auxSerialRxPin); engineConfiguration->auxSerialSpeed = CONFIG(auxSerialSpeed); @@ -43,12 +43,12 @@ void enableAuxSerial(DECLARE_ENGINE_PARAMETER_SIGNATURE) { efiPrintf("AUX Serial started"); } -void stopAuxSerialPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void stopAuxSerialPins() { efiSetPadUnused(activeConfiguration.auxSerialTxPin); efiSetPadUnused(activeConfiguration.auxSerialRxPin); } -void startAuxSerialPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void startAuxSerialPins() { if (CONFIG(auxSerialTxPin)) efiSetPadMode("AuxSerial TX", CONFIG(auxSerialTxPin), PAL_MODE_ALTERNATE(8)); if (CONFIG(auxSerialRxPin)) diff --git a/firmware/hw_layer/drivers/serial/serial_hw.h b/firmware/hw_layer/drivers/serial/serial_hw.h index 1e756b0fc0..93289249f2 100644 --- a/firmware/hw_layer/drivers/serial/serial_hw.h +++ b/firmware/hw_layer/drivers/serial/serial_hw.h @@ -10,7 +10,7 @@ void initAuxSerial(void); #if EFI_AUX_SERIAL -void stopAuxSerialPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void startAuxSerialPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void enableAuxSerial(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void stopAuxSerialPins(); +void startAuxSerialPins(); +void enableAuxSerial(); #endif //EFI_AUX_SERIAL \ No newline at end of file diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 3007d8cea1..1193becdbb 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -183,7 +183,7 @@ void onFastAdcComplete(adcsample_t*) { #if EFI_SENSOR_CHART && EFI_SHAFT_POSITION_INPUT if (ENGINE(sensorChartMode) == SC_AUX_FAST1) { float voltage = getAdcValue("fAux1", engineConfiguration->auxFastSensor1_adcChannel); - scAddData(getCrankshaftAngleNt(getTimeNowNt() PASS_ENGINE_PARAMETER_SUFFIX), voltage); + scAddData(getCrankshaftAngleNt(getTimeNowNt()), voltage); } #endif /* EFI_SENSOR_CHART */ @@ -215,9 +215,9 @@ static void adcConfigListener(Engine *engine) { calcFastAdcIndexes(); } -static void turnOnHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void turnOnHardware() { #if EFI_PROD_CODE && EFI_SHAFT_POSITION_INPUT - turnOnTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE); + turnOnTriggerInputPins(); #endif /* EFI_SHAFT_POSITION_INPUT */ } @@ -238,7 +238,7 @@ void stopSpi(spi_device_e device) { * todo: maybe start invoking this method on ECU start so that peripheral start-up initialization and restart are unified? */ -void applyNewHardwareSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void applyNewHardwareSettings() { /** * All 'stop' methods need to go before we begin starting pins. * @@ -254,7 +254,7 @@ void applyNewHardwareSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif // EFI_PROD_CODE #if EFI_PROD_CODE && EFI_SHAFT_POSITION_INPUT - stopTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE); + stopTriggerInputPins(); #endif /* EFI_SHAFT_POSITION_INPUT */ @@ -274,7 +274,7 @@ void applyNewHardwareSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) { stopHip9001_pins(); #endif /* EFI_HIP_9011 */ - stopHardware(PASS_ENGINE_PARAMETER_SIGNATURE); + stopHardware(); if (isConfigurationChanged(is_enabled_spi_1)) { stopSpi(SPI_DEVICE_1); @@ -298,15 +298,15 @@ void applyNewHardwareSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) { if (isPinOrModeChanged(clutchUpPin, clutchUpPinMode)) { // bug? duplication with stopPedalPins? - efiSetPadUnused(activeConfiguration.clutchUpPin PASS_ENGINE_PARAMETER_SUFFIX); + efiSetPadUnused(activeConfiguration.clutchUpPin); } - stopTriggerDebugPins(PASS_ENGINE_PARAMETER_SIGNATURE); + stopTriggerDebugPins(); enginePins.unregisterPins(); #if EFI_PROD_CODE - reconfigureSensors(PASS_ENGINE_PARAMETER_SIGNATURE); + reconfigureSensors(); #endif /* EFI_PROD_CODE */ ButtonDebounce::startConfigurationList(); @@ -316,10 +316,10 @@ void applyNewHardwareSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) { ******************************************/ #if EFI_PROD_CODE && EFI_SHAFT_POSITION_INPUT - startTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE); + startTriggerInputPins(); #endif /* EFI_SHAFT_POSITION_INPUT */ - startHardware(PASS_ENGINE_PARAMETER_SIGNATURE); + startHardware(); #if EFI_HD44780_LCD startHD44780_pins(); @@ -353,7 +353,7 @@ void applyNewHardwareSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #if EFI_PROD_CODE && EFI_IDLE_CONTROL if (isIdleHardwareRestartNeeded()) { - initIdleHardware(PASS_ENGINE_PARAMETER_SIGNATURE); + initIdleHardware(); } #endif @@ -361,7 +361,7 @@ void applyNewHardwareSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) { startBoostPin(); #endif #if EFI_EMULATE_POSITION_SENSORS - startTriggerEmulatorPins(PASS_ENGINE_PARAMETER_SIGNATURE); + startTriggerEmulatorPins(); #endif /* EFI_EMULATE_POSITION_SENSORS */ #if EFI_LOGIC_ANALYZER startLogicAnalyzerPins(); @@ -386,7 +386,7 @@ void showBor(void) { #endif /* EFI_PROD_CODE */ // This function initializes hardware that can do so before configuration is loaded -void initHardwareNoConfig(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initHardwareNoConfig() { efiAssertVoid(CUSTOM_IH_STACK, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "init h"); efiAssertVoid(CUSTOM_EC_NULL, engineConfiguration!=NULL, "engineConfiguration"); @@ -411,7 +411,7 @@ void initHardwareNoConfig(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #if EFI_PROD_CODE // it's important to initialize this pretty early in the game before any scheduling usages - initSingleTimerExecutorHardware(PASS_ENGINE_PARAMETER_SIGNATURE); + initSingleTimerExecutorHardware(); initRtc(); #endif /* EFI_PROD_CODE */ @@ -430,8 +430,8 @@ void initHardwareNoConfig(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif // EFI_FILE_LOGGING } -void stopHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - stopPedalPins(PASS_ENGINE_PARAMETER_SIGNATURE); +void stopHardware() { + stopPedalPins(); #if EFI_PROD_CODE && (BOARD_EXT_GPIOCHIPS > 0) stopSmartCsPins(); @@ -453,23 +453,23 @@ void stopHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * This method is invoked both on ECU start and configuration change */ -void startHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void startHardware() { #if (HAL_USE_PAL && EFI_JOYSTICK) startJoystickPins(); #endif /* HAL_USE_PAL && EFI_JOYSTICK */ - validateTriggerInputs(PASS_ENGINE_PARAMETER_SIGNATURE); + validateTriggerInputs(); - startTriggerDebugPins(PASS_ENGINE_PARAMETER_SIGNATURE); + startTriggerDebugPins(); - startPedalPins(PASS_ENGINE_PARAMETER_SIGNATURE); + startPedalPins(); #if EFI_CAN_SUPPORT startCanPins(); #endif /* EFI_CAN_SUPPORT */ } -void initHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initHardware() { #if HAL_USE_PAL && EFI_PROD_CODE efiExtiInit(); #endif // HAL_USE_PAL @@ -504,11 +504,11 @@ void initHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #if EFI_PROD_CODE && (BOARD_EXT_GPIOCHIPS > 0) // initSmartGpio depends on 'initSpiModules' - initSmartGpio(PASS_ENGINE_PARAMETER_SIGNATURE); + initSmartGpio(); #endif // output pins potentially depend on 'initSmartGpio' - initOutputPins(PASS_ENGINE_PARAMETER_SIGNATURE); + initOutputPins(); #if EFI_ENGINE_CONTROL enginePins.startPins(); @@ -529,14 +529,14 @@ void initHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // init_adc_mcp3208(&adcState, &SPID2); // requestAdcValue(&adcState, 0); - turnOnHardware(PASS_ENGINE_PARAMETER_SIGNATURE); + turnOnHardware(); #if EFI_HIP_9011 initHip9011(); #endif /* EFI_HIP_9011 */ #if EFI_MEMS - initAccelerometer(PASS_ENGINE_PARAMETER_SIGNATURE); + initAccelerometer(); #endif #if EFI_BOSCH_YAW @@ -569,7 +569,7 @@ void initHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) { calcFastAdcIndexes(); - startHardware(PASS_ENGINE_PARAMETER_SIGNATURE); + startHardware(); efiPrintf("initHardware() OK!"); } diff --git a/firmware/hw_layer/hardware.h b/firmware/hw_layer/hardware.h index 85503ca676..d8ea2b52c9 100644 --- a/firmware/hw_layer/hardware.h +++ b/firmware/hw_layer/hardware.h @@ -7,8 +7,8 @@ #pragma once -void startHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void stopHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void startHardware(); +void stopHardware(); #if HAL_USE_SPI @@ -45,13 +45,13 @@ brain_pin_e getSckPin(spi_device_e device); #ifdef __cplusplus -void applyNewHardwareSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void applyNewHardwareSettings(); // Initialize hardware that doesn't require configuration to be loaded -void initHardwareNoConfig(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initHardwareNoConfig(); // Initialize hardware with configuration loaded -void initHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initHardware(); #if EFI_PROD_CODE #include "debounce.h" diff --git a/firmware/hw_layer/io_pins.cpp b/firmware/hw_layer/io_pins.cpp index 8c7bc9d9fa..2311c957b6 100644 --- a/firmware/hw_layer/io_pins.cpp +++ b/firmware/hw_layer/io_pins.cpp @@ -17,7 +17,7 @@ #include "console_io.h" #endif /* EFI_PROD_CODE */ -void efiSetPadUnused(brain_pin_e brainPin DECLARE_ENGINE_PARAMETER_SUFFIX) { +void efiSetPadUnused(brain_pin_e brainPin) { #if EFI_PROD_CODE /* input with pull up, is it safe? */ iomode_t mode = PAL_STM32_MODE_INPUT | PAL_STM32_PUPDR_PULLUP; @@ -39,19 +39,19 @@ void efiSetPadUnused(brain_pin_e brainPin DECLARE_ENGINE_PARAMETER_SUFFIX) { #endif #endif /* EFI_PROD_CODE */ - brain_pin_markUnused(brainPin PASS_ENGINE_PARAMETER_SUFFIX); + brain_pin_markUnused(brainPin); } /** * This method would set an error condition if pin is already used */ -void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode DECLARE_ENGINE_PARAMETER_SUFFIX) { +void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode) { if (!isBrainPinValid(brainPin)) { // No pin configured, nothing to do here. return; } - bool wasUsed = brain_pin_markUsed(brainPin, msg PASS_ENGINE_PARAMETER_SUFFIX); + bool wasUsed = brain_pin_markUsed(brainPin, msg); if (!wasUsed) { efiSetPadModeWithoutOwnershipAcquisition(msg, brainPin, mode); diff --git a/firmware/hw_layer/io_pins.h b/firmware/hw_layer/io_pins.h index fbe531632b..89ca80c52c 100644 --- a/firmware/hw_layer/io_pins.h +++ b/firmware/hw_layer/io_pins.h @@ -21,17 +21,17 @@ #define efiSetPadModeIfConfigurationChanged(msg, pin, mode) \ if (isConfigurationChanged(pin)) { \ - efiSetPadMode(msg, CONFIG(pin), mode PASS_ENGINE_PARAMETER_SUFFIX); \ + efiSetPadMode(msg, CONFIG(pin), mode); \ } #define efiSetPadUnusedIfConfigurationChanged(pin) \ if (isConfigurationChanged(pin)) { \ - efiSetPadUnused(activeConfiguration.pin PASS_ENGINE_PARAMETER_SUFFIX); \ + efiSetPadUnused(activeConfiguration.pin); \ } -EXTERNC void efiSetPadMode(const char *msg, brain_pin_e pin, iomode_t mode DECLARE_ENGINE_PARAMETER_SUFFIX); +EXTERNC void efiSetPadMode(const char *msg, brain_pin_e pin, iomode_t mode); EXTERNC void efiSetPadModeWithoutOwnershipAcquisition(const char *msg, brain_pin_e brainPin, iomode_t mode); -EXTERNC void efiSetPadUnused(brain_pin_e brainPin DECLARE_ENGINE_PARAMETER_SUFFIX); +EXTERNC void efiSetPadUnused(brain_pin_e brainPin); #if EFI_GPIO_HARDWARE EXTERNC bool efiReadPin(brain_pin_e pin); diff --git a/firmware/hw_layer/pin_repository.cpp b/firmware/hw_layer/pin_repository.cpp index 1388b6255a..32e939794f 100644 --- a/firmware/hw_layer/pin_repository.cpp +++ b/firmware/hw_layer/pin_repository.cpp @@ -15,7 +15,7 @@ unsigned int getBrainPinTotalNum(void) { return BRAIN_PIN_TOTAL_PINS; } -const char* & getBrainUsedPin(unsigned int idx DECLARE_ENGINE_PARAMETER_SUFFIX) { +const char* & getBrainUsedPin(unsigned int idx) { /*if (idx >= getBrainPinTotalNum()) return NULL;*/ return ENGINE(pinRepository).PIN_USED[idx]; @@ -53,7 +53,7 @@ int brainPin_to_index(brain_pin_e brainPin) { * @return true if this pin was already used, false otherwise */ -bool brain_pin_markUsed(brain_pin_e brainPin, const char *msg DECLARE_ENGINE_PARAMETER_SUFFIX) { +bool brain_pin_markUsed(brain_pin_e brainPin, const char *msg) { #if ! EFI_BOOTLOADER efiPrintf("%s on %s", msg, hwPortname(brainPin)); #endif @@ -62,17 +62,17 @@ bool brain_pin_markUsed(brain_pin_e brainPin, const char *msg DECLARE_ENGINE_PAR if (index < 0) return true; - if (getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX) != NULL) { + if (getBrainUsedPin(index) != NULL) { /* TODO: get readable name of brainPin... */ firmwareError(CUSTOM_ERR_PIN_ALREADY_USED_1, "Pin \"%s\" required by \"%s\" but is used by \"%s\" %s", hwPortname(brainPin), msg, - getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX), + getBrainUsedPin(index), getEngine_type_e(engineConfiguration->engineType)); return true; } - getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX) = msg; + getBrainUsedPin(index) = msg; ENGINE(pinRepository).totalPinsUsed++; return false; } @@ -81,14 +81,14 @@ bool brain_pin_markUsed(brain_pin_e brainPin, const char *msg DECLARE_ENGINE_PAR * See also brain_pin_markUsed() */ -void brain_pin_markUnused(brain_pin_e brainPin DECLARE_ENGINE_PARAMETER_SUFFIX) { +void brain_pin_markUnused(brain_pin_e brainPin) { int index = brainPin_to_index(brainPin); if (index < 0) return; - if (getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX) != nullptr) + if (getBrainUsedPin(index) != nullptr) ENGINE(pinRepository).totalPinsUsed--; - getBrainUsedPin(index PASS_ENGINE_PARAMETER_SUFFIX) = nullptr; + getBrainUsedPin(index) = nullptr; } #if EFI_PROD_CODE diff --git a/firmware/hw_layer/pin_repository.h b/firmware/hw_layer/pin_repository.h index 68ef531122..511c2902b5 100644 --- a/firmware/hw_layer/pin_repository.h +++ b/firmware/hw_layer/pin_repository.h @@ -37,11 +37,11 @@ EXTERNC bool brain_pin_is_ext(brain_pin_e brainPin); /** * Usually high-level code would invoke efiSetPadMode, not this method directly */ -EXTERNC bool brain_pin_markUsed(brain_pin_e brainPin, const char *msg DECLARE_ENGINE_PARAMETER_SUFFIX); +EXTERNC bool brain_pin_markUsed(brain_pin_e brainPin, const char *msg); /** * See also efiSetPadUnused */ -EXTERNC void brain_pin_markUnused(brain_pin_e brainPin DECLARE_ENGINE_PARAMETER_SUFFIX); +EXTERNC void brain_pin_markUnused(brain_pin_e brainPin); const char * getPinFunction(brain_input_pin_e brainPin); #if EFI_PROD_CODE @@ -59,6 +59,6 @@ unsigned int getBrainPinOnchipNum(void); unsigned int getBrainPinTotalNum(void); #ifdef __cplusplus -const char* & getBrainUsedPin(unsigned int idx DECLARE_ENGINE_PARAMETER_SUFFIX); +const char* & getBrainUsedPin(unsigned int idx); #endif diff --git a/firmware/hw_layer/sensors/accelerometer.cpp b/firmware/hw_layer/sensors/accelerometer.cpp index 256b5e0622..ea36d960ab 100644 --- a/firmware/hw_layer/sensors/accelerometer.cpp +++ b/firmware/hw_layer/sensors/accelerometer.cpp @@ -44,7 +44,7 @@ static const SPIConfig accelerometerCfg = { }; #endif /* EFI_MEMS */ -void configureAccelerometerPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void configureAccelerometerPins() { // engineConfiguration->LIS302DLCsPin = GPIOE_3; // we have a conflict with VVT output on Miata // CONFIG(is_enabled_spi_1) = true; // we have a conflict with PA5 input pin @@ -74,7 +74,7 @@ private: static BenchController instance; -void initAccelerometer(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initAccelerometer() { if (!isBrainPinValid(engineConfiguration->LIS302DLCsPin)) return; // not used @@ -108,10 +108,10 @@ void initAccelerometer(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif /* EFI_MEMS */ -float getLongitudinalAcceleration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getLongitudinalAcceleration() { return engine->sensors.accelerometer.x; } -float getTransverseAcceleration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float getTransverseAcceleration() { return engine->sensors.accelerometer.y; } diff --git a/firmware/hw_layer/sensors/accelerometer.h b/firmware/hw_layer/sensors/accelerometer.h index 14c299508e..d7fdc94140 100644 --- a/firmware/hw_layer/sensors/accelerometer.h +++ b/firmware/hw_layer/sensors/accelerometer.h @@ -7,16 +7,16 @@ #pragma once -void configureAccelerometerPins(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void configureAccelerometerPins(); -void initAccelerometer(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initAccelerometer(); /** * Acceleration/braking */ -float getLongitudinalAcceleration(DECLARE_ENGINE_PARAMETER_SIGNATURE); +float getLongitudinalAcceleration(); /** * Turns */ -float getTransverseAcceleration(DECLARE_ENGINE_PARAMETER_SIGNATURE); +float getTransverseAcceleration(); diff --git a/firmware/hw_layer/sensors/cj125.cpp b/firmware/hw_layer/sensors/cj125.cpp index 2c9922e4fe..73dbc57b95 100644 --- a/firmware/hw_layer/sensors/cj125.cpp +++ b/firmware/hw_layer/sensors/cj125.cpp @@ -118,10 +118,10 @@ static float getUr() { #if EFI_PROD_CODE if (!engineConfiguration->cj125isUrDivided) { // in case of directly connected Ur signal from CJ125 to the ADC pin of MCU - return getVoltage("cj125ur", CONFIG(cj125ur) PASS_ENGINE_PARAMETER_SUFFIX); + return getVoltage("cj125ur", CONFIG(cj125ur)); } else { // if a standard voltage division scheme with OpAmp is used - return getVoltageDivided("cj125ur", CONFIG(cj125ur) PASS_ENGINE_PARAMETER_SUFFIX); + return getVoltageDivided("cj125ur", CONFIG(cj125ur)); } #endif /* EFI_PROD_CODE */ } @@ -136,7 +136,7 @@ static float getUa() { if (isAdcChannelValid(CONFIG(cj125ua))) { #if EFI_PROD_CODE if (engineConfiguration->cj125isUaDivided) { - return getVoltageDivided("cj125ua", CONFIG(cj125ua) PASS_ENGINE_PARAMETER_SUFFIX); + return getVoltageDivided("cj125ua", CONFIG(cj125ua)); } else { return getVoltage("cj125ua", CONFIG(cj125ua)); } @@ -273,8 +273,8 @@ static void cjUpdateAnalogValues() { #endif /* EFI_PROD_CODE */ } -void CJ125::calibrate(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - cjIdentify(PASS_ENGINE_PARAMETER_SIGNATURE); +void CJ125::calibrate() { + cjIdentify(); efiPrintf("cj125: Starting calibration..."); cjSetMode(CJ125_MODE_CALIBRATION); @@ -332,13 +332,13 @@ void CJ125::calibrate(DECLARE_ENGINE_PARAMETER_SIGNATURE) { state = CJ125_IDLE; } -static void cjStart(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void cjStart() { if (!CONFIG(isCJ125Enabled)) { efiPrintf("cj125 is disabled."); return; } - globalInstance.cjIdentify(PASS_ENGINE_PARAMETER_SIGNATURE); + globalInstance.cjIdentify(); // Load calibration values #if EFI_PROD_CODE @@ -353,7 +353,7 @@ static void cjStart(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * open question if we need special considerations for calibration. Some controllers insist on open air calibration */ - globalInstance.calibrate(PASS_ENGINE_PARAMETER_SIGNATURE); + globalInstance.calibrate(); } else { efiPrintf("cj125: Loading stored calibration data (%d %d)", storedLambda, storedHeater); globalInstance.vUaCal = getVoltageFrom16bit(storedLambda); @@ -369,18 +369,18 @@ static void cjStart(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif } -void CJ125::setError(cj125_error_e errCode DECLARE_ENGINE_PARAMETER_SUFFIX) { +void CJ125::setError(cj125_error_e errCode) { errorCode = errCode; state = CJ125_ERROR; cjPrintErrorCode(errorCode); // This is for safety: efiPrintf("cj125: Controller Shutdown!"); - SetHeater(0 PASS_ENGINE_PARAMETER_SUFFIX); + SetHeater(0); // Software-reset of CJ125 cjWriteRegister(INIT_REG2_WR, CJ125_INIT2_RESET); } -static bool cjStartSpi(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static bool cjStartSpi() { #if HAL_USE_SPI globalInstance.cj125Cs.initPin("cj125 CS", CONFIG(cj125CsPin), &engineConfiguration->cj125CsPinMode); @@ -405,7 +405,7 @@ static bool cjStartSpi(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /** * @return true if currently in IDLE or ERROR state */ -static bool cj125periodic(CJ125 *instance DECLARE_ENGINE_PARAMETER_SUFFIX) { +static bool cj125periodic(CJ125 *instance) { { efitick_t nowNt = getTimeNowNt(); bool isStopped = engine->rpmCalculator.isStopped(); @@ -418,7 +418,7 @@ static bool cj125periodic(CJ125 *instance DECLARE_ENGINE_PARAMETER_SUFFIX) { } if (instance->state == CJ125_CALIBRATION) { - globalInstance.calibrate(PASS_ENGINE_PARAMETER_SIGNATURE); + globalInstance.calibrate(); // Start normal operation instance->state = CJ125_INIT; globalInstance.cjSetMode(CJ125_MODE_NORMAL_17); @@ -446,7 +446,7 @@ static bool cj125periodic(CJ125 *instance DECLARE_ENGINE_PARAMETER_SUFFIX) { if (isStopped && instance->isWorkingState()) { instance->state = CJ125_INIT; - instance->SetIdleHeater(PASS_ENGINE_PARAMETER_SIGNATURE); + instance->SetIdleHeater(); } #if 0 @@ -461,10 +461,10 @@ static bool cj125periodic(CJ125 *instance DECLARE_ENGINE_PARAMETER_SUFFIX) { float periodSecs = (float)(nowNt - instance->prevNt) / NT_PER_SECOND; // maintain speed at ~0.4V/sec float preheatDuty = instance->heaterDuty + periodSecs * CJ125_HEATER_PREHEAT_RATE; - instance->SetHeater(preheatDuty PASS_ENGINE_PARAMETER_SUFFIX); + instance->SetHeater(preheatDuty); // If we are heating too long, and there's still no result, then something is wrong... if (nowNt - instance->startHeatingNt > NT_PER_SECOND * CJ125_PREHEAT_TIMEOUT) { - instance->setError(CJ125_ERROR_HEATER_MALFUNCTION PASS_ENGINE_PARAMETER_SUFFIX); + instance->setError(CJ125_ERROR_HEATER_MALFUNCTION); } cjPrintData(); instance->prevNt = nowNt; @@ -479,7 +479,7 @@ static bool cj125periodic(CJ125 *instance DECLARE_ENGINE_PARAMETER_SUFFIX) { * So the simple trick is to inverse the error by swapping the target and input values. */ float duty = globalInstance.heaterPid.getOutput(globalInstance.vUr, globalInstance.vUrCal, MS2SEC(CJ125_TICK_DELAY)); - instance->SetHeater(duty PASS_ENGINE_PARAMETER_SUFFIX); + instance->SetHeater(duty); if (engineConfiguration->isCJ125Verbose) { globalInstance.heaterPid.showPidStatus("cj heater"); cjPrintData(); @@ -489,7 +489,7 @@ static bool cj125periodic(CJ125 *instance DECLARE_ENGINE_PARAMETER_SUFFIX) { break; case CJ125_OVERHEAT: if (nowNt - instance->prevNt >= CJ125_HEATER_OVERHEAT_PERIOD) { - instance->setError(CJ125_ERROR_OVERHEAT PASS_ENGINE_PARAMETER_SUFFIX); + instance->setError(CJ125_ERROR_OVERHEAT); instance->prevNt = nowNt; } default: @@ -510,7 +510,7 @@ static msg_t cjThread() globalInstance.startHeatingNt = 0; globalInstance.prevNt = getTimeNowNt(); while (1) { - bool needIdleSleep = cj125periodic(&globalInstance PASS_ENGINE_PARAMETER_SUFFIX); + bool needIdleSleep = cj125periodic(&globalInstance); chThdSleepMilliseconds(needIdleSleep ? CJ125_IDLE_TICK_DELAY : CJ125_TICK_DELAY); } return -1; @@ -541,7 +541,7 @@ void cjRestart(void) { globalInstance.state = CJ125_INIT; globalInstance.errorCode = CJ125_NO_ERROR; cjInfo(); - cjStart(PASS_ENGINE_PARAMETER_SIGNATURE); + cjStart(); } #endif /* EFI_UNIT_TEST */ @@ -560,7 +560,7 @@ static void cjSetInit2(int v) { } #endif /* CJ125_DEBUG */ -float cjGetAfr(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +float cjGetAfr() { // See CJ125 datasheet, page 6 float pumpCurrent = (globalInstance.vUa - globalInstance.vUaCal) * globalInstance.amplCoeff * (CJ125_PUMP_CURRENT_FACTOR / CJ125_PUMP_SHUNT_RESISTOR); @@ -574,7 +574,7 @@ float cjGetAfr(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return globalInstance.lambda * CJ125_STOICH_RATIO; } -bool cjHasAfrSensor(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +bool cjHasAfrSensor() { if (!CONFIG(isCJ125Enabled)) return false; return globalInstance.isValidState(); @@ -595,7 +595,7 @@ void cjPostState(TunerStudioOutputChannels *tsOutputChannels) { } #endif /* EFI_TUNER_STUDIO */ -void initCJ125(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initCJ125() { globalInstance.spi = &spi; if (!CONFIG(isCJ125Enabled)) { @@ -617,12 +617,12 @@ void initCJ125(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return; } - globalInstance.cjInitPid(PASS_ENGINE_PARAMETER_SIGNATURE); - if (!cjStartSpi(PASS_ENGINE_PARAMETER_SIGNATURE)) + globalInstance.cjInitPid(); + if (!cjStartSpi()) return; efiPrintf("cj125: Starting heater control"); - globalInstance.StartHeaterControl(PASS_ENGINE_PARAMETER_SIGNATURE); - cjStart(PASS_ENGINE_PARAMETER_SIGNATURE); + globalInstance.StartHeaterControl(); + cjStart(); #ifdef CJ125_DEBUG // addConsoleActionF("cj125_heater", cjConsoleSetHeater); @@ -650,7 +650,7 @@ void initCJ125(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // CONFIG(cj125CsPin) = GPIOA_15; // engineConfiguration->cj125CsPinMode = OM_OPENDRAIN; -void cj125defaultPinout(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void cj125defaultPinout() { engineConfiguration->cj125ua = EFI_ADC_13; // PC3 engineConfiguration->cj125ur = EFI_ADC_4; // PA4 CONFIG(wboHeaterPin) = GPIOC_13; diff --git a/firmware/hw_layer/sensors/cj125.h b/firmware/hw_layer/sensors/cj125.h index ed6ce74fdd..2f864f6e9c 100644 --- a/firmware/hw_layer/sensors/cj125.h +++ b/firmware/hw_layer/sensors/cj125.h @@ -102,10 +102,10 @@ void cjPostState(TunerStudioOutputChannels *tsOutputChannels); #endif /* EFI_TUNER_STUDIO */ -void initCJ125(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initCJ125(); void cjRestart(void); void cjStartCalibration(void); -float cjGetAfr(DECLARE_ENGINE_PARAMETER_SIGNATURE); -bool cjHasAfrSensor(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void cj125defaultPinout(DECLARE_CONFIG_PARAMETER_SIGNATURE); +float cjGetAfr(); +bool cjHasAfrSensor(); +void cj125defaultPinout(); diff --git a/firmware/hw_layer/sensors/cj125_logic.cpp b/firmware/hw_layer/sensors/cj125_logic.cpp index dcf3070a86..8e2f50b0ba 100644 --- a/firmware/hw_layer/sensors/cj125_logic.cpp +++ b/firmware/hw_layer/sensors/cj125_logic.cpp @@ -14,7 +14,7 @@ CJ125::CJ125() : wboHeaterControl("wbo"), heaterPid(&heaterPidConfig) { } -void CJ125::SetHeater(float value DECLARE_ENGINE_PARAMETER_SUFFIX) { +void CJ125::SetHeater(float value) { // limit duty cycle for sensor safety // todo: would be much nicer to have continuous function (vBatt) float maxDuty = (Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE) > CJ125_HEATER_LIMITING_VOLTAGE) ? CJ125_HEATER_LIMITING_RATE : 1.0f; @@ -29,22 +29,22 @@ void CJ125::SetHeater(float value DECLARE_ENGINE_PARAMETER_SUFFIX) { wboHeaterControl.setSimplePwmDutyCycle(heaterDuty); } -void CJ125::SetIdleHeater(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void CJ125::SetIdleHeater() { // small preheat for faster start & moisture anti-shock therapy for the sensor - SetHeater(CJ125_HEATER_IDLE_RATE PASS_ENGINE_PARAMETER_SUFFIX); + SetHeater(CJ125_HEATER_IDLE_RATE); } bool CJ125::isWorkingState(void) const { return state != CJ125_ERROR && state != CJ125_INIT && state != CJ125_IDLE; } -void CJ125::StartHeaterControl(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void CJ125::StartHeaterControl() { // todo: use custom pin state method, turn pin off while not running startSimplePwmExt(&wboHeaterControl, "wboHeaterPin", &engine->executor, CONFIG(wboHeaterPin), &wboHeaterPin, CJ125_HEATER_PWM_FREQ, 0.0f); - SetIdleHeater(PASS_ENGINE_PARAMETER_SIGNATURE); + SetIdleHeater(); } static void printDiagCode(const char *msg, int code, const char *code1message) { @@ -83,7 +83,7 @@ void CJ125::printDiag() { * @return true in case of positive SPI identification * false in case of unexpected SPI response */ -bool CJ125::cjIdentify(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +bool CJ125::cjIdentify() { efiAssert(OBD_PCM_Processor_Fault, spi!= NULL, "No SPI pointer", false); // read Ident register int ident = spi->ReadRegister(IDENT_REG_RD) & CJ125_IDENT_MASK; @@ -99,12 +99,12 @@ bool CJ125::cjIdentify(DECLARE_ENGINE_PARAMETER_SIGNATURE) { efiPrintf("cj125: Check ident=0x%x diag=0x%x init1=0x%x init2=0x%x", ident, diag, init1, init2); if (ident != CJ125_IDENT) { efiPrintf("cj125: Error! Wrong ident! Cannot communicate with CJ125!"); - setError(CJ125_ERROR_WRONG_IDENT PASS_ENGINE_PARAMETER_SUFFIX); + setError(CJ125_ERROR_WRONG_IDENT); return false; } if (init1 != CJ125_INIT1_NORMAL_17 || init2 != CJ125_INIT2_DIAG) { efiPrintf("cj125: Error! Cannot set init registers! Cannot communicate with CJ125!"); - setError(CJ125_ERROR_WRONG_IDENT PASS_ENGINE_PARAMETER_SUFFIX); + setError(CJ125_ERROR_WRONG_IDENT); return false; } printDiag(); @@ -146,7 +146,7 @@ bool CJ125::isValidState() const { return true; } -void CJ125::cjInitPid(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void CJ125::cjInitPid() { if (engineConfiguration->cj125isLsu49) { heaterPidConfig.pFactor = CJ125_PID_LSU49_P; heaterPidConfig.iFactor = CJ125_PID_LSU49_I; diff --git a/firmware/hw_layer/sensors/cj125_logic.h b/firmware/hw_layer/sensors/cj125_logic.h index 95cf97bfa7..9b448c8d9b 100644 --- a/firmware/hw_layer/sensors/cj125_logic.h +++ b/firmware/hw_layer/sensors/cj125_logic.h @@ -95,17 +95,17 @@ public: // Last Error code volatile cj125_error_e errorCode = CJ125_NO_ERROR; - void setError(cj125_error_e errCode DECLARE_ENGINE_PARAMETER_SUFFIX); + void setError(cj125_error_e errCode); bool isWorkingState(void) const; - void SetHeater(float value DECLARE_ENGINE_PARAMETER_SUFFIX); - void SetIdleHeater(DECLARE_ENGINE_PARAMETER_SIGNATURE); - void StartHeaterControl(DECLARE_ENGINE_PARAMETER_SIGNATURE); - bool cjIdentify(DECLARE_ENGINE_PARAMETER_SIGNATURE); + void SetHeater(float value); + void SetIdleHeater(); + void StartHeaterControl(); + bool cjIdentify(); void printDiag(); - void calibrate(DECLARE_ENGINE_PARAMETER_SIGNATURE); + void calibrate(); void cjSetMode(cj125_mode_e m); bool isValidState() const; - void cjInitPid(DECLARE_ENGINE_PARAMETER_SIGNATURE); + void cjInitPid(); }; // Heater params for Idle(cold), Preheating and Control stages diff --git a/firmware/hw_layer/sensors/gps_uart.cpp b/firmware/hw_layer/sensors/gps_uart.cpp index fe34f70a67..8433cb7e59 100644 --- a/firmware/hw_layer/sensors/gps_uart.cpp +++ b/firmware/hw_layer/sensors/gps_uart.cpp @@ -40,7 +40,7 @@ float getCurrentSpeed(void) { return GPSdata.speed; } -static void printGpsInfo(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void printGpsInfo() { efiPrintf("GPS RX %s", hwPortname(CONFIG(gps_rx_pin))); efiPrintf("GPS TX %s", hwPortname(CONFIG(gps_tx_pin))); diff --git a/firmware/hw_layer/sensors/hip9011_logic.cpp b/firmware/hw_layer/sensors/hip9011_logic.cpp index 486a1b46f4..2a1b5d25a0 100644 --- a/firmware/hw_layer/sensors/hip9011_logic.cpp +++ b/firmware/hw_layer/sensors/hip9011_logic.cpp @@ -200,7 +200,7 @@ int HIP9011::handleChannel(DEFINE_HIP_PARAMS) { /* find next firing cylinder */ /* MAGIC +1 -1, couse getNextFiringCylinderId expect cylinders to start from 1 */ - expectedCylinderNumber = getNextFiringCylinderId((cylinderNumber + 1) PASS_ENGINE_PARAMETER_SUFFIX) - 1; + expectedCylinderNumber = getNextFiringCylinderId((cylinderNumber + 1)) - 1; int nextChannelIdx = cylinderToChannelIdx(expectedCylinderNumber); if (nextChannelIdx == channelIdx) @@ -225,7 +225,7 @@ int HIP9011::readValueAndHandleChannel(DEFINE_HIP_PARAMS) { /* find next firing cylinder */ /* MAGIC +1 -1, couse getNextFiringCylinderId expect cylinders to start from 1 */ - expectedCylinderNumber = getNextFiringCylinderId((cylinderNumber + 1) PASS_ENGINE_PARAMETER_SUFFIX) - 1; + expectedCylinderNumber = getNextFiringCylinderId((cylinderNumber + 1)) - 1; int nextChannelIdx = cylinderToChannelIdx(expectedCylinderNumber); diff --git a/firmware/hw_layer/trigger_input_adc.cpp b/firmware/hw_layer/trigger_input_adc.cpp index e9b58eab69..ed243d274f 100644 --- a/firmware/hw_layer/trigger_input_adc.cpp +++ b/firmware/hw_layer/trigger_input_adc.cpp @@ -169,7 +169,7 @@ void turnOnTriggerInputPins() { } #if 0 -static int getDacValue(uint8_t voltage DECLARE_ENGINE_PARAMETER_SUFFIX) { +static int getDacValue(uint8_t voltage) { constexpr float maxDacValue = 255.0f; // 8-bit DAC return (int)efiRound(maxDacValue * (float)voltage * VOLTAGE_1_BYTE_PACKING_DIV / CONFIG(adcVcc), 1.0f); } @@ -213,10 +213,10 @@ static int turnOnTriggerInputPin(const char *msg, int index, bool isTriggerShaft if (!isBrainPinValid(brainPin)) return 0; #if 0 - centeredDacValue = getDacValue(CONFIG(triggerCompCenterVolt) PASS_ENGINE_PARAMETER_SUFFIX); // usually 2.5V resistor divider + centeredDacValue = getDacValue(CONFIG(triggerCompCenterVolt)); // usually 2.5V resistor divider - dacHysteresisMin = getDacValue(CONFIG(triggerCompHystMin) PASS_ENGINE_PARAMETER_SUFFIX); // usually ~20mV - dacHysteresisMax = getDacValue(CONFIG(triggerCompHystMax) PASS_ENGINE_PARAMETER_SUFFIX); // usually ~300mV + dacHysteresisMin = getDacValue(CONFIG(triggerCompHystMin)); // usually ~20mV + dacHysteresisMax = getDacValue(CONFIG(triggerCompHystMax)); // usually ~300mV dacHysteresisDelta = dacHysteresisMin; // 20 rpm (60_2) = 1000*60/((2*60)*20) = 25 ms for 1 tooth event diff --git a/firmware/init/init.h b/firmware/init/init.h index 36a118449a..c2e9a5d41d 100644 --- a/firmware/init/init.h +++ b/firmware/init/init.h @@ -7,32 +7,32 @@ #include "engine_ptr.h" // Call this once at startup to initialize, configure, and subscribe sensors -void initNewSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initNewSensors(); -void stopSensors(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void stopSensors(); // Call this whenever the configuration may have changed, so any sensors // can be reconfigured with the new settings. // Note: this may not be necessarily possible for all sensors, so some may // do nothing when this is called. -void reconfigureSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void reconfigureSensors(); // Internal init functions for individual systems // Sensor init/config -void initVbatt(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void initMaf(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void initMap(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void initTps(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void initOilPressure(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void initThermistors(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void initVbatt(); +void initMaf(); +void initMap(); +void initTps(); +void initOilPressure(); +void initThermistors(); void initCanSensors(); -void initLambda(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void initFlexSensor(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void initFuelLevel(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void initBaro(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void initAuxSensors(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void initVehicleSpeedSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE); -void initTurbochargerSpeedSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE); +void initLambda(); +void initFlexSensor(); +void initFuelLevel(); +void initBaro(); +void initAuxSensors(); +void initVehicleSpeedSensor(); +void initTurbochargerSpeedSensor(); // Sensor reconfiguration void deinitVbatt(); diff --git a/firmware/init/sensor/init_aux.cpp b/firmware/init/sensor/init_aux.cpp index 231b433151..ce88d47184 100644 --- a/firmware/init/sensor/init_aux.cpp +++ b/firmware/init/sensor/init_aux.cpp @@ -20,7 +20,7 @@ static FunctionalSensor auxSensors[] = { static_assert(efi::size(auxSensors) == AUX_ANALOG_INPUT_COUNT); -void initAuxSensors(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void initAuxSensors() { for (size_t i = 0; i < efi::size(CONFIG(auxAnalogInputs)); i++) { auto channel = CONFIG(auxAnalogInputs)[i]; diff --git a/firmware/init/sensor/init_baro.cpp b/firmware/init/sensor/init_baro.cpp index 8bb461dcfc..3747ec9609 100644 --- a/firmware/init/sensor/init_baro.cpp +++ b/firmware/init/sensor/init_baro.cpp @@ -4,7 +4,7 @@ static Lps25 device; static Lps25Sensor sensor(device); -void initBaro(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void initBaro() { // If there's already an external (analog) baro sensor configured, // don't configure the internal one. if (Sensor::hasSensor(SensorType::BarometricPressure)) { diff --git a/firmware/init/sensor/init_flex.cpp b/firmware/init/sensor/init_flex.cpp index 4fb7a89179..3c884470c0 100644 --- a/firmware/init/sensor/init_flex.cpp +++ b/firmware/init/sensor/init_flex.cpp @@ -9,7 +9,7 @@ static FlexConverter converter; // https://rusefi.com/forum/viewtopic.php?p=37452&sid=829804c90d5b2e1fecd1b900cf1b1811#p37452 -void initFlexSensor(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void initFlexSensor() { auto pin = CONFIG(flexSensorPin); // Nothing to do if no sensor configured diff --git a/firmware/init/sensor/init_fluid_pressure.cpp b/firmware/init/sensor/init_fluid_pressure.cpp index 0f7a2304bd..4d126a7a3c 100644 --- a/firmware/init/sensor/init_fluid_pressure.cpp +++ b/firmware/init/sensor/init_fluid_pressure.cpp @@ -45,7 +45,7 @@ static void initFluidPressure(LinearFunc& func, FunctionalSensor& sensor, const sensor.Register(); } -void initOilPressure(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void initOilPressure() { initFluidPressure(oilpSensorFunc, oilpSensor, CONFIG(oilPressure), 10); initFluidPressure(fuelPressureFuncLow, fuelPressureSensorLow, CONFIG(lowPressureFuel), 10); initFluidPressure(fuelPressureFuncHigh, fuelPressureSensorHigh, CONFIG(highPressureFuel), 100); diff --git a/firmware/init/sensor/init_fuel_level.cpp b/firmware/init/sensor/init_fuel_level.cpp index a9ccb5936a..dfaa86faf0 100644 --- a/firmware/init/sensor/init_fuel_level.cpp +++ b/firmware/init/sensor/init_fuel_level.cpp @@ -18,7 +18,7 @@ static TableFunc efi::ratio<1>> fuelCurve(CONFIG(fuelLevelBins), CONFIG(fuelLevelValues)); -void initFuelLevel(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void initFuelLevel() { adc_channel_e channel = CONFIG(fuelLevelSensor); if (!isAdcChannelValid(channel)) { diff --git a/firmware/init/sensor/init_lambda.cpp b/firmware/init/sensor/init_lambda.cpp index 395aaed51e..a69a34b859 100644 --- a/firmware/init/sensor/init_lambda.cpp +++ b/firmware/init/sensor/init_lambda.cpp @@ -6,7 +6,7 @@ struct GetAfrWrapper : public EnginePtr { float getLambda() { - return getAfr(PASS_ENGINE_PARAMETER_SIGNATURE) / 14.7f; + return getAfr() / 14.7f; } }; @@ -23,8 +23,8 @@ static AemXSeriesWideband aem1(0, SensorType::Lambda1); static AemXSeriesWideband aem2(1, SensorType::Lambda2); #endif -void initLambda(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - afrWrapper.inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void initLambda() { + afrWrapper.inject(); #if EFI_CAN_SUPPORT if (CONFIG(enableAemXSeries)) { diff --git a/firmware/init/sensor/init_maf.cpp b/firmware/init/sensor/init_maf.cpp index 1bcbf5dff4..ccc742c40e 100644 --- a/firmware/init/sensor/init_maf.cpp +++ b/firmware/init/sensor/init_maf.cpp @@ -15,7 +15,7 @@ using ValueType = std::remove_extent_tmafDecoding)>; // This function converts volts -> kg/h static TableFunc mafCurve(config->mafDecodingBins, config->mafDecoding); -void initMaf(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void initMaf() { adc_channel_e channel = CONFIG(mafAdcChannel); if (!isAdcChannelValid(channel)) { diff --git a/firmware/init/sensor/init_map.cpp b/firmware/init/sensor/init_map.cpp index 4cc3ef0d1b..1ed2960ca3 100644 --- a/firmware/init/sensor/init_map.cpp +++ b/firmware/init/sensor/init_map.cpp @@ -9,7 +9,7 @@ struct GetBaroWrapper : public EnginePtr { float getBaro() { - return ::getBaroPressure(PASS_ENGINE_PARAMETER_SIGNATURE); + return ::getBaroPressure(); } }; @@ -51,7 +51,7 @@ struct MapCfg { float map2; }; -static MapCfg getMapCfg(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static MapCfg getMapCfg() { auto sensorType = engineConfiguration->map.sensor.type; switch (sensorType) { case MT_DENSO183: @@ -97,8 +97,8 @@ static MapCfg getMapCfg(DECLARE_CONFIG_PARAMETER_SIGNATURE) { }} } -void configureMapFunction(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - auto cfg = getMapCfg(PASS_CONFIG_PARAMETER_SIGNATURE); +void configureMapFunction() { + auto cfg = getMapCfg(); mapConverter.configure( cfg.v1, @@ -110,14 +110,14 @@ void configureMapFunction(DECLARE_CONFIG_PARAMETER_SIGNATURE) { ); } -void initMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - baroWrapper.inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void initMap() { + baroWrapper.inject(); auto mapChannel = engineConfiguration->map.sensor.hwChannel; if (isAdcChannelValid(mapChannel)) { // Set up the conversion function - configureMapFunction(PASS_CONFIG_PARAMETER_SIGNATURE); + configureMapFunction(); slowMapSensor.setFunction(mapConverter); fastMapSensor.setFunction(identityFunction); diff --git a/firmware/init/sensor/init_sensors.cpp b/firmware/init/sensor/init_sensors.cpp index 344b0bc61e..2d47d5dc22 100644 --- a/firmware/init/sensor/init_sensors.cpp +++ b/firmware/init/sensor/init_sensors.cpp @@ -16,7 +16,7 @@ void initIfValid(const char* msg, adc_channel_e channel) { #if EFI_PROD_CODE brain_pin_e pin = getAdcChannelBrainPin(msg, channel); - efiSetPadMode(msg, pin, PAL_MODE_INPUT_ANALOG PASS_ENGINE_PARAMETER_SUFFIX); + efiSetPadMode(msg, pin, PAL_MODE_INPUT_ANALOG); #endif } @@ -27,11 +27,11 @@ void deInitIfValid(const char* msg, adc_channel_e channel) { #if EFI_PROD_CODE brain_pin_e pin = getAdcChannelBrainPin(msg, channel); - efiSetPadUnused(pin PASS_ENGINE_PARAMETER_SUFFIX); + efiSetPadUnused(pin); #endif } -static void initOldAnalogInputs(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void initOldAnalogInputs() { initIfValid("AFR", engineConfiguration->afr.hwChannel); initIfValid("Baro", engineConfiguration->baroSensor.hwChannel); initIfValid("AUXF#1", engineConfiguration->auxFastSensor1_adcChannel); @@ -39,7 +39,7 @@ static void initOldAnalogInputs(DECLARE_CONFIG_PARAMETER_SIGNATURE) { initIfValid("CJ125 UA", engineConfiguration->cj125ua); } -static void deInitOldAnalogInputs(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void deInitOldAnalogInputs() { deInitIfValid("AFR", activeConfiguration.afr.hwChannel); deInitIfValid("Baro", activeConfiguration.baroSensor.hwChannel); deInitIfValid("AUXF#1", activeConfiguration.auxFastSensor1_adcChannel); @@ -47,36 +47,36 @@ static void deInitOldAnalogInputs(DECLARE_CONFIG_PARAMETER_SIGNATURE) { deInitIfValid("CJ125 UA", activeConfiguration.cj125ua); } -void initNewSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +void initNewSensors() { #if EFI_CAN_SUPPORT initCanSensors(); #endif - initVbatt(PASS_CONFIG_PARAMETER_SIGNATURE); - initMap(PASS_ENGINE_PARAMETER_SIGNATURE); - initTps(PASS_CONFIG_PARAMETER_SIGNATURE); - initOilPressure(PASS_CONFIG_PARAMETER_SIGNATURE); - initThermistors(PASS_CONFIG_PARAMETER_SIGNATURE); - initLambda(PASS_ENGINE_PARAMETER_SIGNATURE); - initFlexSensor(PASS_CONFIG_PARAMETER_SIGNATURE); - initBaro(PASS_CONFIG_PARAMETER_SIGNATURE); - initAuxSensors(PASS_CONFIG_PARAMETER_SIGNATURE); - initVehicleSpeedSensor(PASS_ENGINE_PARAMETER_SIGNATURE); - initTurbochargerSpeedSensor(PASS_ENGINE_PARAMETER_SIGNATURE); + initVbatt(); + initMap(); + initTps(); + initOilPressure(); + initThermistors(); + initLambda(); + initFlexSensor(); + initBaro(); + initAuxSensors(); + initVehicleSpeedSensor(); + initTurbochargerSpeedSensor(); #if !EFI_UNIT_TEST - initFuelLevel(PASS_CONFIG_PARAMETER_SIGNATURE); - initMaf(PASS_CONFIG_PARAMETER_SIGNATURE); + initFuelLevel(); + initMaf(); #endif - initOldAnalogInputs(PASS_CONFIG_PARAMETER_SIGNATURE); + initOldAnalogInputs(); // Init CLI functionality for sensors (mocking) initSensorCli(); } -void stopSensors(DECLARE_CONFIG_PARAMETER_SIGNATURE) { - deInitOldAnalogInputs(PASS_CONFIG_PARAMETER_SIGNATURE); +void stopSensors() { + deInitOldAnalogInputs(); deinitTps(); deinitOilPressure(); @@ -88,17 +88,17 @@ void stopSensors(DECLARE_CONFIG_PARAMETER_SIGNATURE) { deinitMap(); } -void reconfigureSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - initMap(PASS_ENGINE_PARAMETER_SIGNATURE); - initTps(PASS_CONFIG_PARAMETER_SIGNATURE); - initOilPressure(PASS_CONFIG_PARAMETER_SIGNATURE); - initVbatt(PASS_CONFIG_PARAMETER_SIGNATURE); - initThermistors(PASS_CONFIG_PARAMETER_SIGNATURE); - initFlexSensor(PASS_CONFIG_PARAMETER_SIGNATURE); - initVehicleSpeedSensor(PASS_ENGINE_PARAMETER_SIGNATURE); - initTurbochargerSpeedSensor(PASS_ENGINE_PARAMETER_SIGNATURE); +void reconfigureSensors() { + initMap(); + initTps(); + initOilPressure(); + initVbatt(); + initThermistors(); + initFlexSensor(); + initVehicleSpeedSensor(); + initTurbochargerSpeedSensor(); - initOldAnalogInputs(PASS_CONFIG_PARAMETER_SIGNATURE); + initOldAnalogInputs(); } // Mocking/testing helpers diff --git a/firmware/init/sensor/init_thermistors.cpp b/firmware/init/sensor/init_thermistors.cpp index c967e0c29f..1c93d76f55 100644 --- a/firmware/init/sensor/init_thermistors.cpp +++ b/firmware/init/sensor/init_thermistors.cpp @@ -83,7 +83,7 @@ static void configureTempSensor(const char *msg, sensor.Register(); } -void initThermistors(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void initThermistors() { if (!CONFIG(consumeObdSensors)) { configureTempSensor("clt", clt, diff --git a/firmware/init/sensor/init_tps.cpp b/firmware/init/sensor/init_tps.cpp index 1c51256fc1..5b4eb09802 100644 --- a/firmware/init/sensor/init_tps.cpp +++ b/firmware/init/sensor/init_tps.cpp @@ -95,7 +95,7 @@ static void initTpsFuncAndRedund(RedundantSensor& redund, RedundantFordTps* ford } } -void initTps(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void initTps() { percent_t min = CONFIG(tpsErrorDetectionTooLow); percent_t max = CONFIG(tpsErrorDetectionTooHigh); diff --git a/firmware/init/sensor/init_turbocharger_speed_sensor.cpp b/firmware/init/sensor/init_turbocharger_speed_sensor.cpp index b24768c08b..81f7b1e593 100644 --- a/firmware/init/sensor/init_turbocharger_speed_sensor.cpp +++ b/firmware/init/sensor/init_turbocharger_speed_sensor.cpp @@ -8,8 +8,8 @@ static FrequencySensor turbochargerSpeedSensor(SensorType::TurbochargerSpeed, MS static TurbochargerSpeedConverter turbochargerSpeedConverter; -void initTurbochargerSpeedSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - turbochargerSpeedConverter.inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void initTurbochargerSpeedSensor() { + turbochargerSpeedConverter.inject(); auto pin = CONFIG(turboSpeedSensorInputPin); diff --git a/firmware/init/sensor/init_vbatt.cpp b/firmware/init/sensor/init_vbatt.cpp index 5f5755c11f..e6912fcd9f 100644 --- a/firmware/init/sensor/init_vbatt.cpp +++ b/firmware/init/sensor/init_vbatt.cpp @@ -8,7 +8,7 @@ static LinearFunc vbattFunc; static FunctionalSensor vbattSensor(SensorType::BatteryVoltage, /* timeout = */ MS2NT(100)); -void initVbatt(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +void initVbatt() { vbattFunc.configure(0, 0, 1, engineConfiguration->vbattDividerCoeff, 0, 50); vbattSensor.setFunction(vbattFunc); diff --git a/firmware/init/sensor/init_vehicle_speed_sensor.cpp b/firmware/init/sensor/init_vehicle_speed_sensor.cpp index db6c38b77e..bd9472e493 100644 --- a/firmware/init/sensor/init_vehicle_speed_sensor.cpp +++ b/firmware/init/sensor/init_vehicle_speed_sensor.cpp @@ -7,8 +7,8 @@ static FrequencySensor vehicleSpeedSensor(SensorType::VehicleSpeed, MS2NT(500)); static VehicleSpeedConverter vehicleSpeedConverter; -void initVehicleSpeedSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) { - vehicleSpeedConverter.inject(PASS_ENGINE_PARAMETER_SIGNATURE); +void initVehicleSpeedSensor() { + vehicleSpeedConverter.inject(); auto pin = CONFIG(vehicleSpeedSensorInputPin); diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 381ff51bc5..feb6ef1b14 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -183,7 +183,7 @@ void runRusEfi() { /** * we need to initialize table objects before default configuration can set values */ - initDataStructures(PASS_ENGINE_PARAMETER_SIGNATURE); + initDataStructures(); // Perform hardware initialization that doesn't need configuration initHardwareNoConfig(); @@ -206,7 +206,7 @@ void runRusEfi() { initializeConsole(); // Read configuration from flash memory - loadConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); + loadConfiguration(); #if EFI_TUNER_STUDIO startTunerStudioConnectivity(); @@ -218,7 +218,7 @@ void runRusEfi() { runRusEfiWithConfig(); // periodic events need to be initialized after fuel&spark pins to avoid a warning - initPeriodicEvents(PASS_ENGINE_PARAMETER_SIGNATURE); + initPeriodicEvents(); runMainLoop(); } @@ -255,20 +255,20 @@ void runRusEfiWithConfig() { #endif // EFI_LUA // Config could be completely bogus - don't start anything else! - if (validateConfig(PASS_CONFIG_PARAMETER_SIGNATURE)) { + if (validateConfig()) { initStatusLoop(); /** * Now let's initialize actual engine control logic * todo: should we initialize some? most? controllers before hardware? */ - initEngineContoller(PASS_ENGINE_PARAMETER_SIGNATURE); + initEngineContoller(); #if EFI_ENGINE_EMULATOR - initEngineEmulator(PASS_ENGINE_PARAMETER_SIGNATURE); + initEngineEmulator(); #endif // This has to happen after RegisteredOutputPins are init'd: otherwise no change will be detected, and no init will happen - rememberCurrentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); + rememberCurrentConfiguration(); #if EFI_PERF_METRICS initTimePerfActions(); diff --git a/java_console/models/src/main/java/com/rusefi/tools/tune/TS2C.java b/java_console/models/src/main/java/com/rusefi/tools/tune/TS2C.java index cba71d7e30..36bbccbd18 100644 --- a/java_console/models/src/main/java/com/rusefi/tools/tune/TS2C.java +++ b/java_console/models/src/main/java/com/rusefi/tools/tune/TS2C.java @@ -82,7 +82,7 @@ public class TS2C { } w.write(FINGER_PRINT); - w.write("static void set" + methodName + "(DECLARE_CONFIG_PARAMETER_SIGNATURE) {\n"); + w.write("static void set" + methodName + "() {\n"); w.write("\tMEMCPY(config->" + loadSectionName + ", hardCoded" + loadSectionName + ");\n"); w.write("\tMEMCPY(config->" + rpmSectionName + ", hardCoded" + rpmSectionName + ");\n"); diff --git a/java_console/ui/src/test/java/com/rusefi/ui/livedata/LiveDataParserTest.java b/java_console/ui/src/test/java/com/rusefi/ui/livedata/LiveDataParserTest.java index 2b5c894ec5..b1ddab1b6c 100644 --- a/java_console/ui/src/test/java/com/rusefi/ui/livedata/LiveDataParserTest.java +++ b/java_console/ui/src/test/java/com/rusefi/ui/livedata/LiveDataParserTest.java @@ -22,7 +22,7 @@ public class LiveDataParserTest { VariableValueSource valueSource = values::get; - String sourceCode = "bool AcState::getAcState(DECLARE_ENGINE_PARAMETER_SIGNATURE) {\n" + + String sourceCode = "bool AcState::getAcState() {\n" + "\tauto rpm = Sensor::getOrZero(SensorType::Rpm);\n" + "\n" + "\tengineTooSlow = rpm < 500;\n" + diff --git a/simulator/simulator/boards.cpp b/simulator/simulator/boards.cpp index 5d9fed0482..e59f4297be 100644 --- a/simulator/simulator/boards.cpp +++ b/simulator/simulator/boards.cpp @@ -16,11 +16,11 @@ int getAdcValue(const char *msg, int hwChannel) { } // voltage in MCU universe, from zero to VDD -float getVoltage(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getVoltage(const char *msg, adc_channel_e hwChannel) { return adcToVolts(getAdcValue(msg, hwChannel)); } // Board voltage, with divider coefficient accounted for -float getVoltageDivided(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getVoltageDivided(const char *msg, adc_channel_e hwChannel) { return getVoltage(msg, hwChannel) * engineConfiguration->analogInputDividerCoefficient; } diff --git a/simulator/simulator/rusEfiFunctionalTest.cpp b/simulator/simulator/rusEfiFunctionalTest.cpp index 7354758adf..3d5ceabef5 100644 --- a/simulator/simulator/rusEfiFunctionalTest.cpp +++ b/simulator/simulator/rusEfiFunctionalTest.cpp @@ -86,18 +86,18 @@ void rusEfiFunctionalTest(void) { initializeConsole(); initStatusLoop(); - initDataStructures(PASS_ENGINE_PARAMETER_SIGNATURE); + initDataStructures(); // todo: reduce code duplication with initEngineContoller - resetConfigurationExt(MINIMAL_PINS PASS_ENGINE_PARAMETER_SUFFIX); + resetConfigurationExt(MINIMAL_PINS); enableTriggerStimulator(); commonInitEngineController(); initTriggerCentral(); - initTriggerEmulator(PASS_ENGINE_PARAMETER_SIGNATURE); + initTriggerEmulator(); startStatusThreads(); @@ -105,9 +105,9 @@ void rusEfiFunctionalTest(void) { runChprintfTest(); - initPeriodicEvents(PASS_ENGINE_PARAMETER_SIGNATURE); + initPeriodicEvents(); - setTriggerEmulatorRPM(DEFAULT_SIM_RPM PASS_ENGINE_PARAMETER_SUFFIX); + setTriggerEmulatorRPM(DEFAULT_SIM_RPM); engineConfiguration->engineSnifferRpmThreshold = DEFAULT_SNIFFER_THR; startSerialChannels(); diff --git a/unit_tests/boards.cpp b/unit_tests/boards.cpp index 47084221d7..3000573181 100644 --- a/unit_tests/boards.cpp +++ b/unit_tests/boards.cpp @@ -10,11 +10,11 @@ #include "boards.h" // see setMockVoltage -float getVoltageDivided(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getVoltageDivided(const char *msg, adc_channel_e hwChannel) { return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel));; } -float getVoltage(const char *msg, adc_channel_e hwChannel DECLARE_ENGINE_PARAMETER_SUFFIX) { +float getVoltage(const char *msg, adc_channel_e hwChannel) { if (engine->engineState.mockAdcState.hasMockAdc[hwChannel]) return adcToVolts(engine->engineState.mockAdcState.getMockAdcValue(hwChannel) * engineConfiguration->analogInputDividerCoefficient); return 0; diff --git a/unit_tests/engine_test_helper.cpp b/unit_tests/engine_test_helper.cpp index a3b3683a14..acbfaa8d1a 100644 --- a/unit_tests/engine_test_helper.cpp +++ b/unit_tests/engine_test_helper.cpp @@ -86,11 +86,11 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb memset(&activeConfiguration, 0, sizeof(activeConfiguration)); - enginePins.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + enginePins.inject(); enginePins.reset(); enginePins.unregisterPins(); - waveChart.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + waveChart.inject(); waveChart.init(); setCurveValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, -40, 1.5); @@ -106,22 +106,22 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb setCurveValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 60, 1.03); setCurveValue(config->cltFuelCorrBins, config->cltFuelCorr, CLT_CURVE_SIZE, 70, 1.01); - initDataStructures(PASS_ENGINE_PARAMETER_SIGNATURE); + initDataStructures(); - resetConfigurationExt(configurationCallback, engineType PASS_ENGINE_PARAMETER_SUFFIX); + resetConfigurationExt(configurationCallback, engineType); - validateConfig(PASS_CONFIG_PARAMETER_SIGNATURE); + validateConfig(); enginePins.startPins(); - commonInitEngineController(PASS_ENGINE_PARAMETER_SIGNATURE); + commonInitEngineController(); engineConfiguration->mafAdcChannel = EFI_ADC_10; - engine.engineState.mockAdcState.setMockVoltage(EFI_ADC_10, 0 PASS_ENGINE_PARAMETER_SUFFIX); + engine.engineState.mockAdcState.setMockVoltage(EFI_ADC_10, 0); // this is needed to have valid CLT and IAT. -//todo: reuse initPeriodicEvents(PASS_ENGINE_PARAMETER_SIGNATURE) method - engine.periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE); +//todo: reuse initPeriodicEvents() method + engine.periodicSlowCallback(); // Setup running in mock airmass mode engineConfiguration->fuelAlgorithm = LM_MOCK; @@ -129,8 +129,8 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb memset(mockPinStates, 0, sizeof(mockPinStates)); - initHardware(PASS_ENGINE_PARAMETER_SIGNATURE); - rememberCurrentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); + initHardware(); + rememberCurrentConfiguration(); } EngineTestHelper::~EngineTestHelper() { @@ -188,17 +188,15 @@ void EngineTestHelper::smartFireFall(float delayMs) { void EngineTestHelper::firePrimaryTriggerRise() { efitick_t nowNt = getTimeNowNt(); Engine *engine = &this->engine; - EXPAND_Engine; - LogTriggerTooth(SHAFT_PRIMARY_RISING, nowNt PASS_ENGINE_PARAMETER_SUFFIX); - handleShaftSignal(0, true, nowNt PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerTooth(SHAFT_PRIMARY_RISING, nowNt); + handleShaftSignal(0, true, nowNt); } void EngineTestHelper::firePrimaryTriggerFall() { efitick_t nowNt = getTimeNowNt(); Engine *engine = &this->engine; - EXPAND_Engine; - LogTriggerTooth(SHAFT_PRIMARY_FALLING, nowNt PASS_ENGINE_PARAMETER_SUFFIX); - handleShaftSignal(0, false, nowNt PASS_ENGINE_PARAMETER_SUFFIX); + LogTriggerTooth(SHAFT_PRIMARY_FALLING, nowNt); + handleShaftSignal(0, false, nowNt); } void EngineTestHelper::fireTriggerEventsWithDuration(float durationMs) { @@ -355,24 +353,22 @@ void EngineTestHelper::assertEvent(const char *msg, int index, void *callback, e void EngineTestHelper::applyTriggerWaveform() { Engine *engine = &this->engine; - EXPAND_Engine - ENGINE(initializeTriggerWaveform(PASS_ENGINE_PARAMETER_SIGNATURE)); + ENGINE(initializeTriggerWaveform()); - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } // todo: open question if this is worth a helper method or should be inlined? void EngineTestHelper::assertRpm(int expectedRpm, const char *msg) { Engine *engine = &this->engine; - EXPAND_Engine + EXPECT_EQ(expectedRpm, GET_RPM()) << msg; } void setupSimpleTestEngineWithMaf(EngineTestHelper *eth, injection_mode_e injectionMode, trigger_type_e trigger) { Engine *engine = ð->engine; - EXPAND_Engine engineConfiguration->isIgnitionEnabled = false; // let's focus on injection engineConfiguration->specs.cylindersCount = 4; @@ -384,16 +380,16 @@ void setupSimpleTestEngineWithMaf(EngineTestHelper *eth, injection_mode_e inject setArrayValues(config->cltFuelCorrBins, 1.0f); setArrayValues(engineConfiguration->injector.battLagCorr, 0.0f); // this is needed to update injectorLag - engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->updateSlowSensors(); - ASSERT_EQ( 0, engine->triggerCentral.isTriggerConfigChanged(PASS_ENGINE_PARAMETER_SIGNATURE)) << "trigger #1"; - eth->setTriggerType(trigger PASS_ENGINE_PARAMETER_SUFFIX); + ASSERT_EQ( 0, engine->triggerCentral.isTriggerConfigChanged()) << "trigger #1"; + eth->setTriggerType(trigger); } -void EngineTestHelper::setTriggerType(trigger_type_e trigger DECLARE_ENGINE_PARAMETER_SUFFIX) { +void EngineTestHelper::setTriggerType(trigger_type_e trigger) { engineConfiguration->trigger.type = trigger; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); - ASSERT_EQ( 1, engine.triggerCentral.isTriggerConfigChanged(PASS_ENGINE_PARAMETER_SIGNATURE)) << "trigger #2"; + incrementGlobalConfigurationVersion(); + ASSERT_EQ( 1, engine.triggerCentral.isTriggerConfigChanged()) << "trigger #2"; applyTriggerWaveform(); } diff --git a/unit_tests/engine_test_helper.h b/unit_tests/engine_test_helper.h index 2386d0f64c..61d857ab09 100644 --- a/unit_tests/engine_test_helper.h +++ b/unit_tests/engine_test_helper.h @@ -40,7 +40,7 @@ public: int getWarningCounter(); void applyTriggerWaveform(); - void setTriggerType(trigger_type_e trigger DECLARE_ENGINE_PARAMETER_SUFFIX); + void setTriggerType(trigger_type_e trigger); /** * DEPRECATED these methods do not execute events on the queue */ diff --git a/unit_tests/global.h b/unit_tests/global.h index f16c3a35eb..2837469abb 100644 --- a/unit_tests/global.h +++ b/unit_tests/global.h @@ -79,8 +79,6 @@ void chDbgAssert(int c, char *msg, void *arg); EngineTestHelper eth(x, callback, std::unordered_map{}); \ EXPAND_EngineTestHelper; -#define CONFIG_PARAM(x) CONFIG(x) - #ifdef __cplusplus namespace chibios_rt { // Noop for unit tests - this does real lock in FW/sim diff --git a/unit_tests/logicdata_csv_reader.cpp b/unit_tests/logicdata_csv_reader.cpp index cdd848b9dc..8442ccf11c 100644 --- a/unit_tests/logicdata_csv_reader.cpp +++ b/unit_tests/logicdata_csv_reader.cpp @@ -35,7 +35,6 @@ bool CsvReader::haveMore() { void CsvReader::processLine(EngineTestHelper *eth) { Engine *engine = ð->engine; - EXPAND_Engine const char s[2] = ","; char *line = buffer; @@ -72,7 +71,7 @@ void CsvReader::processLine(EngineTestHelper *eth) { efitick_t nowNt = getTimeNowNt(); // todo: we invert VVT but we do not invert trigger input!!! - hwHandleShaftSignal(index, newState[index], nowNt PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleShaftSignal(index, newState[index], nowNt); currentState[index] = newState[index]; } @@ -87,7 +86,7 @@ void CsvReader::processLine(EngineTestHelper *eth) { // todo: configurable selection of vvt mode - dual bank or dual cam single bank int bankIndex = vvtIndex; int camIndex = 0; - hwHandleVvtCamSignal(event, nowNt, bankIndex *2 + camIndex PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(event, nowNt, bankIndex *2 + camIndex); currentVvtState[vvtIndex] = newVvtState[vvtIndex]; diff --git a/unit_tests/tests/ignition_injection/injection_mode_transition.cpp b/unit_tests/tests/ignition_injection/injection_mode_transition.cpp index a8017b62e2..32b970b147 100644 --- a/unit_tests/tests/ignition_injection/injection_mode_transition.cpp +++ b/unit_tests/tests/ignition_injection/injection_mode_transition.cpp @@ -38,7 +38,7 @@ TEST(fuelControl, transitionIssue1592) { // This is easiest to trip on a wheel that requires sync engineConfiguration->trigger.customTotalToothCount = 6; engineConfiguration->trigger.customSkippedToothCount = 1; - eth.setTriggerType(TT_TOOTHED_WHEEL PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_TOOTHED_WHEEL); engineConfiguration->ambiguousOperationMode = FOUR_STROKE_CAM_SENSOR; engineConfiguration->isFasterEngineSpinUpEnabled = true; diff --git a/unit_tests/tests/ignition_injection/test_fuelCut.cpp b/unit_tests/tests/ignition_injection/test_fuelCut.cpp index 62cbeffa70..92e2016553 100644 --- a/unit_tests/tests/ignition_injection/test_fuelCut.cpp +++ b/unit_tests/tests/ignition_injection/test_fuelCut.cpp @@ -48,21 +48,21 @@ TEST(fuelCut, coasting) { */ // process - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); // this is normal injection mode (the throttle is opened), no fuel cut-off assertEqualsM("inj dur#1 norm", normalInjDuration, ENGINE(injectionDuration)); // 'releasing' the throttle Sensor::setMockValue(SensorType::Tps1, 0); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); // Fuel cut-off is enabled now assertEqualsM("inj dur#2 cut", 0.0f, ENGINE(injectionDuration)); // Now drop the CLT below threshold Sensor::setMockValue(SensorType::Clt, engineConfiguration->coastingFuelCutClt - 1); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); // Fuel cut-off should be diactivated - the engine is 'cold' assertEqualsM("inj dur#3 clt", normalInjDuration, ENGINE(injectionDuration)); @@ -71,28 +71,28 @@ TEST(fuelCut, coasting) { Sensor::setMockValue(SensorType::Clt, hotClt); // And set RPM - somewhere between RpmHigh and RpmLow threshold engine->rpmCalculator.mockRpm = (engineConfiguration->coastingFuelCutRpmHigh + engineConfiguration->coastingFuelCutRpmLow) / 2; - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); // Fuel cut-off is enabled - nothing should change assertEqualsM("inj dur#4 mid", normalInjDuration, ENGINE(injectionDuration)); // Now drop RPM just below RpmLow threshold engine->rpmCalculator.mockRpm = engineConfiguration->coastingFuelCutRpmLow - 1; - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); // Fuel cut-off is now disabled (the engine is idling) assertEqualsM("inj dur#5 idle", normalInjDuration, ENGINE(injectionDuration)); // Now change RPM just below RpmHigh threshold engine->rpmCalculator.mockRpm = engineConfiguration->coastingFuelCutRpmHigh - 1; - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); // Fuel cut-off is still disabled assertEqualsM("inj dur#6 mid", normalInjDuration, ENGINE(injectionDuration)); // Now set RPM just above RpmHigh threshold engine->rpmCalculator.mockRpm = engineConfiguration->coastingFuelCutRpmHigh + 1; - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); // Fuel cut-off is active again! assertEqualsM("inj dur#7 cut", 0.0f, ENGINE(injectionDuration)); diff --git a/unit_tests/tests/ignition_injection/test_fuel_computer.cpp b/unit_tests/tests/ignition_injection/test_fuel_computer.cpp index 8e5e3a75d0..0784422406 100644 --- a/unit_tests/tests/ignition_injection/test_fuel_computer.cpp +++ b/unit_tests/tests/ignition_injection/test_fuel_computer.cpp @@ -17,7 +17,7 @@ TEST(FuelComputer, getCycleFuel) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); MockFuelComputer dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); EXPECT_CALL(dut, getTargetLambdaLoadAxis(FloatEq(0.8f))) .WillOnce(Return(0.8f)); @@ -45,7 +45,7 @@ TEST(FuelComputer, FlexFuel) { MockVp3d lambdaTable; FuelComputer dut(lambdaTable); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // easier values for testing engineConfiguration->stoichRatioPrimary = 15; diff --git a/unit_tests/tests/ignition_injection/test_fuel_map.cpp b/unit_tests/tests/ignition_injection/test_fuel_map.cpp index 4c1e289008..9b601bb867 100644 --- a/unit_tests/tests/ignition_injection/test_fuel_map.cpp +++ b/unit_tests/tests/ignition_injection/test_fuel_map.cpp @@ -23,15 +23,15 @@ TEST(misc, testFuelMap) { CONFIG(injector.battLagCorr[i]) = 0.5 + 2 * i; } - eth.engine.updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.updateSlowSensors(); Sensor::setMockValue(SensorType::Clt, 36.605f); Sensor::setMockValue(SensorType::Iat, 30.0f); // because all the correction tables are zero printf("*************************************************** getRunningFuel 1\r\n"); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); - ASSERT_NEAR(5.3679, getRunningFuel(5 PASS_ENGINE_PARAMETER_SUFFIX), EPS4D) << "base fuel"; + eth.engine.periodicFastCallback(); + ASSERT_NEAR(5.3679, getRunningFuel(5), EPS4D) << "base fuel"; printf("*************************************************** setting IAT table\r\n"); for (int i = 0; i < IAT_CURVE_SIZE; i++) { @@ -49,41 +49,41 @@ TEST(misc, testFuelMap) { Sensor::setMockValue(SensorType::Clt, 70.0f); Sensor::setMockValue(SensorType::Iat, 30.0f); - setFlatInjectorLag(0 PASS_CONFIG_PARAMETER_SUFFIX); + setFlatInjectorLag(0); - float iatCorrection = getIatFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); + float iatCorrection = getIatFuelCorrection(); ASSERT_EQ( 6, iatCorrection) << "IAT"; - float cltCorrection = getCltFuelCorrection(PASS_ENGINE_PARAMETER_SIGNATURE); + float cltCorrection = getCltFuelCorrection(); ASSERT_EQ( 7, cltCorrection) << "CLT"; engineConfiguration->mafAdcChannel = EFI_ADC_10; - engine->engineState.mockAdcState.setMockVoltage(EFI_ADC_10, 5 PASS_ENGINE_PARAMETER_SUFFIX); + engine->engineState.mockAdcState.setMockVoltage(EFI_ADC_10, 5); // 1005 * 2 for IAT correction printf("*************************************************** getRunningFuel 2\r\n"); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); // Check that runningFuel corrects appropriately - EXPECT_EQ( 42, getRunningFuel(1 PASS_ENGINE_PARAMETER_SUFFIX)) << "v1"; - EXPECT_EQ( 84, getRunningFuel(2 PASS_ENGINE_PARAMETER_SUFFIX)) << "v1"; + EXPECT_EQ( 42, getRunningFuel(1)) << "v1"; + EXPECT_EQ( 84, getRunningFuel(2)) << "v1"; - engine->engineState.mockAdcState.setMockVoltage(EFI_ADC_10, 0 PASS_ENGINE_PARAMETER_SUFFIX); + engine->engineState.mockAdcState.setMockVoltage(EFI_ADC_10, 0); engineConfiguration->cranking.baseFuel = 4000; // Should use 20 degree correction in case of failed sensor Sensor::resetMockValue(SensorType::Clt); - EXPECT_NEAR(12.4, getCrankingFuel3(2, 0 PASS_ENGINE_PARAMETER_SUFFIX), EPS4D); + EXPECT_NEAR(12.4, getCrankingFuel3(2, 0), EPS4D); Sensor::setMockValue(SensorType::Clt, 0); - EXPECT_NEAR(7.7333, getCrankingFuel3(2, 4 PASS_ENGINE_PARAMETER_SUFFIX), EPS4D); + EXPECT_NEAR(7.7333, getCrankingFuel3(2, 4), EPS4D); Sensor::setMockValue(SensorType::Clt, 8); - EXPECT_NEAR(7, getCrankingFuel3(2, 15 PASS_ENGINE_PARAMETER_SUFFIX), EPS4D); + EXPECT_NEAR(7, getCrankingFuel3(2, 15), EPS4D); Sensor::setMockValue(SensorType::Clt, 70); - EXPECT_NEAR(8, getCrankingFuel3(2, 0 PASS_ENGINE_PARAMETER_SUFFIX), EPS4D); + EXPECT_NEAR(8, getCrankingFuel3(2, 0), EPS4D); Sensor::setMockValue(SensorType::Clt, 70); - EXPECT_NEAR(4, getCrankingFuel3(2, 50 PASS_ENGINE_PARAMETER_SUFFIX), EPS4D); + EXPECT_NEAR(4, getCrankingFuel3(2, 50), EPS4D); } @@ -139,7 +139,7 @@ TEST(misc, testAngleResolver) { TriggerWaveform * ts = &engine->triggerCentral.triggerShape; TriggerFormDetails *triggerFormDetails = &engine->triggerCentral.triggerFormDetails; - engine->initializeTriggerWaveform(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->initializeTriggerWaveform(); assertEqualsM("index 2", 52.76, triggerFormDetails->eventAngles[3]); // this angle is relation to synch point assertEqualsM("time 2", 0.3233, ts->wave->getSwitchTime(2)); diff --git a/unit_tests/tests/ignition_injection/test_fuel_math.cpp b/unit_tests/tests/ignition_injection/test_fuel_math.cpp index 26865cd700..602b5bce90 100644 --- a/unit_tests/tests/ignition_injection/test_fuel_math.cpp +++ b/unit_tests/tests/ignition_injection/test_fuel_math.cpp @@ -15,24 +15,24 @@ TEST(FuelMath, getStandardAirCharge) { CONFIG(specs.displacement) = 1.839f; CONFIG(specs.cylindersCount) = 4; - EXPECT_FLOAT_EQ(0.5535934f, getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE)); + EXPECT_FLOAT_EQ(0.5535934f, getStandardAirCharge()); // LS 5.3 liter v8 CONFIG(specs.displacement) = 5.327f; CONFIG(specs.cylindersCount) = 8; - EXPECT_FLOAT_EQ(0.80179232f, getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE)); + EXPECT_FLOAT_EQ(0.80179232f, getStandardAirCharge()); // Chainsaw - single cylinder 32cc CONFIG(specs.displacement) = 0.032f; CONFIG(specs.cylindersCount) = 1; - EXPECT_FLOAT_EQ(0.038531788f, getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE)); + EXPECT_FLOAT_EQ(0.038531788f, getStandardAirCharge()); // Leopard 1 47.666 liter v12 CONFIG(specs.displacement) = 47.666f; CONFIG(specs.cylindersCount) = 12; - EXPECT_FLOAT_EQ(4.782959f, getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE)); + EXPECT_FLOAT_EQ(4.782959f, getStandardAirCharge()); } TEST(AirmassModes, AlphaNNormal) { @@ -47,7 +47,7 @@ TEST(AirmassModes, AlphaNNormal) { .WillOnce(Return(35.0f)); AlphaNAirmass dut(veTable); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); Sensor::setMockValue(SensorType::Tps1, 0.71f); @@ -66,7 +66,7 @@ TEST(AirmassModes, AlphaNFailedTps) { StrictMock veTable; AlphaNAirmass dut(veTable); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // explicitly reset the sensor Sensor::resetMockValue(SensorType::Tps1); @@ -88,7 +88,7 @@ TEST(AirmassModes, MafNormal) { .WillOnce(Return(75.0f)); MafAirmass dut(veTable); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); auto airmass = dut.getAirmassImpl(200, 6000); @@ -122,7 +122,7 @@ TEST(AirmassModes, VeOverride) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); DummyAirmassModel dut(veTable); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Use default mode - will call with 10 dut.getAirmass(0); @@ -135,7 +135,7 @@ TEST(AirmassModes, VeOverride) { EXPECT_FLOAT_EQ(ENGINE(engineState.currentVeLoad), 30.0f); } -void setInjectionMode(int value DECLARE_ENGINE_PARAMETER_SUFFIX); +void setInjectionMode(int value); TEST(FuelMath, testDifferentInjectionModes) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); @@ -144,20 +144,20 @@ TEST(FuelMath, testDifferentInjectionModes) { EXPECT_CALL(eth.mockAirmass, getAirmass(_)) .WillRepeatedly(Return(AirmassResult{1.3440001f, 50.0f})); - setInjectionMode((int)IM_BATCH PASS_ENGINE_PARAMETER_SUFFIX); - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + setInjectionMode((int)IM_BATCH); + engine->periodicFastCallback(); EXPECT_FLOAT_EQ( 20, engine->injectionDuration) << "injection while batch"; - setInjectionMode((int)IM_SIMULTANEOUS PASS_ENGINE_PARAMETER_SUFFIX); - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + setInjectionMode((int)IM_SIMULTANEOUS); + engine->periodicFastCallback(); EXPECT_FLOAT_EQ( 10, engine->injectionDuration) << "injection while simultaneous"; - setInjectionMode((int)IM_SEQUENTIAL PASS_ENGINE_PARAMETER_SUFFIX); - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + setInjectionMode((int)IM_SEQUENTIAL); + engine->periodicFastCallback(); EXPECT_FLOAT_EQ( 40, engine->injectionDuration) << "injection while IM_SEQUENTIAL"; - setInjectionMode((int)IM_SINGLE_POINT PASS_ENGINE_PARAMETER_SUFFIX); - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + setInjectionMode((int)IM_SINGLE_POINT); + engine->periodicFastCallback(); EXPECT_FLOAT_EQ( 40, engine->injectionDuration) << "injection while IM_SINGLE_POINT"; EXPECT_EQ( 0, eth.recentWarnings()->getCount()) << "warningCounter#testDifferentInjectionModes"; } @@ -171,13 +171,13 @@ TEST(FuelMath, deadtime) { .WillRepeatedly(Return(AirmassResult{1.3440001f, 50.0f})); // First test with no deadtime - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); EXPECT_FLOAT_EQ( 20, engine->injectionDuration); // Now add some deadtime setArrayValues(engineConfiguration->injector.battLagCorr, 2.0f); // Should have deadtime now! - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); EXPECT_FLOAT_EQ( 20 + 2, engine->injectionDuration); } diff --git a/unit_tests/tests/ignition_injection/test_fuel_wall_wetting.cpp b/unit_tests/tests/ignition_injection/test_fuel_wall_wetting.cpp index 0bb2809e67..42623ea563 100644 --- a/unit_tests/tests/ignition_injection/test_fuel_wall_wetting.cpp +++ b/unit_tests/tests/ignition_injection/test_fuel_wall_wetting.cpp @@ -20,8 +20,8 @@ TEST(fuel, testWallWettingEnrichmentMath) { WallFuel wallFuel; // each invocation of 'adjust' changes WallWetting internal state - ASSERT_NEAR(16.6666, wallFuel.adjust(10.0 PASS_ENGINE_PARAMETER_SUFFIX), EPS4D); - ASSERT_NEAR(16.198, wallFuel.adjust(10.0 PASS_ENGINE_PARAMETER_SUFFIX), EPS4D); + ASSERT_NEAR(16.6666, wallFuel.adjust(10.0), EPS4D); + ASSERT_NEAR(16.198, wallFuel.adjust(10.0), EPS4D); } TEST(fuel, testWallWettingEnrichmentScheduling) { @@ -31,7 +31,7 @@ TEST(fuel, testWallWettingEnrichmentScheduling) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->useOnlyRisingEdgeForTrigger = true; - eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_ONE); eth.fireTriggerEvents2(/* count */ 5, 25 /* ms */); @@ -46,9 +46,9 @@ TEST(fuel, testWallWettingEnrichmentScheduling) { // Cylinder 5 doesn't exist - shouldn't have been called! ASSERT_EQ(0, ENGINE(injectionEvents.elements[5]).wallFuel.invocationCounter); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); + eth.engine.periodicFastCallback(); + eth.engine.periodicFastCallback(); // still same 1 per cylinder - wall wetting is NOT invoked from 'periodicFastCallback' for (int i = 0; i < 4; i++) { diff --git a/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp b/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp index dd46e9b7a2..fb80f42129 100644 --- a/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp +++ b/unit_tests/tests/ignition_injection/test_ignition_scheduling.cpp @@ -24,7 +24,7 @@ TEST(ignition, twoCoils) { // let's recalculate with zero timing so that we can focus on relation advance between cylinders engine->engineState.timingAdvance = 0; - initializeIgnitionActions(PASS_ENGINE_PARAMETER_SIGNATURE); + initializeIgnitionActions(); ASSERT_EQ(engine->ignitionEvents.elements[0].sparkAngle, 0); ASSERT_EQ((void*)engine->ignitionEvents.elements[0].outputs[0], (void*)&enginePins.coils[0]); diff --git a/unit_tests/tests/ignition_injection/test_injector_model.cpp b/unit_tests/tests/ignition_injection/test_injector_model.cpp index cfed5d2626..2607d931a3 100644 --- a/unit_tests/tests/ignition_injection/test_injector_model.cpp +++ b/unit_tests/tests/ignition_injection/test_injector_model.cpp @@ -61,7 +61,7 @@ TEST(InjectorModel, getInjectionDurationNonlinear) { TEST(InjectorModel, nonlinearPolynomial) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); InjectorModel dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); CONFIG(applyNonlinearBelowPulse) = MS2US(10); @@ -89,7 +89,7 @@ TEST(InjectorModel, Deadtime) { } InjectorModel dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); Sensor::setMockValue(SensorType::BatteryVoltage, 3); EXPECT_EQ(dut.getDeadtime(), 6); @@ -122,7 +122,7 @@ TEST_P(FlowRateFixture, FlowRateRatio) { EXPECT_CALL(dut, getInjectorFlowRatio()).WillOnce(Return(flowRatio)); WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); engineConfiguration->injector.flow = 500; // 500 cc/min = 6g/s @@ -142,7 +142,7 @@ TEST_P(FlowRateFixture, PressureRatio) { EXPECT_CALL(dut, getAbsoluteRailPressure()).WillOnce(Return(400 * pressureRatio + fakeMap)); WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Use injector compensation engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; @@ -161,7 +161,7 @@ TEST(InjectorModel, NegativePressureDelta) { StrictMock dut; WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Use injector compensation engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; @@ -181,7 +181,7 @@ TEST(InjectorModel, VariableInjectorFlowModeNone) { StrictMock dut; WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); engineConfiguration->injectorCompensationMode = ICM_None; @@ -193,7 +193,7 @@ TEST(InjectorModel, RailPressureFixed) { InjectorModel dut; WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Reference pressure is 350kpa engineConfiguration->fuelReferencePressure = 350; @@ -207,7 +207,7 @@ TEST(InjectorModel, RailPressureSensed) { InjectorModel dut; WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Reference pressure is 350kpa engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; @@ -225,7 +225,7 @@ TEST(InjectorModel, FailedPressureSensor) { InjectorModel dut; WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Reference pressure is 350kpa engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; @@ -244,7 +244,7 @@ TEST(InjectorModel, MissingPressureSensor) { InjectorModel dut; WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Reference pressure is 350kpa engineConfiguration->injectorCompensationMode = ICM_SensedRailPressure; diff --git a/unit_tests/tests/ignition_injection/test_multispark.cpp b/unit_tests/tests/ignition_injection/test_multispark.cpp index e87c4b40d7..e33f7eefdd 100644 --- a/unit_tests/tests/ignition_injection/test_multispark.cpp +++ b/unit_tests/tests/ignition_injection/test_multispark.cpp @@ -11,17 +11,17 @@ TEST(Multispark, DefaultConfiguration) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - EXPECT_EQ(0, getMultiSparkCount(0 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(0, getMultiSparkCount(100 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(0, getMultiSparkCount(200 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(0, getMultiSparkCount(500 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(0, getMultiSparkCount(1000 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(0, getMultiSparkCount(2000 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(0, getMultiSparkCount(5000 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(0, getMultiSparkCount(50000 PASS_ENGINE_PARAMETER_SUFFIX)); + EXPECT_EQ(0, getMultiSparkCount(0 )); + EXPECT_EQ(0, getMultiSparkCount(100 )); + EXPECT_EQ(0, getMultiSparkCount(200 )); + EXPECT_EQ(0, getMultiSparkCount(500 )); + EXPECT_EQ(0, getMultiSparkCount(1000 )); + EXPECT_EQ(0, getMultiSparkCount(2000 )); + EXPECT_EQ(0, getMultiSparkCount(5000 )); + EXPECT_EQ(0, getMultiSparkCount(50000 )); } -static void multisparkCfg(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void multisparkCfg() { // Turn it on! CONFIG(multisparkEnable) = true; @@ -39,36 +39,36 @@ static void multisparkCfg(DECLARE_ENGINE_PARAMETER_SIGNATURE) { TEST(Multispark, EnabledNoMaxRpm) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - multisparkCfg(PASS_ENGINE_PARAMETER_SIGNATURE); + multisparkCfg(); // Practically no RPM limit CONFIG(multisparkMaxRpm) = 65000; - EXPECT_EQ(0, getMultiSparkCount(0 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(10, getMultiSparkCount(150 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(10, getMultiSparkCount(250 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(4, getMultiSparkCount(550 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(3, getMultiSparkCount(800 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(2, getMultiSparkCount(900 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(1, getMultiSparkCount(1500 PASS_ENGINE_PARAMETER_SUFFIX)); + EXPECT_EQ(0, getMultiSparkCount(0 )); + EXPECT_EQ(10, getMultiSparkCount(150 )); + EXPECT_EQ(10, getMultiSparkCount(250 )); + EXPECT_EQ(4, getMultiSparkCount(550 )); + EXPECT_EQ(3, getMultiSparkCount(800 )); + EXPECT_EQ(2, getMultiSparkCount(900 )); + EXPECT_EQ(1, getMultiSparkCount(1500 )); // 2500 is the threshold where we should get zero - EXPECT_EQ(1, getMultiSparkCount(2499 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(0, getMultiSparkCount(2501 PASS_ENGINE_PARAMETER_SUFFIX)); + EXPECT_EQ(1, getMultiSparkCount(2499 )); + EXPECT_EQ(0, getMultiSparkCount(2501 )); - EXPECT_EQ(0, getMultiSparkCount(5000 PASS_ENGINE_PARAMETER_SUFFIX)); + EXPECT_EQ(0, getMultiSparkCount(5000 )); - EXPECT_EQ(0, getMultiSparkCount(50000 PASS_ENGINE_PARAMETER_SUFFIX)); + EXPECT_EQ(0, getMultiSparkCount(50000 )); } TEST(Multispark, RpmLimit) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - multisparkCfg(PASS_ENGINE_PARAMETER_SIGNATURE); + multisparkCfg(); // Disable at 800 rpm CONFIG(multisparkMaxRpm) = 800; - EXPECT_EQ(3, getMultiSparkCount(795 PASS_ENGINE_PARAMETER_SUFFIX)); - EXPECT_EQ(0, getMultiSparkCount(805 PASS_ENGINE_PARAMETER_SUFFIX)); + EXPECT_EQ(3, getMultiSparkCount(795)); + EXPECT_EQ(0, getMultiSparkCount(805)); } diff --git a/unit_tests/tests/ignition_injection/test_one_cylinder_logic.cpp b/unit_tests/tests/ignition_injection/test_one_cylinder_logic.cpp index b82a0bd4be..3d1d63a269 100644 --- a/unit_tests/tests/ignition_injection/test_one_cylinder_logic.cpp +++ b/unit_tests/tests/ignition_injection/test_one_cylinder_logic.cpp @@ -15,7 +15,7 @@ TEST(issues, issueOneCylinderSpecialCase968) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->useOnlyRisingEdgeForTrigger = true; - eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_ONE); ASSERT_EQ( 0, engine->executor.size()) << "start"; diff --git a/unit_tests/tests/ignition_injection/test_startOfCrankingPrimingPulse.cpp b/unit_tests/tests/ignition_injection/test_startOfCrankingPrimingPulse.cpp index 985800726f..8bcf1d0bdf 100644 --- a/unit_tests/tests/ignition_injection/test_startOfCrankingPrimingPulse.cpp +++ b/unit_tests/tests/ignition_injection/test_startOfCrankingPrimingPulse.cpp @@ -43,7 +43,7 @@ TEST(engine, testStartOfCrankingPrimingPulse) { Sensor::setMockValue(SensorType::Clt, -10); // prod code invokes this on ECU start, here we have to mimic this behavior - startPrimeInjectionPulse(PASS_ENGINE_PARAMETER_SIGNATURE); + startPrimeInjectionPulse(); ASSERT_EQ( 1, engine->executor.size()) << "prime fuel"; diff --git a/unit_tests/tests/lua/test_lua_with_engine.cpp b/unit_tests/tests/lua/test_lua_with_engine.cpp index e265671dba..b5927886ec 100644 --- a/unit_tests/tests/lua/test_lua_with_engine.cpp +++ b/unit_tests/tests/lua/test_lua_with_engine.cpp @@ -24,7 +24,7 @@ TEST(LuaHooks, TestCurve) { strcpy(engineConfiguration->scriptCurveName[3], "hello"); setLinearCurve(engineConfiguration->scriptCurve4, 500, 600, 1); - int index = getCurveIndexByName("helLO" PASS_ENGINE_PARAMETER_SUFFIX); + int index = getCurveIndexByName("helLO"); ASSERT_EQ(index, 3); EXPECT_EQ(testLuaReturnsNumberOrNil(curveTestScript).value_or(0), 540); diff --git a/unit_tests/tests/sensor/test_cj125.cpp b/unit_tests/tests/sensor/test_cj125.cpp index b2440769ef..9522e111a2 100644 --- a/unit_tests/tests/sensor/test_cj125.cpp +++ b/unit_tests/tests/sensor/test_cj125.cpp @@ -24,7 +24,7 @@ TEST(testCJ125, testInitialState) { WITH_ENGINE_TEST_HELPER(FORD_ASPIRE_1996); - cj.StartHeaterControl(PASS_ENGINE_PARAMETER_SIGNATURE); + cj.StartHeaterControl(); ASSERT_EQ(cj.heaterDuty, CJ125_HEATER_IDLE_RATE); TestSpi mock; @@ -35,7 +35,7 @@ TEST(testCJ125, testInitialState) { EXPECT_CALL(mock, ReadRegister(INIT_REG2_RD)).Times(1).WillOnce(Return(CJ125_INIT2_DIAG)); EXPECT_CALL(mock, ReadRegister(DIAG_REG_RD)).Times(1); - cj.cjIdentify(PASS_ENGINE_PARAMETER_SIGNATURE); + cj.cjIdentify(); // validate that error state was not set ASSERT_EQ(cj.state, CJ125_INIT); } @@ -51,7 +51,7 @@ TEST(testCJ125, testFailedIdentify) { WITH_ENGINE_TEST_HELPER(FORD_ASPIRE_1996); - cj.cjIdentify(PASS_ENGINE_PARAMETER_SIGNATURE); + cj.cjIdentify(); ASSERT_EQ(cj.errorCode, CJ125_ERROR_WRONG_IDENT); ASSERT_EQ(cj.state, CJ125_ERROR); } diff --git a/unit_tests/tests/sensor/test_sensor_init.cpp b/unit_tests/tests/sensor/test_sensor_init.cpp index 0b5fcf20d4..79b2e245b9 100644 --- a/unit_tests/tests/sensor/test_sensor_init.cpp +++ b/unit_tests/tests/sensor/test_sensor_init.cpp @@ -29,7 +29,7 @@ TEST(SensorInit, Tps) { CONFIG(tpsMin) = 200; // 1 volt CONFIG(tpsMax) = 800; // 4 volts - initTps(PASS_CONFIG_PARAMETER_SIGNATURE); + initTps(); // Ensure the sensors were registered auto s = const_cast(Sensor::getSensorOfType(SensorType::Tps1Primary)); @@ -55,25 +55,25 @@ TEST(SensorInit, TpsValuesTooClose) { // Should fail, 0.49 volts apart CONFIG(tpsMin) = 200; // 1.00 volt CONFIG(tpsMax) = 298; // 1.49 volts - EXPECT_FATAL_ERROR(initTps(PASS_CONFIG_PARAMETER_SIGNATURE)); + EXPECT_FATAL_ERROR(initTps()); Sensor::resetRegistry(); // Should fail, -0.49 volts apart CONFIG(tpsMin) = 298; // 1.49 volt CONFIG(tpsMax) = 200; // 1.00 volts - EXPECT_FATAL_ERROR(initTps(PASS_CONFIG_PARAMETER_SIGNATURE)); + EXPECT_FATAL_ERROR(initTps()); Sensor::resetRegistry(); // Should succeed, 0.51 volts apart CONFIG(tpsMin) = 200; // 1.00 volt CONFIG(tpsMax) = 302; // 1.51 volts - EXPECT_NO_FATAL_ERROR(initTps(PASS_CONFIG_PARAMETER_SIGNATURE)); + EXPECT_NO_FATAL_ERROR(initTps()); Sensor::resetRegistry(); // Should succeed, -0.51 volts apart CONFIG(tpsMin) = 302; // 1.51 volt CONFIG(tpsMax) = 200; // 1.00 volts - EXPECT_NO_FATAL_ERROR(initTps(PASS_CONFIG_PARAMETER_SIGNATURE)); + EXPECT_NO_FATAL_ERROR(initTps()); Sensor::resetRegistry(); // With no pin, it should be ok that they are the same @@ -81,19 +81,19 @@ TEST(SensorInit, TpsValuesTooClose) { CONFIG(tps1_1AdcChannel) = EFI_ADC_NONE; CONFIG(tpsMin) = 200; // 1.00 volt CONFIG(tpsMax) = 200; // 1.00 volts - EXPECT_NO_FATAL_ERROR(initTps(PASS_CONFIG_PARAMETER_SIGNATURE)); + EXPECT_NO_FATAL_ERROR(initTps()); Sensor::resetRegistry(); // Test a random bogus pin index, shouldn't fail CONFIG(tps1_1AdcChannel) = static_cast(175); CONFIG(tpsMin) = 200; // 1.00 volt CONFIG(tpsMax) = 200; // 1.00 volt - EXPECT_NO_FATAL_ERROR(initTps(PASS_CONFIG_PARAMETER_SIGNATURE)); + EXPECT_NO_FATAL_ERROR(initTps()); Sensor::resetRegistry(); // de-init and re-init should also work without error EXPECT_NO_FATAL_ERROR(deinitTps()); - EXPECT_NO_FATAL_ERROR(initTps(PASS_CONFIG_PARAMETER_SIGNATURE)); + EXPECT_NO_FATAL_ERROR(initTps()); } TEST(SensorInit, Pedal) { @@ -103,7 +103,7 @@ TEST(SensorInit, Pedal) { CONFIG(throttlePedalUpVoltage) = 1; CONFIG(throttlePedalWOTVoltage) = 4; - initTps(PASS_CONFIG_PARAMETER_SIGNATURE); + initTps(); // Ensure the sensors were registered auto s = const_cast(Sensor::getSensorOfType(SensorType::AcceleratorPedalPrimary)); @@ -129,7 +129,7 @@ TEST(SensorInit, DriverIntentNoPedal) { // We have no pedal - so we should get the TPS CONFIG(throttlePedalPositionAdcChannel) = EFI_ADC_NONE; - initTps(PASS_CONFIG_PARAMETER_SIGNATURE); + initTps(); // Ensure a sensor got set ASSERT_TRUE(Sensor::hasSensor(SensorType::DriverThrottleIntent)); @@ -149,7 +149,7 @@ TEST(SensorInit, DriverIntentWithPedal) { // We have a pedal, so we should get it CONFIG(throttlePedalPositionAdcChannel) = EFI_ADC_0; - initTps(PASS_CONFIG_PARAMETER_SIGNATURE); + initTps(); // Ensure a sensor got set ASSERT_TRUE(Sensor::hasSensor(SensorType::DriverThrottleIntent)); @@ -171,7 +171,7 @@ TEST(SensorInit, OilPressure) { CONFIG(oilPressure.value1) = 0; CONFIG(oilPressure.value2) = 1000; - initOilPressure(PASS_CONFIG_PARAMETER_SIGNATURE); + initOilPressure(); // Ensure the sensors were registered auto s = const_cast(Sensor::getSensorOfType(SensorType::OilPressure)); @@ -193,7 +193,7 @@ TEST(SensorInit, Clt) { // 2003 neon sensor CONFIG(clt.config) = {0, 30, 100, 32500, 7550, 700, 2700}; - initThermistors(PASS_CONFIG_PARAMETER_SIGNATURE); + initThermistors(); // Ensure the sensors were registered auto s = const_cast(Sensor::getSensorOfType(SensorType::Clt)); @@ -212,7 +212,7 @@ TEST(SensorInit, Clt) { TEST(SensorInit, Lambda) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - initLambda(PASS_ENGINE_PARAMETER_SIGNATURE); + initLambda(); auto s = Sensor::getSensorOfType(SensorType::Lambda1); ASSERT_NE(nullptr, s); @@ -221,7 +221,7 @@ TEST(SensorInit, Lambda) { TEST(SensorInit, Map) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - initMap(PASS_ENGINE_PARAMETER_SIGNATURE); + initMap(); auto s = Sensor::getSensorOfType(SensorType::Map); ASSERT_NE(nullptr, s); diff --git a/unit_tests/tests/sensor/test_turbocharger_speed_converter.cpp b/unit_tests/tests/sensor/test_turbocharger_speed_converter.cpp index 55b1db99b4..8693494684 100644 --- a/unit_tests/tests/sensor/test_turbocharger_speed_converter.cpp +++ b/unit_tests/tests/sensor/test_turbocharger_speed_converter.cpp @@ -13,7 +13,7 @@ public: } void SetUp() override { - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); } void SetCoef(float new_coef) { diff --git a/unit_tests/tests/sensor/test_vehicle_speed_converter.cpp b/unit_tests/tests/sensor/test_vehicle_speed_converter.cpp index 7595dce579..cb0e350d12 100644 --- a/unit_tests/tests/sensor/test_vehicle_speed_converter.cpp +++ b/unit_tests/tests/sensor/test_vehicle_speed_converter.cpp @@ -13,7 +13,7 @@ public: } void SetUp() override { - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); } void SetCoef(float new_coef) { diff --git a/unit_tests/tests/test_accel_enrichment.cpp b/unit_tests/tests/test_accel_enrichment.cpp index 5e1e86d60b..4cc15e3c11 100644 --- a/unit_tests/tests/test_accel_enrichment.cpp +++ b/unit_tests/tests/test_accel_enrichment.cpp @@ -18,25 +18,25 @@ TEST(fuel, testTpsAccelEnrichmentMath) { WITH_ENGINE_TEST_HELPER(FORD_ASPIRE_1996); engine->rpmCalculator.setRpmValue(600); - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); engine->tpsAccelEnrichment.setLength(4); - engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta"; - engine->tpsAccelEnrichment.onNewValue(10 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 10, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#1"; - engine->tpsAccelEnrichment.onNewValue(30 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 20, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#2"; + engine->tpsAccelEnrichment.onNewValue(0); + ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta()) << "maxDelta"; + engine->tpsAccelEnrichment.onNewValue(10); + ASSERT_EQ( 10, engine->tpsAccelEnrichment.getMaxDelta()) << "maxDelta#1"; + engine->tpsAccelEnrichment.onNewValue(30); + ASSERT_EQ( 20, engine->tpsAccelEnrichment.getMaxDelta()) << "maxDelta#2"; - engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 20, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#3"; - engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 20, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#4"; - engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta#5"; - engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX); - ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta(PASS_ENGINE_PARAMETER_SIGNATURE)) << "maxDelta"; + engine->tpsAccelEnrichment.onNewValue(0); + ASSERT_EQ( 20, engine->tpsAccelEnrichment.getMaxDelta()) << "maxDelta#3"; + engine->tpsAccelEnrichment.onNewValue(0); + ASSERT_EQ( 20, engine->tpsAccelEnrichment.getMaxDelta()) << "maxDelta#4"; + engine->tpsAccelEnrichment.onNewValue(0); + ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta()) << "maxDelta#5"; + engine->tpsAccelEnrichment.onNewValue(0); + ASSERT_EQ( 0, engine->tpsAccelEnrichment.getMaxDelta()) << "maxDelta"; } TEST(fuel, testTpsAccelEnrichmentScheduling) { @@ -45,7 +45,7 @@ TEST(fuel, testTpsAccelEnrichmentScheduling) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); engineConfiguration->useOnlyRisingEdgeForTrigger = true; - eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_ONE); Sensor::setMockValue(SensorType::Tps1, 7); @@ -60,31 +60,31 @@ TEST(fuel, testTpsAccelEnrichmentScheduling) { float expectedAEValue = 29.2; // it does not matter how many times we invoke 'getTpsEnrichment' - state does not change for (int i = 0; i <20;i++) { - ASSERT_NEAR(expectedAEValue, ENGINE(tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE)), EPS4D); + ASSERT_NEAR(expectedAEValue, ENGINE(tpsAccelEnrichment.getTpsEnrichment()), EPS4D); } expectedInvocationCounter++; ASSERT_EQ(expectedInvocationCounter, ENGINE(tpsAccelEnrichment).onUpdateInvocationCounter); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); + eth.engine.periodicFastCallback(); + eth.engine.periodicFastCallback(); ASSERT_EQ(expectedInvocationCounter, ENGINE(tpsAccelEnrichment).onUpdateInvocationCounter); } -static void doFractionalTpsIteration(int period, int divisor, int numCycles, std::vector &tpsEnrich DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void doFractionalTpsIteration(int period, int divisor, int numCycles, std::vector &tpsEnrich) { // every cycle engineConfiguration->tpsAccelFractionPeriod = period; // split into 2 portions engineConfiguration->tpsAccelFractionDivisor = divisor; engine->tpsAccelEnrichment.resetAE(); - engine->tpsAccelEnrichment.onNewValue(0 PASS_ENGINE_PARAMETER_SUFFIX); + engine->tpsAccelEnrichment.onNewValue(0); for (int i = 0; i < numCycles; i++) { - engine->tpsAccelEnrichment.onNewValue(10 PASS_ENGINE_PARAMETER_SUFFIX); - engine->tpsAccelEnrichment.onEngineCycleTps(PASS_ENGINE_PARAMETER_SIGNATURE); - tpsEnrich[i] = engine->tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->tpsAccelEnrichment.onNewValue(10); + engine->tpsAccelEnrichment.onEngineCycleTps(); + tpsEnrich[i] = engine->tpsAccelEnrichment.getTpsEnrichment(); } } @@ -104,10 +104,10 @@ TEST(fuel, testAccelEnrichmentFractionalTps) { } } - initAccelEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE); + initAccelEnrichment(); engine->rpmCalculator.setRpmValue(600); - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); engine->tpsAccelEnrichment.setLength(2); @@ -116,23 +116,23 @@ TEST(fuel, testAccelEnrichmentFractionalTps) { std::vector tpsEnrich(numCycles); // first, test the default behavior without fractional division - doFractionalTpsIteration(1, 1, numCycles, tpsEnrich PASS_ENGINE_PARAMETER_SUFFIX); + doFractionalTpsIteration(1, 1, numCycles, tpsEnrich); // the portion for the first cycle is full-enriched and there's no enrichment for next cycles EXPECT_THAT(tpsEnrich, testing::ElementsAre(1.0f, 0.0f, 0.0f, 0.0f)) << "fractionalTps#1"; // divide into 2 each cycle - doFractionalTpsIteration(1, 2, numCycles, tpsEnrich PASS_ENGINE_PARAMETER_SUFFIX); + doFractionalTpsIteration(1, 2, numCycles, tpsEnrich); // we have half-portion for the first cycle, then 1/4-th and 1/8th and so on... EXPECT_THAT(tpsEnrich, testing::ElementsAre(0.5f, 0.25f, 0.125f, 0.0625f)) << "fractionalTps#2"; // split every portion into 3 sub-portions (so the whole enrichment takes longer) - doFractionalTpsIteration(3, 1, numCycles, tpsEnrich PASS_ENGINE_PARAMETER_SUFFIX); + doFractionalTpsIteration(3, 1, numCycles, tpsEnrich); // we have 1/3rd-portion for the first three cycles const float th = (1.0f / 3.0f); EXPECT_THAT(tpsEnrich, testing::ElementsAre(testing::FloatEq(th), testing::FloatEq(th), testing::FloatEq(th), 0.0f)) << "fractionalTps#3"; // split every divided portion into 2 sub-portions (so the whole enrichment takes longer) - doFractionalTpsIteration(2, 2, numCycles, tpsEnrich PASS_ENGINE_PARAMETER_SUFFIX); + doFractionalTpsIteration(2, 2, numCycles, tpsEnrich); // we have half-portion for the first two cycles, and 1/4-th portion for the next 2 cycles, and so on... EXPECT_THAT(tpsEnrich, testing::ElementsAre(0.25f, 0.25f, 0.125f, 0.125f)) << "fractionalTps#4"; diff --git a/unit_tests/tests/test_boost.cpp b/unit_tests/tests/test_boost.cpp index 49ec8c66c7..2424b5f4f9 100644 --- a/unit_tests/tests/test_boost.cpp +++ b/unit_tests/tests/test_boost.cpp @@ -16,7 +16,7 @@ TEST(BoostControl, Setpoint) { engineConfiguration->boostType = CLOSED_LOOP; BoostController bc; - bc.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + bc.inject(); // Should return unexpected without a pedal map cfg'd EXPECT_EQ(bc.getSetpoint(), unexpected); @@ -36,7 +36,7 @@ TEST(BoostControl, ObservePlant) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); BoostController bc; - bc.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + bc.inject(); Sensor::resetMockValue(SensorType::Map); // Check that invalid MAP returns unexpected @@ -58,7 +58,7 @@ TEST(BoostControl, OpenLoop) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); BoostController bc; - bc.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + bc.inject(); // Without table set, should return unexpected EXPECT_EQ(bc.getOpenLoop(0), unexpected); @@ -74,7 +74,7 @@ TEST(BoostControl, ClosedLoop) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); BoostController bc; - bc.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + bc.inject(); pid_s pidCfg = { 1, 0, 0, // P controller, easier to test @@ -116,7 +116,7 @@ TEST(BoostControl, SetOutput) { StrictMock pwm; StrictMock etb; BoostController bc; - bc.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + bc.inject(); // ETB wastegate position & PWM should both be set EXPECT_CALL(etb, setWastegatePosition(25.0f)); diff --git a/unit_tests/tests/test_change_engine_type.cpp b/unit_tests/tests/test_change_engine_type.cpp index 9aea88e5f1..84a210bca0 100644 --- a/unit_tests/tests/test_change_engine_type.cpp +++ b/unit_tests/tests/test_change_engine_type.cpp @@ -20,17 +20,17 @@ TEST(misc, changeEngineType) { ASSERT_TRUE(activeConfiguration.triggerInputDebugPins[0] != GPIO_UNASSIGNED); int pinIndex = brainPin_to_index(brainPin); - ASSERT_TRUE(nullptr != getBrainUsedPin(pinIndex PASS_ENGINE_PARAMETER_SUFFIX)); + ASSERT_TRUE(nullptr != getBrainUsedPin(pinIndex)); // above we have asserted that triggerInputDebugPins is in fact used // now let's change into engine type without triggerInputDebugPins and assert shut down - setEngineType((int)CITROEN_TU3JP PASS_ENGINE_PARAMETER_SUFFIX); + setEngineType((int)CITROEN_TU3JP); ASSERT_TRUE(activeConfiguration.triggerInputDebugPins[0] == GPIO_UNASSIGNED); ASSERT_TRUE(engineConfiguration->triggerInputDebugPins[0] == GPIO_UNASSIGNED); ASSERT_TRUE(engineConfiguration->triggerInputDebugPins[0] == GPIO_UNASSIGNED); - ASSERT_TRUE(nullptr == getBrainUsedPin(pinIndex PASS_ENGINE_PARAMETER_SUFFIX)); + ASSERT_TRUE(nullptr == getBrainUsedPin(pinIndex)); } diff --git a/unit_tests/tests/test_dynoview.cpp b/unit_tests/tests/test_dynoview.cpp index 9d55e28d9c..b14024826b 100644 --- a/unit_tests/tests/test_dynoview.cpp +++ b/unit_tests/tests/test_dynoview.cpp @@ -20,7 +20,7 @@ TEST(DynoView, VSS_T1) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); DynoView dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Test Speed trashold engineConfiguration->vehicleWeight = 900; @@ -40,7 +40,7 @@ TEST(DynoView, algo) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); DynoView dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Test Speed trashold engineConfiguration->vehicleWeight = 900; @@ -65,7 +65,7 @@ TEST(DynoView, VSS_fast) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); DynoView dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Test Speed trashold engineConfiguration->vehicleWeight = 900; //kg @@ -89,7 +89,7 @@ TEST(DynoView, VSS_Torque) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); DynoView dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Test Speed trashold engineConfiguration->vehicleWeight = 900; //kg diff --git a/unit_tests/tests/test_engine_math.cpp b/unit_tests/tests/test_engine_math.cpp index 70be2ac862..4006b9adf2 100644 --- a/unit_tests/tests/test_engine_math.cpp +++ b/unit_tests/tests/test_engine_math.cpp @@ -24,7 +24,7 @@ TEST(misc, testIgnitionPlanning) { printf("*************************************************** testIgnitionPlanning\r\n"); WITH_ENGINE_TEST_HELPER(FORD_ESCORT_GT); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); assertEqualsM("testIgnitionPlanning_AFR", 13.5, eth.engine.engineState.targetAFR); ASSERT_EQ(IM_BATCH, engineConfiguration->injectionMode); @@ -42,14 +42,14 @@ TEST(misc, testEngineMath) { Sensor::setMockValue(SensorType::Clt, 300); Sensor::setMockValue(SensorType::Iat, 350); - ASSERT_FLOAT_EQ(312.5, getTCharge(1000, 0 PASS_ENGINE_PARAMETER_SUFFIX)); - ASSERT_FLOAT_EQ(313.5833, getTCharge(1000, 50 PASS_ENGINE_PARAMETER_SUFFIX)); - ASSERT_FLOAT_EQ(314.6667, getTCharge(1000, 100 PASS_ENGINE_PARAMETER_SUFFIX)); + ASSERT_FLOAT_EQ(312.5, getTCharge(1000, 0)); + ASSERT_FLOAT_EQ(313.5833, getTCharge(1000, 50)); + ASSERT_FLOAT_EQ(314.6667, getTCharge(1000, 100)); - ASSERT_FLOAT_EQ(312.5, getTCharge(4000, 0 PASS_ENGINE_PARAMETER_SUFFIX)); - ASSERT_FLOAT_EQ(320.0833, getTCharge(4000, 50 PASS_ENGINE_PARAMETER_SUFFIX)); - ASSERT_FLOAT_EQ(327.6667, getTCharge(4000, 100 PASS_ENGINE_PARAMETER_SUFFIX)); + ASSERT_FLOAT_EQ(312.5, getTCharge(4000, 0)); + ASSERT_FLOAT_EQ(320.0833, getTCharge(4000, 50)); + ASSERT_FLOAT_EQ(327.6667, getTCharge(4000, 100)); // test Air Interpolation mode engineConfiguration->tChargeMode = TCHARGE_MODE_AIR_INTERP; @@ -57,13 +57,13 @@ TEST(misc, testEngineMath) { engineConfiguration->tChargeAirCoefMax = 0.902f; engineConfiguration->tChargeAirFlowMax = 153.6f; // calc. some airMass given the engine displacement=1.839 and 4 cylinders (FORD_ESCORT_GT) - engine->engineState.sd.airMassInOneCylinder = SpeedDensityBase::getAirmassImpl(/*VE*/1.0f, /*MAP*/100.0f, /*tChargeK*/273.15f + 20.0f PASS_ENGINE_PARAMETER_SUFFIX); + engine->engineState.sd.airMassInOneCylinder = SpeedDensityBase::getAirmassImpl(/*VE*/1.0f, /*MAP*/100.0f, /*tChargeK*/273.15f + 20.0f); ASSERT_NEAR(0.5464f, engine->engineState.sd.airMassInOneCylinder, EPS4D); Sensor::setMockValue(SensorType::Clt, 90); Sensor::setMockValue(SensorType::Iat, 20); // calc. airFlow using airMass, and find tCharge - ASSERT_FLOAT_EQ(59.1175f, getTCharge(/*RPM*/1000, /*TPS*/0 PASS_ENGINE_PARAMETER_SUFFIX)); + ASSERT_FLOAT_EQ(59.1175f, getTCharge(/*RPM*/1000, /*TPS*/0)); ASSERT_FLOAT_EQ(65.5625f/*kg/h*/, engine->engineState.airFlow); } diff --git a/unit_tests/tests/test_etb.cpp b/unit_tests/tests/test_etb.cpp index d4417a881c..f03329aef2 100644 --- a/unit_tests/tests/test_etb.cpp +++ b/unit_tests/tests/test_etb.cpp @@ -30,7 +30,7 @@ TEST(etb, initializationNoPedal) { EXPECT_CALL(mocks[1], init(ETB_Throttle2, _, _, _, false)).WillOnce(Return(false)); // This shouldn't throw, since no throttles are configured, but no pedal is configured either - EXPECT_NO_FATAL_ERROR(doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE)); + EXPECT_NO_FATAL_ERROR(doInitElectronicThrottle()); } TEST(etb, initializationMissingThrottle) { @@ -53,7 +53,7 @@ TEST(etb, initializationMissingThrottle) { Sensor::setMockValue(SensorType::AcceleratorPedalPrimary, 0); // This should throw: a pedal is configured but no throttles - EXPECT_FATAL_ERROR(doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE)); + EXPECT_FATAL_ERROR(doInitElectronicThrottle()); } TEST(etb, initializationSingleThrottle) { @@ -78,7 +78,7 @@ TEST(etb, initializationSingleThrottle) { // Expect mock1 to be init as none EXPECT_CALL(mocks[1], init(ETB_None, _, _, _, true)).Times(0); - doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE); + doInitElectronicThrottle(); } TEST(etb, initializationSingleThrottleInSecondSlot) { @@ -103,7 +103,7 @@ TEST(etb, initializationSingleThrottleInSecondSlot) { // Expect mock1 to be init as throttle 1, and PID params EXPECT_CALL(mocks[1], init(ETB_Throttle1, _, &engineConfiguration->etb, Ne(nullptr), true)).WillOnce(Return(true)); - doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE); + doInitElectronicThrottle(); } TEST(etb, initializationDualThrottle) { @@ -131,7 +131,7 @@ TEST(etb, initializationDualThrottle) { // Expect mock1 to be init as throttle 2, and PID params EXPECT_CALL(mocks[1], init(ETB_Throttle2, _, &engineConfiguration->etb, Ne(nullptr), true)).WillOnce(Return(true)); - doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE); + doInitElectronicThrottle(); } TEST(etb, initializationWastegate) { @@ -152,7 +152,7 @@ TEST(etb, initializationWastegate) { // Expect mock1 to be init as none EXPECT_CALL(mocks[1], init(ETB_None, _, _, _, false)).Times(0); - doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE); + doInitElectronicThrottle(); } TEST(etb, initializationNoFunction) { @@ -234,7 +234,7 @@ TEST(etb, initializationNoThrottles) { Sensor::setMockValue(SensorType::Tps1Primary, 0); Sensor::setMockValue(SensorType::Tps1, 0.0f, false); - EXPECT_NO_FATAL_ERROR(doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE)); + EXPECT_NO_FATAL_ERROR(doInitElectronicThrottle()); } TEST(etb, idlePlumbing) { @@ -251,7 +251,7 @@ TEST(etb, idlePlumbing) { EXPECT_CALL(mocks[i], setIdlePosition(33.0f)); } - applyIACposition(33.0f PASS_ENGINE_PARAMETER_SUFFIX); + applyIACposition(33.0f); } TEST(etb, testSetpointOnlyPedal) { @@ -261,7 +261,7 @@ TEST(etb, testSetpointOnlyPedal) { engineConfiguration->useETBforIdleControl = false; EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); // Mock pedal map that's just passthru pedal -> target StrictMock pedalMap; @@ -337,7 +337,7 @@ TEST(etb, setpointIdle) { Sensor::setMockValue(SensorType::AcceleratorPedal, 0.0f, true); EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); // Mock pedal map that's just passthru pedal -> target StrictMock pedalMap; @@ -395,7 +395,7 @@ TEST(etb, setpointRevLimit) { Sensor::setMockValue(SensorType::AcceleratorPedal, 0.0f, true); EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); // Mock pedal map to just return 80% StrictMock pedalMap; @@ -527,7 +527,7 @@ TEST(etb, setOutputInvalid) { StrictMock motor; EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); etb.init(ETB_Throttle1, &motor, nullptr, nullptr, true); // Should be disabled in case of unexpected @@ -546,7 +546,7 @@ TEST(etb, setOutputValid) { Sensor::setMockValue(SensorType::AcceleratorPedal, 0.0f, true); EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); etb.init(ETB_Throttle1, &motor, nullptr, nullptr, true); // Should be enabled and value set @@ -567,7 +567,7 @@ TEST(etb, setOutputValid2) { Sensor::setMockValue(SensorType::AcceleratorPedal, 0.0f, true); EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); etb.init(ETB_Throttle1, &motor, nullptr, nullptr, true); // Should be enabled and value set @@ -588,7 +588,7 @@ TEST(etb, setOutputOutOfRangeHigh) { Sensor::setMockValue(SensorType::AcceleratorPedal, 0.0f, true); EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); etb.init(ETB_Throttle1, &motor, nullptr, nullptr, true); // Should be enabled and value set @@ -609,7 +609,7 @@ TEST(etb, setOutputOutOfRangeLow) { Sensor::setMockValue(SensorType::AcceleratorPedal, 0.0f, true); EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); etb.init(ETB_Throttle1, &motor, nullptr, nullptr, true); // Should be enabled and value set @@ -630,7 +630,7 @@ TEST(etb, setOutputPauseControl) { Sensor::setMockValue(SensorType::AcceleratorPedal, 0.0f, true); EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); etb.init(ETB_Throttle1, &motor, nullptr, nullptr, true); // Pause control - should get no output @@ -652,7 +652,7 @@ TEST(etb, setOutputLimpHome) { Sensor::setMockValue(SensorType::AcceleratorPedal, 0.0f, true); EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); etb.init(ETB_Throttle1, &motor, nullptr, nullptr, true); // Should be disabled when in ETB limp mode @@ -702,7 +702,7 @@ TEST(etb, openLoopThrottle) { Sensor::setMockValue(SensorType::AcceleratorPedal, 0, true); EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); etb.init(ETB_Throttle1, nullptr, nullptr, nullptr, true); // Map [0, 100] -> [-50, 50] @@ -725,7 +725,7 @@ TEST(etb, openLoopNonThrottle) { Sensor::setMockValue(SensorType::AcceleratorPedal, 0, true); EtbController etb; - etb.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + etb.inject(); etb.init(ETB_Wastegate, nullptr, nullptr, nullptr, false); // Map [0, 100] -> [-50, 50] diff --git a/unit_tests/tests/test_fan_control.cpp b/unit_tests/tests/test_fan_control.cpp index b202278fbd..636c2dd0e3 100644 --- a/unit_tests/tests/test_fan_control.cpp +++ b/unit_tests/tests/test_fan_control.cpp @@ -11,60 +11,60 @@ TEST(FanControl, fan1) { // Cold, fan should be off Sensor::setMockValue(SensorType::Clt, 75); - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(false, enginePins.fanRelay.getLogicValue()); // Between thresholds, should still be off Sensor::setMockValue(SensorType::Clt, 85); - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(false, enginePins.fanRelay.getLogicValue()); // Hot, fan should turn on Sensor::setMockValue(SensorType::Clt, 95); - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(true, enginePins.fanRelay.getLogicValue()); // Between thresholds, should stay on Sensor::setMockValue(SensorType::Clt, 85); - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(true, enginePins.fanRelay.getLogicValue()); // Below threshold, should turn off Sensor::setMockValue(SensorType::Clt, 75); - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(false, enginePins.fanRelay.getLogicValue()); engineConfiguration->enableFan1WithAc = true; // Now AC is on, fan should turn on! - updateFans(true PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(true); EXPECT_EQ(true, enginePins.fanRelay.getLogicValue()); // Turn off AC, fan should turn off too. - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(false, enginePins.fanRelay.getLogicValue()); // Back to hot, fan should turn on Sensor::setMockValue(SensorType::Clt, 95); - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(true, enginePins.fanRelay.getLogicValue()); // Engine starts cranking, fan should turn off ENGINE(rpmCalculator).setRpmValue(100); - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(false, enginePins.fanRelay.getLogicValue()); // Engine running, fan should turn back on ENGINE(rpmCalculator).setRpmValue(1000); - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(true, enginePins.fanRelay.getLogicValue()); // Stop the engine, fan should stay on ENGINE(rpmCalculator).setRpmValue(0); - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(true, enginePins.fanRelay.getLogicValue()); // Set configuration to inhibit fan while engine is stopped, fan should stop engineConfiguration->disableFan1WhenStopped = true; - updateFans(false PASS_ENGINE_PARAMETER_SUFFIX); + updateFans(false); EXPECT_EQ(false, enginePins.fanRelay.getLogicValue()); } diff --git a/unit_tests/tests/test_gppwm.cpp b/unit_tests/tests/test_gppwm.cpp index 2da5a7e1bf..5868a8d436 100644 --- a/unit_tests/tests/test_gppwm.cpp +++ b/unit_tests/tests/test_gppwm.cpp @@ -76,7 +76,7 @@ TEST(GpPwm, OutputOnOff) { TEST(GpPwm, GetOutput) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); GppwmChannel ch; - ch.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + ch.inject(); gppwm_channel cfg; cfg.loadAxis = GPPWM_Tps; diff --git a/unit_tests/tests/test_hardware_reinit.cpp b/unit_tests/tests/test_hardware_reinit.cpp index 1e56223007..efba30aa32 100644 --- a/unit_tests/tests/test_hardware_reinit.cpp +++ b/unit_tests/tests/test_hardware_reinit.cpp @@ -10,6 +10,6 @@ TEST(hardware, reinit) { ButtonDebounce::startConfigurationList(); - resetConfigurationExt(nullptr, DODGE_NEON_1995 PASS_ENGINE_PARAMETER_SUFFIX); - resetConfigurationExt(nullptr, FRANKENSO_MIATA_NA6_MAP PASS_ENGINE_PARAMETER_SUFFIX); + resetConfigurationExt(nullptr, DODGE_NEON_1995); + resetConfigurationExt(nullptr, FRANKENSO_MIATA_NA6_MAP); } diff --git a/unit_tests/tests/test_idle_controller.cpp b/unit_tests/tests/test_idle_controller.cpp index 6ecf84ab0c..ca1526dcfd 100644 --- a/unit_tests/tests/test_idle_controller.cpp +++ b/unit_tests/tests/test_idle_controller.cpp @@ -21,7 +21,7 @@ using ICP = IIdleController::Phase; TEST(idle_v2, timingPid) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); IdleController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); engineConfiguration->useIdleTimingPidControl = true; @@ -57,7 +57,7 @@ TEST(idle_v2, timingPid) { TEST(idle_v2, testTargetRpm) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); IdleController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); for (size_t i = 0; i < efi::size(engineConfiguration->cltIdleRpmBins); i++) { CONFIG(cltIdleRpmBins)[i] = i * 10; @@ -71,7 +71,7 @@ TEST(idle_v2, testTargetRpm) { TEST(idle_v2, testDeterminePhase) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); IdleController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // TPS threshold 5% for easy test CONFIG(idlePidDeactivationTpsThreshold) = 5; @@ -117,7 +117,7 @@ TEST(idle_v2, testDeterminePhase) { TEST(idle_v2, crankingOpenLoop) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); IdleController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); engineConfiguration->crankingIACposition = 50; @@ -143,7 +143,7 @@ TEST(idle_v2, crankingOpenLoop) { TEST(idle_v2, runningOpenLoopBasic) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); IdleController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); engineConfiguration->manIdlePosition = 50; @@ -159,7 +159,7 @@ TEST(idle_v2, runningOpenLoopBasic) { TEST(idle_v2, runningFanAcBump) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); IdleController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); engineConfiguration->manIdlePosition = 50; engineConfiguration->acIdleExtraOffset = 9; @@ -198,7 +198,7 @@ TEST(idle_v2, runningFanAcBump) { TEST(idle_v2, runningOpenLoopTpsTaper) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); IdleController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Zero out base tempco table setArrayValues(config->cltIdleCorr, 0.0f); @@ -226,7 +226,7 @@ struct MockOpenLoopIdler : public IdleController { TEST(idle_v2, testOpenLoopCranking) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); StrictMock dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); CONFIG(overrideCrankingIacSetting) = true; @@ -239,7 +239,7 @@ TEST(idle_v2, testOpenLoopCranking) { TEST(idle_v2, openLoopRunningTaper) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); StrictMock dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); EXPECT_CALL(dut, getRunningOpenLoop(30, SensorResult(0))).WillRepeatedly(Return(25)); EXPECT_CALL(dut, getCrankingOpenLoop(30)).WillRepeatedly(Return(75)); @@ -264,7 +264,7 @@ TEST(idle_v2, openLoopRunningTaper) { TEST(idle_v2, getCrankingTaperFraction) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); StrictMock dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); CONFIG(afterCrankingIACtaperDuration) = 500; @@ -293,7 +293,7 @@ TEST(idle_v2, getCrankingTaperFraction) { TEST(idle_v2, openLoopCoastingTable) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); IdleController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // enable & configure feature CONFIG(useIacTableForCoasting) = true; @@ -311,7 +311,7 @@ extern int timeNowUs; TEST(idle_v2, closedLoopBasic) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); IdleController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Not testing PID here, so we can set very simple PID gains CONFIG(idleRpmPid).pFactor = 0.5; // 0.5 output per 1 RPM error = 50% per 100 rpm @@ -339,7 +339,7 @@ TEST(idle_v2, closedLoopBasic) { TEST(idle_v2, closedLoopDeadzone) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); IdleController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Not testing PID here, so we can set very simple PID gains CONFIG(idleRpmPid).pFactor = 0.5; // 0.5 output per 1 RPM error = 50% per 100 rpm @@ -375,7 +375,7 @@ struct IntegrationIdleMock : public IdleController { TEST(idle_v2, IntegrationManual) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); StrictMock dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); SensorResult expectedTps = 1; float expectedClt = 37; @@ -408,7 +408,7 @@ TEST(idle_v2, IntegrationManual) { TEST(idle_v2, IntegrationAutomatic) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); StrictMock dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); CONFIG(idleMode) = IM_AUTO; @@ -446,7 +446,7 @@ TEST(idle_v2, IntegrationAutomatic) { TEST(idle_v2, IntegrationClamping) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); StrictMock dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); CONFIG(idleMode) = IM_AUTO; diff --git a/unit_tests/tests/test_knock.cpp b/unit_tests/tests/test_knock.cpp index 244cf74776..3e245c3d28 100644 --- a/unit_tests/tests/test_knock.cpp +++ b/unit_tests/tests/test_knock.cpp @@ -13,7 +13,7 @@ TEST(Knock, Retards) { CONFIG(knockRetardMaximum) = 8; KnockController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // No retard unless we knock ASSERT_FLOAT_EQ(dut.getKnockRetard(), 0); @@ -43,7 +43,7 @@ TEST(Knock, Reapply) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); KnockController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Knock threshold of 20dBv ENGINE(engineState).knockThreshold = 20; diff --git a/unit_tests/tests/test_launch.cpp b/unit_tests/tests/test_launch.cpp index 94547730c7..049c41a005 100644 --- a/unit_tests/tests/test_launch.cpp +++ b/unit_tests/tests/test_launch.cpp @@ -6,7 +6,7 @@ TEST(LaunchControl, TpsCondition) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); LaunchControlBase dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); engineConfiguration->launchTpsTreshold = 10; @@ -28,7 +28,7 @@ TEST(LaunchControl, VSSCondition) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); LaunchControlBase dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Test Speed trashold engineConfiguration->launchActivationMode = ALWAYS_ACTIVE_LAUNCH; @@ -46,7 +46,7 @@ TEST(LaunchControl, RPMCondition) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); LaunchControlBase dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); engineConfiguration->launchRpm = 3000; @@ -59,7 +59,7 @@ TEST(LaunchControl, SwitchInputCondition) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); LaunchControlBase dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); //activation based on VSS engineConfiguration->launchActivationMode = ALWAYS_ACTIVE_LAUNCH; @@ -79,21 +79,21 @@ TEST(LaunchControl, SwitchInputCondition) { engineConfiguration->clutchDownPin = GPIOG_2; engineConfiguration->clutchDownPinMode = PI_PULLUP; setMockState(engineConfiguration->clutchDownPin, true); - engine->updateSwitchInputs(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->updateSwitchInputs(); EXPECT_TRUE(dut.isInsideSwitchCondition()); setMockState(engineConfiguration->clutchDownPin, false); - engine->updateSwitchInputs(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->updateSwitchInputs(); EXPECT_FALSE(dut.isInsideSwitchCondition()); engineConfiguration->clutchDownPinMode = PI_PULLDOWN; engineConfiguration->clutchDownPinInverted = true; setMockState(engineConfiguration->clutchDownPin, false); - engine->updateSwitchInputs(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->updateSwitchInputs(); EXPECT_TRUE(dut.isInsideSwitchCondition()); setMockState(engineConfiguration->clutchDownPin, true); - engine->updateSwitchInputs(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->updateSwitchInputs(); EXPECT_FALSE(dut.isInsideSwitchCondition()); } @@ -102,7 +102,7 @@ TEST(LaunchControl, CombinedCondition) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); LaunchControlBase dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); //check VSS normal usage engineConfiguration->launchActivationMode = ALWAYS_ACTIVE_LAUNCH; @@ -125,7 +125,7 @@ TEST(LaunchControl, CombinedCondition) { } -static void setDefaultLaunchParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { +static void setDefaultLaunchParameters() { engineConfiguration->launchRpm = 4000; // Rpm to trigger Launch condition // engineConfiguration->launchTimingRetard = 10; // retard in absolute degrees ATDC engineConfiguration->launchTimingRpmRange = 500; // Rpm above Launch triggered for full retard @@ -145,10 +145,10 @@ static void setDefaultLaunchParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { TEST(LaunchControl, CompleteRun) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - initLaunchControl(PASS_ENGINE_PARAMETER_SIGNATURE); + initLaunchControl(); //load default config - setDefaultLaunchParameters(PASS_CONFIG_PARAMETER_SIGNATURE); + setDefaultLaunchParameters(); //check VSS normal usage engineConfiguration->launchActivationMode = ALWAYS_ACTIVE_LAUNCH; diff --git a/unit_tests/tests/test_limp.cpp b/unit_tests/tests/test_limp.cpp index cca3aa3d42..0a864eb41a 100644 --- a/unit_tests/tests/test_limp.cpp +++ b/unit_tests/tests/test_limp.cpp @@ -26,7 +26,7 @@ TEST(limp, revLimit) { engineConfiguration->rpmHardLimit = 2500; LimpManager dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Under rev limit, inj/ign allowed dut.updateState(2000, 0); @@ -51,7 +51,7 @@ TEST(limp, boostCut) { engineConfiguration->boostCutPressure = 100; LimpManager dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Below threshold, injection allowed Sensor::setMockValue(SensorType::Map, 80); @@ -82,7 +82,7 @@ TEST(limp, oilPressureFailureCase) { engineConfiguration->minOilPressureAfterStart = 200; LimpManager dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Low oil pressure! Sensor::setMockValue(SensorType::OilPressure, 50); @@ -116,7 +116,7 @@ TEST(limp, oilPressureSuccessCase) { engineConfiguration->minOilPressureAfterStart = 200; LimpManager dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); // Low oil pressure! Sensor::setMockValue(SensorType::OilPressure, 50); diff --git a/unit_tests/tests/test_logic_expression.cpp b/unit_tests/tests/test_logic_expression.cpp index 5d16a6d612..c2a4254732 100644 --- a/unit_tests/tests/test_logic_expression.cpp +++ b/unit_tests/tests/test_logic_expression.cpp @@ -14,7 +14,7 @@ #define TEST_POOL_SIZE 256 -FsioResult getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) { +FsioResult getEngineValue(le_action_e action) { switch(action) { case LE_METHOD_FAN: return engine->fsioState.mockFan; @@ -33,7 +33,7 @@ FsioResult getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX) { case LE_METHOD_VBATT: return 12; case LE_METHOD_AC_TOGGLE: - return getAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE); + return getAcToggle(); case LE_METHOD_IS_COOLANT_BROKEN: return 0; #include "fsio_getters.def" @@ -116,7 +116,7 @@ static void testExpression2(float selfValue, const char *line, float expected, E EXPAND_Engine; - ASSERT_NEAR(expected, c.evaluate("test", selfValue, element PASS_ENGINE_PARAMETER_SUFFIX), EPS4D) << line; + ASSERT_NEAR(expected, c.evaluate("test", selfValue, element), EPS4D) << line; } static void testExpression2(float selfValue, const char *line, float expected, const std::unordered_map& sensorVals = {}) { @@ -143,20 +143,20 @@ TEST(fsio, testHysteresisSelf) { double selfValue = 0; engine->fsioState.mockRpm = 0; - selfValue = c.evaluate("test", selfValue, element PASS_ENGINE_PARAMETER_SUFFIX); + selfValue = c.evaluate("test", selfValue, element); ASSERT_EQ(0, selfValue); engine->fsioState.mockRpm = 430; - selfValue = c.evaluate("test", selfValue, element PASS_ENGINE_PARAMETER_SUFFIX); + selfValue = c.evaluate("test", selfValue, element); // OFF since not ON yet ASSERT_EQ(0, selfValue); engine->fsioState.mockRpm = 460; - selfValue = c.evaluate("test", selfValue, element PASS_ENGINE_PARAMETER_SUFFIX); + selfValue = c.evaluate("test", selfValue, element); ASSERT_EQ(1, selfValue); engine->fsioState.mockRpm = 430; - selfValue = c.evaluate("test", selfValue, element PASS_ENGINE_PARAMETER_SUFFIX); + selfValue = c.evaluate("test", selfValue, element); // OFF since was ON yet ASSERT_EQ(1, selfValue); } @@ -240,7 +240,7 @@ TEST(fsio, testLogicExpressions) { LEElement * element = pool.parseExpression("fan NOT coolant 90 > AND fan coolant 85 > AND OR"); ASSERT_TRUE(element != NULL) << "Not NULL expected"; LECalculator c; - ASSERT_EQ( 1, c.evaluate("test", 0, element PASS_ENGINE_PARAMETER_SUFFIX)) << "that expression"; + ASSERT_EQ( 1, c.evaluate("test", 0, element)) << "that expression"; ASSERT_EQ(12, c.currentCalculationLogPosition); ASSERT_EQ(102, c.calcLogAction[0]); @@ -265,33 +265,33 @@ TEST(fsio, fuelPump) { // Mock a fuel pump pin CONFIG(fuelPumpPin) = GPIOA_0; // Re-init so it picks up the new config - enginePins.fuelPumpRelay.init(PASS_ENGINE_PARAMETER_SIGNATURE); + enginePins.fuelPumpRelay.init(); // ECU just started, haven't seen trigger yet engine->fsioState.mockTimeSinceBoot = 0.5f; engine->fsioState.mockTimeSinceTrigger = 100; - runFsio(PASS_ENGINE_PARAMETER_SIGNATURE); + runFsio(); // Pump should be on! EXPECT_TRUE(efiReadPin(GPIOA_0)); // Long time since ecu start, haven't seen trigger yet engine->fsioState.mockTimeSinceBoot = 60; engine->fsioState.mockTimeSinceTrigger = 100; - runFsio(PASS_ENGINE_PARAMETER_SIGNATURE); + runFsio(); // Pump should be off! EXPECT_FALSE(efiReadPin(GPIOA_0)); // Long time since ecu start, just saw a trigger! engine->fsioState.mockTimeSinceBoot = 60; engine->fsioState.mockTimeSinceTrigger = 0.1f; - runFsio(PASS_ENGINE_PARAMETER_SIGNATURE); + runFsio(); // Pump should be on! EXPECT_TRUE(efiReadPin(GPIOA_0)); // ECU just started, and we just saw a trigger! engine->fsioState.mockTimeSinceBoot = 0.5f; engine->fsioState.mockTimeSinceTrigger = 0.1f; - runFsio(PASS_ENGINE_PARAMETER_SIGNATURE); + runFsio(); // Pump should be on! EXPECT_TRUE(efiReadPin(GPIOA_0)); } diff --git a/unit_tests/tests/test_sensors.cpp b/unit_tests/tests/test_sensors.cpp index 2310847549..059a3a1cb7 100644 --- a/unit_tests/tests/test_sensors.cpp +++ b/unit_tests/tests/test_sensors.cpp @@ -20,10 +20,10 @@ TEST(sensors, mapDecoding) { air_pressure_sensor_config_s s; s.type = MT_DENSO183; - assertEqualsM("denso 0 volts", -6.64, decodePressure(0, &s PASS_ENGINE_PARAMETER_SUFFIX)); - ASSERT_FLOAT_EQ(31.244, decodePressure(1, &s PASS_ENGINE_PARAMETER_SUFFIX)); + assertEqualsM("denso 0 volts", -6.64, decodePressure(0, &s)); + ASSERT_FLOAT_EQ(31.244, decodePressure(1, &s)); s.type = MT_MPX4250; - ASSERT_EQ( 8, decodePressure(0, &s PASS_ENGINE_PARAMETER_SUFFIX)) << "MPX_4250 0 volts"; - ASSERT_FLOAT_EQ(58.4, decodePressure(1, &s PASS_ENGINE_PARAMETER_SUFFIX)); + ASSERT_EQ( 8, decodePressure(0, &s)) << "MPX_4250 0 volts"; + ASSERT_FLOAT_EQ(58.4, decodePressure(1, &s)); } diff --git a/unit_tests/tests/test_start_stop.cpp b/unit_tests/tests/test_start_stop.cpp index d60e14bdef..97754aa6a8 100644 --- a/unit_tests/tests/test_start_stop.cpp +++ b/unit_tests/tests/test_start_stop.cpp @@ -17,12 +17,12 @@ TEST(start, startStop) { ASSERT_FALSE(efiReadPin(engineConfiguration->starterControlPin)); - slowStartStopButtonCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + slowStartStopButtonCallback(); ASSERT_FALSE(efiReadPin(engineConfiguration->starterControlPin)); // startup 'timeout' duration of time is a special case so let's sleep a bit eth.moveTimeForwardAndInvokeEventsSec(10); - slowStartStopButtonCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + slowStartStopButtonCallback(); ASSERT_FALSE(efiReadPin(engineConfiguration->starterControlPin)); @@ -30,17 +30,17 @@ TEST(start, startStop) { eth.moveTimeForwardAndInvokeEventsSec(10); // hit 'start' button! inverted since pull-up setMockState(engineConfiguration->startStopButtonPin, false); - slowStartStopButtonCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + slowStartStopButtonCallback(); ASSERT_TRUE(efiReadPin(engineConfiguration->starterControlPin)); eth.moveTimeForwardAndInvokeEventsSec(5); - slowStartStopButtonCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + slowStartStopButtonCallback(); eth.moveTimeForwardAndInvokeEventsSec(5); - slowStartStopButtonCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + slowStartStopButtonCallback(); eth.moveTimeForwardAndInvokeEventsSec(5); - slowStartStopButtonCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + slowStartStopButtonCallback(); // starter is now OFF due to timeout ASSERT_FALSE(efiReadPin(engineConfiguration->starterControlPin)); } diff --git a/unit_tests/tests/test_stft.cpp b/unit_tests/tests/test_stft.cpp index ecb8cbc45b..22e9af8c39 100644 --- a/unit_tests/tests/test_stft.cpp +++ b/unit_tests/tests/test_stft.cpp @@ -83,11 +83,11 @@ TEST(ClosedLoopFuel, afrLimits) { engineConfiguration->stft.maxAfr = 180; // 18.0 AFR Sensor::setMockValue(SensorType::Lambda1, 0.1f); - EXPECT_FALSE(shouldUpdateCorrection(SensorType::Lambda1 PASS_ENGINE_PARAMETER_SUFFIX)); + EXPECT_FALSE(shouldUpdateCorrection(SensorType::Lambda1)); Sensor::setMockValue(SensorType::Lambda1, 1.0f); - EXPECT_TRUE(shouldUpdateCorrection(SensorType::Lambda1 PASS_ENGINE_PARAMETER_SUFFIX)); + EXPECT_TRUE(shouldUpdateCorrection(SensorType::Lambda1)); Sensor::setMockValue(SensorType::Lambda1, 2.0f); - EXPECT_FALSE(shouldUpdateCorrection(SensorType::Lambda1 PASS_ENGINE_PARAMETER_SUFFIX)); + EXPECT_FALSE(shouldUpdateCorrection(SensorType::Lambda1)); } diff --git a/unit_tests/tests/test_tacho.cpp b/unit_tests/tests/test_tacho.cpp index 7d8f97a8fe..8e5ca904cf 100644 --- a/unit_tests/tests/test_tacho.cpp +++ b/unit_tests/tests/test_tacho.cpp @@ -33,7 +33,7 @@ TEST(tachometer, testPulsePerRev) { ASSERT_EQ(engine->triggerCentral.triggerState.getShaftSynchronized(), true); // Poke the fast callback to update the tach - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); ASSERT_EQ(100, getTachFreq()); ASSERT_EQ(0.5, getTachDuty()); diff --git a/unit_tests/tests/test_tunerstudio.cpp b/unit_tests/tests/test_tunerstudio.cpp index 1814efd0bc..679339839a 100644 --- a/unit_tests/tests/test_tunerstudio.cpp +++ b/unit_tests/tests/test_tunerstudio.cpp @@ -79,12 +79,12 @@ TEST(TunerstudioCommands, writeChunkEngineConfig) { // two step - writes to the engineConfiguration section require a burn uint8_t val = 50; - handleWriteChunkCommand(&channel, TS_CRC, 100, 1, &val PASS_ENGINE_PARAMETER_SUFFIX); + handleWriteChunkCommand(&channel, TS_CRC, 100, 1, &val); // hasn't changed yet EXPECT_EQ(configBytes[100], 0); - handleBurnCommand(&channel, TS_CRC PASS_ENGINE_PARAMETER_SUFFIX); + handleBurnCommand(&channel, TS_CRC); EXPECT_EQ(configBytes[100], 50); } @@ -103,7 +103,7 @@ TEST(TunerstudioCommands, writeChunkOutsideEngineConfig) { // one step - writes past engineConfiguration don't need a burn uint8_t val = 50; - handleWriteChunkCommand(&channel, TS_CRC, offset, 1, &val PASS_ENGINE_PARAMETER_SUFFIX); + handleWriteChunkCommand(&channel, TS_CRC, offset, 1, &val); EXPECT_EQ(configBytes[offset], 50); } diff --git a/unit_tests/tests/test_vvt.cpp b/unit_tests/tests/test_vvt.cpp index 94b7d9bb15..8a51988b3f 100644 --- a/unit_tests/tests/test_vvt.cpp +++ b/unit_tests/tests/test_vvt.cpp @@ -18,7 +18,7 @@ TEST(Vvt, setpoint) { engine->rpmCalculator.mockRpm = 4321; VvtController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); dut.init(0, 0, 0, &targetMap); // Test dut @@ -31,7 +31,7 @@ TEST(Vvt, observePlant) { engine->triggerCentral.vvtPosition[0][0] = 23; VvtController dut; - dut.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + dut.inject(); dut.init(0, 0, 0, nullptr); EXPECT_EQ(23, dut.observePlant().value_or(0)); diff --git a/unit_tests/tests/trigger/test_2jz_vvt.cpp b/unit_tests/tests/trigger/test_2jz_vvt.cpp index 3809bb71e3..526e9e27f0 100644 --- a/unit_tests/tests/trigger/test_2jz_vvt.cpp +++ b/unit_tests/tests/trigger/test_2jz_vvt.cpp @@ -14,7 +14,7 @@ TEST(sensors, test2jz) { // this crank trigger would be easier to test, crank shape is less important for this test engineConfiguration->useOnlyRisingEdgeForTrigger = true; - eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_ONE); ASSERT_EQ( 0, GET_RPM()) << "test2jz RPM"; for (int i = 0; i < 3;i++) { @@ -28,8 +28,8 @@ TEST(sensors, test2jz) { eth.moveTimeForwardUs(MS2US(3)); // shifting VVT phase a few angles - hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), 0 PASS_ENGINE_PARAMETER_SUFFIX); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), 0 PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), 0); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), 0); // currentPosition ASSERT_NEAR(608.2 - 720, engine->triggerCentral.currentVVTEventPosition[0][0], EPS3D); diff --git a/unit_tests/tests/trigger/test_all_triggers.cpp b/unit_tests/tests/trigger/test_all_triggers.cpp index f20585f6a7..91e880bd60 100644 --- a/unit_tests/tests/trigger/test_all_triggers.cpp +++ b/unit_tests/tests/trigger/test_all_triggers.cpp @@ -62,7 +62,7 @@ TEST_P(AllTriggersFixture, TestTrigger) { TriggerWaveform *shape = &engine->triggerCentral.triggerShape; TriggerFormDetails *triggerFormDetails = &engine->triggerCentral.triggerFormDetails; - engine->initializeTriggerWaveform(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->initializeTriggerWaveform(); ASSERT_FALSE(shape->shapeDefinitionError) << "Trigger shapeDefinitionError"; diff --git a/unit_tests/tests/trigger/test_cam_vvt_input.cpp b/unit_tests/tests/trigger/test_cam_vvt_input.cpp index cbc693e09f..633f7993ff 100644 --- a/unit_tests/tests/trigger/test_cam_vvt_input.cpp +++ b/unit_tests/tests/trigger/test_cam_vvt_input.cpp @@ -15,7 +15,7 @@ extern WaveChart waveChart; TEST(trigger, testNoStartUpWarningsNoSyncronizationTrigger) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); // one tooth does not need synchronization it just counts tooth - eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_ONE); ASSERT_EQ( 0, GET_RPM()) << "testNoStartUpWarnings RPM"; eth.fireTriggerEvents2(/*count*/10, /*duration*/50); @@ -28,7 +28,7 @@ TEST(trigger, testNoStartUpWarnings) { // for this test we need a trigger with isSynchronizationNeeded=true engineConfiguration->trigger.customTotalToothCount = 3; engineConfiguration->trigger.customSkippedToothCount = 1; - eth.setTriggerType(TT_TOOTHED_WHEEL PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_TOOTHED_WHEEL); ASSERT_EQ( 0, GET_RPM()) << "testNoStartUpWarnings RPM"; for (int i = 0;i < 10;i++) { @@ -88,7 +88,7 @@ TEST(trigger, testCamInput) { engineConfiguration->useOnlyRisingEdgeForTrigger = true; engineConfiguration->vvtMode[0] = VVT_FIRST_HALF; engineConfiguration->vvtOffsets[0] = 360; - eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_ONE); engineConfiguration->camInputs[0] = GPIOA_10; // we just need to indicate that we have CAM ASSERT_EQ( 0, GET_RPM()) << "testCamInput RPM"; @@ -111,7 +111,7 @@ TEST(trigger, testCamInput) { for (int i = 0; i < 600;i++) { eth.moveTimeForwardUs(MS2US(10)); - hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), 0 PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), 0); eth.moveTimeForwardUs(MS2US(40)); eth.firePrimaryTriggerRise(); } @@ -125,7 +125,7 @@ TEST(trigger, testNB2CamInput) { WITH_ENGINE_TEST_HELPER(FRANKENSO_MAZDA_MIATA_2003); // this crank trigger would be easier to test, crank shape is less important for this test - eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_ONE); engineConfiguration->isFasterEngineSpinUpEnabled = false; engineConfiguration->useOnlyRisingEdgeForTrigger = true; @@ -148,21 +148,21 @@ TEST(trigger, testNB2CamInput) { eth.moveTimeForwardUs(MS2US(3)); // shifting VVT phase a few angles - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), 0 PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), 0); // first gap - long eth.moveTimeForwardUs(MS2US(130)); - hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), 0 PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), 0); eth.moveTimeForwardUs(MS2US( 30)); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), 0 PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), 0); // second gap - short eth.moveTimeForwardUs(MS2US(10)); - hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), 0 PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), 0); eth.moveTimeForwardUs(MS2US(10)); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), 0 PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), 0); ASSERT_FLOAT_EQ(0, engine->triggerCentral.getVVTPosition(0, 0)); ASSERT_EQ(totalRevolutionCountBeforeVvtSync, engine->triggerCentral.triggerState.getTotalRevolutionCounter()); @@ -170,9 +170,9 @@ TEST(trigger, testNB2CamInput) { // Third gap - long eth.moveTimeForwardUs(MS2US(130)); - hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), 0 PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_FALL, getTimeNowNt(), 0); eth.moveTimeForwardUs(MS2US( 30)); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), 0 PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), 0); EXPECT_NEAR(-211.59f, engine->triggerCentral.getVVTPosition(0, 0), EPS2D); // actually position based on VVT! diff --git a/unit_tests/tests/trigger/test_fasterEngineSpinningUp.cpp b/unit_tests/tests/trigger/test_fasterEngineSpinningUp.cpp index 4686ec3dd1..b370547bb4 100644 --- a/unit_tests/tests/trigger/test_fasterEngineSpinningUp.cpp +++ b/unit_tests/tests/trigger/test_fasterEngineSpinningUp.cpp @@ -20,13 +20,13 @@ TEST(cranking, testFasterEngineSpinningUp) { // set sequential injection mode to test auto-change to simultaneous when spinning-up setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð, IM_SEQUENTIAL); - ASSERT_EQ(IM_INDIVIDUAL_COILS, getCurrentIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_INDIVIDUAL_COILS, getCurrentIgnitionMode()); eth.fireRise(1000 /*ms*/); // check if it's true - ASSERT_EQ(IM_SEQUENTIAL, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); - ASSERT_EQ(IM_WASTED_SPARK, getCurrentIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_SEQUENTIAL, engine->getCurrentInjectionMode()); + ASSERT_EQ(IM_WASTED_SPARK, getCurrentIgnitionMode()); // check if the engine has the right state ASSERT_EQ(SPINNING_UP, engine->rpmCalculator.getState()); // check RPM @@ -46,9 +46,9 @@ TEST(cranking, testFasterEngineSpinningUp) { // two simultaneous injections ASSERT_EQ(4, engine->executor.size()) << "plain#2"; // test if they are simultaneous - ASSERT_EQ(IM_SIMULTANEOUS, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_SIMULTANEOUS, engine->getCurrentInjectionMode()); // test if ignition mode is temporary changed to wasted spark, if set to individual coils - ASSERT_EQ(IM_WASTED_SPARK, getCurrentIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_WASTED_SPARK, getCurrentIgnitionMode()); // check real events eth.assertEvent5("inj start#1", 0, (void*)startSimultaniousInjection, 97500); eth.assertEvent5("inj end#1", 1, (void*)endSimultaniousInjection, 100000); @@ -66,9 +66,9 @@ TEST(cranking, testFasterEngineSpinningUp) { // check RPM ASSERT_EQ( 200, GET_RPM()) << "RPM#2"; // test if they are simultaneous in cranking mode too - ASSERT_EQ(IM_SIMULTANEOUS, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_SIMULTANEOUS, engine->getCurrentInjectionMode()); // test if ignition mode is restored to ind.coils - ASSERT_EQ(IM_INDIVIDUAL_COILS, getCurrentIgnitionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_INDIVIDUAL_COILS, getCurrentIgnitionMode()); // two simultaneous injections ASSERT_EQ( 4, engine->executor.size()) << "plain#2"; // check real events @@ -86,7 +86,7 @@ TEST(cranking, testFasterEngineSpinningUp) { // check RPM ASSERT_EQ( 1000, GET_RPM()) << "RPM#3"; // check if the injection mode is back to sequential now - ASSERT_EQ(IM_SEQUENTIAL, engine->getCurrentInjectionMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(IM_SEQUENTIAL, engine->getCurrentInjectionMode()); // 4 sequential injections for the full cycle ASSERT_EQ( 8, engine->executor.size()) << "plain#3"; diff --git a/unit_tests/tests/trigger/test_injection_scheduling.cpp b/unit_tests/tests/trigger/test_injection_scheduling.cpp index f3e12f4df3..213089ff61 100644 --- a/unit_tests/tests/trigger/test_injection_scheduling.cpp +++ b/unit_tests/tests/trigger/test_injection_scheduling.cpp @@ -15,7 +15,7 @@ TEST(injectionScheduling, NormalDutyCycle) { efitick_t nowNt = 1000000; InjectionEvent event; - event.inject(PASS_ENGINE_PARAMETER_SIGNATURE); + event.inject(); InjectorOutputPin pin; pin.injectorIndex = 0; event.outputs[0] = &pin; diff --git a/unit_tests/tests/trigger/test_issue_898.cpp b/unit_tests/tests/trigger/test_issue_898.cpp index 698e414845..c814ff6f6a 100644 --- a/unit_tests/tests/trigger/test_issue_898.cpp +++ b/unit_tests/tests/trigger/test_issue_898.cpp @@ -15,7 +15,6 @@ static void boardConfigurationForIssue898(engine_configuration_s *engineConfigur TEST(issues, issue898) { EngineTestHelper eth(TEST_ISSUE_898, &boardConfigurationForIssue898); - EXPAND_EngineTestHelper; ASSERT_EQ(TRUE, engine->triggerCentral.triggerShape.shapeDefinitionError) << "MRE_MIATA_NA6 shapeDefinitionError"; diff --git a/unit_tests/tests/trigger/test_miata_na_tdc.cpp b/unit_tests/tests/trigger/test_miata_na_tdc.cpp index 4fa635d81e..e3c278d953 100644 --- a/unit_tests/tests/trigger/test_miata_na_tdc.cpp +++ b/unit_tests/tests/trigger/test_miata_na_tdc.cpp @@ -22,7 +22,7 @@ TEST(miata, miata_na_tdc) { emulatorHelper.handleEmulatorCallback( *shape.wave, - i % shape.getSize() PASS_ENGINE_PARAMETER_SUFFIX); + i % shape.getSize()); } ASSERT_EQ(167, GET_RPM()) << "miata_na_tdc RPM"; diff --git a/unit_tests/tests/trigger/test_nissan_vq_vvt.cpp b/unit_tests/tests/trigger/test_nissan_vq_vvt.cpp index d06ef96851..ba873e4db9 100644 --- a/unit_tests/tests/trigger/test_nissan_vq_vvt.cpp +++ b/unit_tests/tests/trigger/test_nissan_vq_vvt.cpp @@ -28,9 +28,9 @@ static void func(TriggerCallback *callback) { efitick_t nowNt = getTimeNowNt(); if (callback->isVvt) { trigger_value_e v = value ? TV_RISE : TV_FALL; - hwHandleVvtCamSignal(v, nowNt, callback->vvtBankIndex * CAMS_PER_BANK PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(v, nowNt, callback->vvtBankIndex * CAMS_PER_BANK); } else { - handleShaftSignal(0, value, nowNt PASS_ENGINE_PARAMETER_SUFFIX); + handleShaftSignal(0, value, nowNt); } } @@ -41,8 +41,7 @@ static void scheduleTriggerEvents(TriggerWaveform *shape, bool isVvt, int vvtBankIndex, int vvtOffset, - std::vector>& ptrs - DECLARE_ENGINE_PARAMETER_SUFFIX) { + std::vector>& ptrs) { int totalIndex = 0; /** @@ -85,7 +84,7 @@ TEST(nissan, vq_vvt) { scheduleTriggerEvents(&crank, /* timeScale */ 1, - cyclesCount, false, -1, 0, ptrs PASS_ENGINE_PARAMETER_SUFFIX); + cyclesCount, false, -1, 0, ptrs); } float vvtTimeScale = 1; @@ -100,8 +99,7 @@ TEST(nissan, vq_vvt) { cyclesCount / 6, true, /* vvtBankIndex */ 0, /* vvtOffset */ testVvtOffset, - ptrs - PASS_ENGINE_PARAMETER_SUFFIX); + ptrs); } { @@ -113,8 +111,7 @@ TEST(nissan, vq_vvt) { cyclesCount / 6, true, /* vvtBankIndex */1, /* vvtOffset */ testVvtOffset + NISSAN_VQ_CAM_OFFSET, - ptrs - PASS_ENGINE_PARAMETER_SUFFIX); + ptrs); } eth.executeUntil(1473000); diff --git a/unit_tests/tests/trigger/test_override_gaps.cpp b/unit_tests/tests/trigger/test_override_gaps.cpp index de74e73a0c..a559736f81 100644 --- a/unit_tests/tests/trigger/test_override_gaps.cpp +++ b/unit_tests/tests/trigger/test_override_gaps.cpp @@ -17,7 +17,7 @@ TEST(subaru, overrideGap) { CONFIG(triggerGapOverrideFrom[1]) = 0.75; CONFIG(triggerGapOverrideTo[1]) = 1.25; - eth.setTriggerType(TT_SUBARU_7_WITHOUT_6 PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_SUBARU_7_WITHOUT_6); ASSERT_EQ(2, engine->triggerCentral.triggerShape.gapTrackingLength); diff --git a/unit_tests/tests/trigger/test_quad_cam.cpp b/unit_tests/tests/trigger/test_quad_cam.cpp index 478f1f200e..8dc0382a7c 100644 --- a/unit_tests/tests/trigger/test_quad_cam.cpp +++ b/unit_tests/tests/trigger/test_quad_cam.cpp @@ -19,7 +19,7 @@ TEST(trigger, testQuadCam) { engineConfiguration->camInputs[0] = GPIOA_10; // we just need to indicate that we have CAM // this crank trigger would be easier to test, crank shape is less important for this test - eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_ONE); engineConfiguration->useOnlyRisingEdgeForTrigger = true; engineConfiguration->vvtCamSensorUseRise = true; @@ -56,10 +56,10 @@ TEST(trigger, testQuadCam) { ASSERT_EQ(0, engine->triggerCentral.getVVTPosition(secondBank, firstCam)); ASSERT_EQ(0, engine->triggerCentral.getVVTPosition(secondBank, secondCam)); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), firstCam PASS_ENGINE_PARAMETER_SUFFIX); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), firstCamSecondBank PASS_ENGINE_PARAMETER_SUFFIX); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCamSecondBank PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), firstCam); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), firstCamSecondBank); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCamSecondBank); float basePos = -80.2f; @@ -71,13 +71,13 @@ TEST(trigger, testQuadCam) { // Now fire cam events again, but with time gaps between each eth.moveTimeForwardMs(1); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), firstCam PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), firstCam); eth.moveTimeForwardMs(1); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCam); eth.moveTimeForwardMs(1); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), firstCamSecondBank PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), firstCamSecondBank); eth.moveTimeForwardMs(1); - hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCamSecondBank PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleVvtCamSignal(TV_RISE, getTimeNowNt(), secondCamSecondBank); // All four cams should have different positions, each retarded by 1ms from the last float oneMsDegrees = 1000 / ENGINE(rpmCalculator).oneDegreeUs; diff --git a/unit_tests/tests/trigger/test_real_cranking_miata_na6.cpp b/unit_tests/tests/trigger/test_real_cranking_miata_na6.cpp index aa4139a5e9..2effa63ada 100644 --- a/unit_tests/tests/trigger/test_real_cranking_miata_na6.cpp +++ b/unit_tests/tests/trigger/test_real_cranking_miata_na6.cpp @@ -31,7 +31,7 @@ static void fireTriggerEvent(EngineTestHelper*eth, double timestampS, trigger_wh EXPAND_Engine; timeNowUs = 1'000'000 * timestampS; printf("MIATANA: posting time=%d event=%d\n", timeNowUs, event); - hwHandleShaftSignal((int)channel, !isFall, getTimeNowNt() PASS_ENGINE_PARAMETER_SUFFIX); + hwHandleShaftSignal((int)channel, !isFall, getTimeNowNt()); } TEST(cranking, hardcodedRealCranking) { diff --git a/unit_tests/tests/trigger/test_real_volkswagen.cpp b/unit_tests/tests/trigger/test_real_volkswagen.cpp index 21aa7b2c78..ef84670573 100644 --- a/unit_tests/tests/trigger/test_real_volkswagen.cpp +++ b/unit_tests/tests/trigger/test_real_volkswagen.cpp @@ -15,7 +15,7 @@ TEST(crankingVW, vwRealCrankingFromFile) { reader.open("tests/trigger/resources/nick_1.csv", indeces); WITH_ENGINE_TEST_HELPER (VW_ABA); - eth.setTriggerType(TT_60_2_VW PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_60_2_VW); while (reader.haveMore()) { reader.processLine(ð); @@ -27,7 +27,7 @@ TEST(crankingVW, vwRealCrankingFromFile) { TEST(crankingVW, crankingTwiceWithGap) { WITH_ENGINE_TEST_HELPER (VW_ABA); - eth.setTriggerType(TT_60_2_VW PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_60_2_VW); { CsvReader reader(1, /* vvtCount */ 0); diff --git a/unit_tests/tests/trigger/test_rpm_multiplier.cpp b/unit_tests/tests/trigger/test_rpm_multiplier.cpp index be0db4beac..503bcfa064 100644 --- a/unit_tests/tests/trigger/test_rpm_multiplier.cpp +++ b/unit_tests/tests/trigger/test_rpm_multiplier.cpp @@ -12,7 +12,7 @@ static void runRpmTest(operation_mode_e mode, int expected) { WITH_ENGINE_TEST_HELPER(TEST_ENGINE); engineConfiguration->ambiguousOperationMode = mode; - eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_ONE); eth.smartFireTriggerEvents2(/*count*/200, /*delay*/ 40); ASSERT_EQ(expected, GET_RPM()); diff --git a/unit_tests/tests/trigger/test_symmetrical_crank.cpp b/unit_tests/tests/trigger/test_symmetrical_crank.cpp index 608489fd17..e8a4ad40b5 100644 --- a/unit_tests/tests/trigger/test_symmetrical_crank.cpp +++ b/unit_tests/tests/trigger/test_symmetrical_crank.cpp @@ -50,7 +50,7 @@ TEST(engine, testSymmetricalCrank) { CONFIG(isFasterEngineSpinUpEnabled) = false; - ASSERT_EQ(FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR, engine->getOperationMode(PASS_ENGINE_PARAMETER_SIGNATURE)); + ASSERT_EQ(FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR, engine->getOperationMode()); float mult = 0.02; diff --git a/unit_tests/tests/trigger/test_trigger_decoder.cpp b/unit_tests/tests/trigger/test_trigger_decoder.cpp index db8bf617f2..62111417b4 100644 --- a/unit_tests/tests/trigger/test_trigger_decoder.cpp +++ b/unit_tests/tests/trigger/test_trigger_decoder.cpp @@ -37,7 +37,7 @@ void sendOutConfirmation(char *value, int i) { static int getTriggerZeroEventIndex(engine_type_e engineType) { WITH_ENGINE_TEST_HELPER(engineType); - initDataStructures(PASS_ENGINE_PARAMETER_SIGNATURE); + initDataStructures(); const auto& triggerConfiguration = engine->primaryTriggerConfiguration; @@ -51,7 +51,7 @@ TEST(misc, testSkipped2_0) { // for this test we need a trigger with isSynchronizationNeeded=true engineConfiguration->trigger.customTotalToothCount = 2; engineConfiguration->trigger.customSkippedToothCount = 0; - eth.setTriggerType(TT_TOOTHED_WHEEL PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_TOOTHED_WHEEL); ASSERT_EQ( 0, GET_RPM()) << "testNoStartUpWarnings RPM"; } @@ -176,10 +176,10 @@ TEST(misc, test1995FordInline6TriggerDecoder) { eth.applyTriggerWaveform(); - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); eth.fireTriggerEvents(48); eth.assertRpm(2000, "rpm"); - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); eth.fireTriggerEvents(48); IgnitionEventList *ecl = &engine->ignitionEvents; @@ -191,7 +191,7 @@ TEST(misc, test1995FordInline6TriggerDecoder) { ASSERT_NEAR(7.9579, ecl->elements[5].dwellPosition.angleOffsetFromTriggerEvent, EPS4D) << "angle offset#2"; - ASSERT_FLOAT_EQ(0.5, getSparkDwell(2000 PASS_ENGINE_PARAMETER_SUFFIX)) << "running dwell"; + ASSERT_FLOAT_EQ(0.5, getSparkDwell(2000)) << "running dwell"; } TEST(misc, testGetCoilDutyCycleIssue977) { @@ -199,9 +199,9 @@ TEST(misc, testGetCoilDutyCycleIssue977) { int rpm = 2000; engine->rpmCalculator.setRpmValue(rpm); - ASSERT_EQ( 4, getSparkDwell(rpm PASS_ENGINE_PARAMETER_SUFFIX)) << "running dwell"; + ASSERT_EQ( 4, getSparkDwell(rpm)) << "running dwell"; - ASSERT_NEAR( 26.66666, getCoilDutyCycle(rpm PASS_ENGINE_PARAMETER_SUFFIX), 0.0001); + ASSERT_NEAR( 26.66666, getCoilDutyCycle(rpm), 0.0001); } TEST(misc, testFordAspire) { @@ -217,10 +217,10 @@ TEST(misc, testFordAspire) { int rpm = 2000; engine->rpmCalculator.setRpmValue(rpm); - ASSERT_EQ( 4, getSparkDwell(rpm PASS_ENGINE_PARAMETER_SUFFIX)) << "running dwell"; + ASSERT_EQ( 4, getSparkDwell(rpm)) << "running dwell"; engine->rpmCalculator.setRpmValue(6000); - assertEqualsM("higher rpm dwell", 3.25, getSparkDwell(6000 PASS_ENGINE_PARAMETER_SUFFIX)); + assertEqualsM("higher rpm dwell", 3.25, getSparkDwell(6000)); } @@ -254,31 +254,31 @@ TEST(misc, testStartupFuelPumping) { engine->rpmCalculator.mockRpm = 0; Sensor::setMockValue(SensorType::DriverThrottleIntent, 60); - sf.update(PASS_ENGINE_PARAMETER_SIGNATURE); + sf.update(); ASSERT_EQ( 1, sf.pumpsCounter) << "pc#1"; Sensor::setMockValue(SensorType::DriverThrottleIntent, 30); - sf.update(PASS_ENGINE_PARAMETER_SIGNATURE); + sf.update(); ASSERT_EQ( 1, sf.pumpsCounter) << "pumpsCounter#2"; - sf.update(PASS_ENGINE_PARAMETER_SIGNATURE); + sf.update(); ASSERT_EQ( 1, sf.pumpsCounter) << "pc#3"; engine->rpmCalculator.mockRpm = 10; - sf.update(PASS_ENGINE_PARAMETER_SIGNATURE); + sf.update(); ASSERT_EQ( 0, sf.pumpsCounter) << "pc#4"; Sensor::setMockValue(SensorType::DriverThrottleIntent, 70); engine->rpmCalculator.mockRpm = 0; - sf.update(PASS_ENGINE_PARAMETER_SIGNATURE); + sf.update(); ASSERT_EQ( 1, sf.pumpsCounter) << "pc#5"; Sensor::setMockValue(SensorType::DriverThrottleIntent, 30); - sf.update(PASS_ENGINE_PARAMETER_SIGNATURE); + sf.update(); ASSERT_EQ( 1, sf.pumpsCounter) << "pc#6"; Sensor::setMockValue(SensorType::DriverThrottleIntent, 70); - sf.update(PASS_ENGINE_PARAMETER_SIGNATURE); + sf.update(); ASSERT_EQ( 2, sf.pumpsCounter) << "pc#7"; } @@ -316,9 +316,9 @@ TEST(misc, testRpmCalculator) { engineConfiguration->globalFuelCorrection = 3; eth.applyTriggerWaveform(); - setFlatInjectorLag(0 PASS_CONFIG_PARAMETER_SUFFIX); + setFlatInjectorLag(0); - engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->updateSlowSensors(); ASSERT_EQ(0, GET_RPM()); @@ -343,7 +343,7 @@ TEST(misc, testRpmCalculator) { int start = eth.getTimeNowUs(); ASSERT_EQ( 485000, start) << "start value"; - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); ASSERT_NEAR(engine->engineState.timingAdvance, 707, 0.1f); @@ -508,7 +508,7 @@ TEST(misc, testTriggerDecoder) { eth.persistentConfig.engineConfiguration.useOnlyRisingEdgeForTrigger = false; eth.persistentConfig.engineConfiguration.sensorChartMode = SC_DETAILED_RPM; - applyNonPersistentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); + applyNonPersistentConfiguration(); } testTriggerDecoder2("miata 1990", MRE_MIATA_NA6_VAF, 4, 1 - 0.7015, 1 - 0.3890); @@ -524,8 +524,8 @@ TEST(misc, testTriggerDecoder) { printf("!!!!!!!!!!!!!!!!!! Now trying with only rising edges !!!!!!!!!!!!!!!!!\r\n"); engineConfiguration->useOnlyRisingEdgeForTrigger = true; - applyNonPersistentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); - prepareShapes(PASS_ENGINE_PARAMETER_SIGNATURE); + applyNonPersistentConfiguration(); + prepareShapes(); } testTriggerDecoder2("sachs", SACHS, 0, 0.4800, 0.000); @@ -665,7 +665,7 @@ static void setTestBug299(EngineTestHelper *eth) { ASSERT_EQ( 3000, GET_RPM()) << "setTestBug299: RPM"; assertEqualsM("fuel#1", 1.5, engine->injectionDuration); - assertEqualsM("duty for maf=0", 7.5, getInjectorDutyCycle(GET_RPM() PASS_ENGINE_PARAMETER_SUFFIX)); + assertEqualsM("duty for maf=0", 7.5, getInjectorDutyCycle(GET_RPM())); } static void assertInjectors(const char *msg, int value0, int value1) { @@ -691,7 +691,7 @@ void doTestFuelSchedulerBug299smallAndMedium(int startUpDelayMs) { assertInjectors("#0_inj", 0, 0); - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); engine->injectionDuration = 12.5f; // Injection duration of 12.5ms @@ -699,7 +699,7 @@ void doTestFuelSchedulerBug299smallAndMedium(int startUpDelayMs) { EXPECT_CALL(im, getInjectionDuration(_)).WillRepeatedly(Return(12.5f)); engine->injectorModel = &im; - assertEqualsM("duty for maf=3", 62.5, getInjectorDutyCycle(GET_RPM() PASS_ENGINE_PARAMETER_SUFFIX)); + assertEqualsM("duty for maf=3", 62.5, getInjectorDutyCycle(GET_RPM())); ASSERT_EQ( 4, engine->executor.size()) << "qs#1"; eth.moveTimeForwardUs(MS2US(20)); @@ -860,7 +860,7 @@ void doTestFuelSchedulerBug299smallAndMedium(int startUpDelayMs) { engine->injectorModel = &im2; // duty cycle above 75% is a special use-case because 'special' fuel event overlappes the next normal event in batch mode - assertEqualsM("duty for maf=3", 87.5, getInjectorDutyCycle(GET_RPM() PASS_ENGINE_PARAMETER_SUFFIX)); + assertEqualsM("duty for maf=3", 87.5, getInjectorDutyCycle(GET_RPM())); assertInjectionEvent("#03", &t->elements[0], 0, 0, 315); @@ -917,9 +917,9 @@ void doTestFuelSchedulerBug299smallAndMedium(int startUpDelayMs) { */ } -void setInjectionMode(int value DECLARE_ENGINE_PARAMETER_SUFFIX) { +void setInjectionMode(int value) { engineConfiguration->injectionMode = (injection_mode_e) value; - incrementGlobalConfigurationVersion(PASS_ENGINE_PARAMETER_SIGNATURE); + incrementGlobalConfigurationVersion(); } TEST(big, testFuelSchedulerBug299smallAndMedium) { @@ -988,7 +988,7 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) { setTestBug299(ð); ASSERT_EQ( 4, engine->executor.size()) << "Lqs#0"; - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); engine->injectionDuration = 17.5f; // Injection duration of 17.5ms @@ -996,7 +996,7 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) { EXPECT_CALL(im, getInjectionDuration(_)).WillRepeatedly(Return(17.5f)); engine->injectorModel = &im; - assertEqualsM("Lduty for maf=3", 87.5, getInjectorDutyCycle(GET_RPM() PASS_ENGINE_PARAMETER_SUFFIX)); + assertEqualsM("Lduty for maf=3", 87.5, getInjectorDutyCycle(GET_RPM())); ASSERT_EQ( 4, engine->executor.size()) << "Lqs#1"; @@ -1055,7 +1055,7 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) { eth.executeActions(); ASSERT_EQ( 0, engine->executor.size()) << "Lqs#04"; - engine->periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->periodicFastCallback(); // Injection duration of 2ms engine->injectionDuration = 2.0f; @@ -1063,7 +1063,7 @@ TEST(big, testFuelSchedulerBug299smallAndLarge) { EXPECT_CALL(im2, getInjectionDuration(_)).WillRepeatedly(Return(2.0f)); engine->injectorModel = &im2; - ASSERT_EQ( 10, getInjectorDutyCycle(GET_RPM() PASS_ENGINE_PARAMETER_SUFFIX)) << "Lduty for maf=3"; + ASSERT_EQ( 10, getInjectorDutyCycle(GET_RPM())) << "Lduty for maf=3"; eth.firePrimaryTriggerRise(); @@ -1108,13 +1108,13 @@ TEST(big, testSparkReverseOrderBug319) { engineConfiguration->specs.cylindersCount = 4; engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; - setConstantDwell(45 PASS_CONFIG_PARAMETER_SUFFIX); + setConstantDwell(45); // this is needed to update injectorLag - engine->updateSlowSensors(PASS_ENGINE_PARAMETER_SIGNATURE); + engine->updateSlowSensors(); - eth.setTriggerType(TT_ONE PASS_ENGINE_PARAMETER_SUFFIX); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.setTriggerType(TT_ONE); + eth.engine.periodicFastCallback(); setWholeTimingTable(0); @@ -1245,7 +1245,7 @@ TEST(big, testMissedSpark299) { ASSERT_EQ(3000, eth.engine.rpmCalculator.getRpm()); setWholeTimingTable(3); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); @@ -1262,7 +1262,7 @@ TEST(big, testMissedSpark299) { eth.executeActions(); setWholeTimingTable(-5); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + eth.engine.periodicFastCallback(); eth.fireRise(20); diff --git a/unit_tests/tests/trigger/test_trigger_noiseless.cpp b/unit_tests/tests/trigger/test_trigger_noiseless.cpp index 6d1e2da9bf..9ff27d454b 100644 --- a/unit_tests/tests/trigger/test_trigger_noiseless.cpp +++ b/unit_tests/tests/trigger/test_trigger_noiseless.cpp @@ -84,7 +84,7 @@ static void resetTrigger(EngineTestHelper ð) { eth.engine.triggerCentral.triggerState.totalTriggerErrorCounter = 0; } -static void testNoiselessDecoderProcedure(EngineTestHelper ð, int errorToleranceCnt DECLARE_ENGINE_PARAMETER_SUFFIX) { +static void testNoiselessDecoderProcedure(EngineTestHelper ð, int errorToleranceCnt) { printf("*** (bc->useNoiselessTriggerDecoder = %s)\r\n", CONFIG(useNoiselessTriggerDecoder) ? "true" : "false"); @@ -168,7 +168,7 @@ TEST(big, testNoiselessDecoder) { engineConfiguration->useOnlyRisingEdgeForTrigger = true; // we'll test on 60-2 wheel - eth.setTriggerType(TT_TOOTHED_WHEEL_60_2 PASS_ENGINE_PARAMETER_SUFFIX); + eth.setTriggerType(TT_TOOTHED_WHEEL_60_2); ASSERT_EQ(0, engine->triggerCentral.triggerState.totalTriggerErrorCounter); ASSERT_EQ( 0, GET_RPM()) << "testNoiselessDecoder RPM"; @@ -179,13 +179,13 @@ TEST(big, testNoiselessDecoder) { // try normal trigger mode, no noise filtering CONFIG(useNoiselessTriggerDecoder) = false; // for test validation, it should be 1 trigger error - testNoiselessDecoderProcedure(eth, 1 PASS_ENGINE_PARAMETER_SUFFIX); + testNoiselessDecoderProcedure(eth, 1); #endif // now enable our noise filtering algo CONFIG(useNoiselessTriggerDecoder) = true; // should be 0 errors! - testNoiselessDecoderProcedure(eth, 0 PASS_ENGINE_PARAMETER_SUFFIX); + testNoiselessDecoderProcedure(eth, 0); //printTriggerDebug = false; }