From 089222ba5b3572798e6cfc2b61ecb74de0c717ae Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 25 Oct 2021 20:51:07 -0400 Subject: [PATCH] export board-specific macro for stm32 pins based on board yaml #3298 proteus meta progress --- firmware/config/engines/bmw_m73.cpp | 9 ++++++--- firmware/config/engines/mazda_miata_vvt.cpp | 17 +++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/firmware/config/engines/bmw_m73.cpp b/firmware/config/engines/bmw_m73.cpp index e8b542fbf4..d0c912d131 100644 --- a/firmware/config/engines/bmw_m73.cpp +++ b/firmware/config/engines/bmw_m73.cpp @@ -80,6 +80,10 @@ #include "electronic_throttle.h" #endif // EFI_ELECTRONIC_THROTTLE_BODY +#if HW_PROTEUS +#include "proteus_meta.h" +#endif + void m73engine(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // 13641435991 injector engineConfiguration->injector.flow = 180; // cc/min, who knows if this number is real - no good source of info @@ -275,7 +279,7 @@ void setEngineBMW_M73_Proteus(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // 12 injectors defined in boards/proteus/board_configuration.cpp // set_analog_input_pin pps pa4 - engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_4; + engineConfiguration->throttlePedalPositionAdcChannel = PROTEUS_IN_ANALOG_VOLT_9; strcpy(CONFIG(vehicleName), "Using Proteus"); @@ -293,8 +297,7 @@ void setEngineBMW_M73_Proteus(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // no idea why https://github.com/rusefi/rusefi/wiki/HOWTO-M73-v12-on-Proteus uses non default CLT pin - // AT3, Proteus pin #31 - engineConfiguration->clt.adcChannel = EFI_ADC_9; + engineConfiguration->clt.adcChannel = PROTEUS_IN_ANALOG_TEMP_4; // GPIOE_0: "Lowside 14" diff --git a/firmware/config/engines/mazda_miata_vvt.cpp b/firmware/config/engines/mazda_miata_vvt.cpp index d191283c58..970e34e58c 100644 --- a/firmware/config/engines/mazda_miata_vvt.cpp +++ b/firmware/config/engines/mazda_miata_vvt.cpp @@ -55,7 +55,7 @@ #include "hip9011_logic.h" -#if HW_PROTEUS & EFI_PROD_CODE +#if HW_PROTEUS #include "proteus_meta.h" #endif @@ -776,9 +776,9 @@ void setMiataNB2_ProteusEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) CONFIG(enableSoftwareKnock) = true; engineConfiguration->malfunctionIndicatorPin = PROTEUS_LS_10; -#endif // EFI_PROD_CODE - engineConfiguration->map.sensor.hwChannel = EFI_ADC_10; + engineConfiguration->map.sensor.hwChannel = PROTEUS_IN_MAP; + engineConfiguration->afr.hwChannel = EFI_ADC_11; @@ -788,17 +788,18 @@ void setMiataNB2_ProteusEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) engineConfiguration->isFasterEngineSpinUpEnabled = true; - engineConfiguration->clt.adcChannel = EFI_ADC_14; - engineConfiguration->iat.adcChannel = EFI_ADC_8; + engineConfiguration->clt.adcChannel = PROTEUS_IN_ANALOG_TEMP_1; + engineConfiguration->iat.adcChannel = PROTEUS_IN_ANALOG_TEMP_3; - engineConfiguration->fuelPumpPin = GPIOG_13;// "Lowside 6" # pin 6/black35 + engineConfiguration->fuelPumpPin = PROTEUS_LS_6; - engineConfiguration->idle.solenoidPin = GPIOG_14; // "Lowside 7" # pin 7/black35 + engineConfiguration->idle.solenoidPin = PROTEUS_LS_7; engineConfiguration->fanPin = GPIOB_7; - CONFIG(mainRelayPin) = GPIOG_12;// "Lowside 5" # pin 5/black35 + CONFIG(mainRelayPin) = GPIOG_12; +#endif // EFI_PROD_CODE }