diff --git a/firmware/config/boards/proteus/board_configuration.cpp b/firmware/config/boards/proteus/board_configuration.cpp index 280b0c6df5..346bd4f368 100644 --- a/firmware/config/boards/proteus/board_configuration.cpp +++ b/firmware/config/boards/proteus/board_configuration.cpp @@ -191,14 +191,28 @@ void boardPrepareForStop() { palEnableLineEvent(PAL_LINE(GPIOD, 0), PAL_EVENT_MODE_RISING_EDGE); } +#if HW_PROTEUS static Gpio PROTEUS_ME17_ADAPTER_OUTPUTS[] = { Gpio::PROTEUS_LS_1, }; +static Gpio PROTEUS_SBC_OUTPUTS[] = { + Gpio::PROTEUS_LS_14, // inj 1 four times + Gpio::PROTEUS_LS_14, // inj 1 four times + Gpio::PROTEUS_LS_14, // inj 1 four times + Gpio::PROTEUS_LS_14, // inj 1 four times + + Gpio::PROTEUS_LS_15, // inj 4 four times + Gpio::PROTEUS_LS_15, // inj 4 four times + Gpio::PROTEUS_LS_15, // inj 4 four times + Gpio::PROTEUS_LS_15, // inj 4 four times + +}; + static Gpio PROTEUS_CANAM_OUTPUTS[] = { - Gpio::PROTEUS_LS_1, - Gpio::PROTEUS_LS_2, - Gpio::PROTEUS_LS_3, + Gpio::PROTEUS_LS_1, // inj 1 + Gpio::PROTEUS_LS_2, // inj 2 + Gpio::PROTEUS_LS_3, // inj 3 Gpio::PROTEUS_LS_12, // main relay Gpio::PROTEUS_LS_14, // starter Gpio::PROTEUS_LS_15, // intercooler fan @@ -224,10 +238,12 @@ int getBoardMetaLowSideOutputsCount() { if (engineConfiguration->engineType == engine_type_e::PROTEUS_HARLEY) { return getBoardMetaOutputsCount(); } + if (engineConfiguration->engineType == engine_type_e::PROTEUS_SBC) { + return getBoardMetaOutputsCount(); + } return 16; } -#if HW_PROTEUS static Gpio PROTEUS_OUTPUTS[] = { Gpio::PROTEUS_LS_1, Gpio::PROTEUS_LS_2, @@ -262,7 +278,6 @@ Gpio::PROTEUS_LS_16, Gpio::PROTEUS_HS_3, Gpio::PROTEUS_HS_4 }; -#endif // HW_PROTEUS int getBoardMetaOutputsCount() { if (engineConfiguration->engineType == engine_type_e::MAVERICK_X3) { @@ -274,6 +289,9 @@ int getBoardMetaOutputsCount() { if (engineConfiguration->engineType == engine_type_e::PROTEUS_HARLEY) { return efi::size(PROTEUS_HARLEY_OUTPUTS); } + if (engineConfiguration->engineType == engine_type_e::PROTEUS_SBC) { + return efi::size(PROTEUS_SBC_OUTPUTS); + } return efi::size(PROTEUS_OUTPUTS); } @@ -294,5 +312,9 @@ Gpio* getBoardMetaOutputs() { if (engineConfiguration->engineType == engine_type_e::PROTEUS_HARLEY) { return PROTEUS_HARLEY_OUTPUTS; } + if (engineConfiguration->engineType == engine_type_e::PROTEUS_SBC) { + return PROTEUS_SBC_OUTPUTS; + } return PROTEUS_OUTPUTS; } +#endif // HW_PROTEUS diff --git a/firmware/config/engines/gm_sbc.cpp b/firmware/config/engines/gm_sbc.cpp index b8a7019a48..52b344ac9a 100644 --- a/firmware/config/engines/gm_sbc.cpp +++ b/firmware/config/engines/gm_sbc.cpp @@ -54,7 +54,7 @@ void setStepperHw() { #endif // HW_PROTEUS } -void setSbc() { +void setGmSbc() { engineConfiguration->cylindersCount = 8; engineConfiguration->firingOrder = FO_1_8_4_3_6_5_7_2; engineConfiguration->displacement = 5.2; @@ -104,11 +104,3 @@ void setSbc() { engineConfiguration->map.sensor.type = MT_GM_1_BAR; } - -void set8chanSbc() { - setSbc(); -} - -void setProteusSbc() { - setSbc(); -} \ No newline at end of file diff --git a/firmware/config/engines/gm_sbc.h b/firmware/config/engines/gm_sbc.h index b5ed499684..70474ecfc6 100644 --- a/firmware/config/engines/gm_sbc.h +++ b/firmware/config/engines/gm_sbc.h @@ -3,5 +3,4 @@ */ #pragma once -void set8chanSbc(); -void setProteusSbc(); +void setGmSbc(); diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index afd063cbdd..4df48bbf7e 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -803,7 +803,7 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e setMiataNB2_Proteus(); break; case engine_type_e::PROTEUS_SBC: - setProteusSbc(); + setGmSbc(); break; #ifdef HARDWARE_CI case engine_type_e::PROTEUS_ANALOG_PWM_TEST: @@ -850,7 +850,7 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e #if HW_HELLEN_8CHAN case engine_type_e::ALPHAX_8CHAN_SBC: - set8chanSbc(); + setGmSbc(); break; #endif