mirror of https://github.com/rusefi/rusefi.git
rev D simpler to copy-paste at this point
only:hellen154hyundai_f7
This commit is contained in:
parent
8ec04f531a
commit
83243b61bd
|
@ -10,14 +10,14 @@ endif
|
||||||
DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
|
DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(PROJECT_CPU),ARCH_STM32F7)
|
|
||||||
DDEFS += -DCH_DBG_ENABLE_ASSERTS=FALSE
|
|
||||||
DDEFS += -DENABLE_PERF_TRACE=FALSE
|
|
||||||
USE_OPT += -Wl,--defsym=FLASH_SIZE=768k
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Add them all together
|
# Add them all together
|
||||||
DDEFS += -DFIRMWARE_ID=\"hellen154hyundai\" $(VAR_DEF_ENGINE_TYPE)
|
DDEFS += $(VAR_DEF_ENGINE_TYPE)
|
||||||
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
|
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
|
||||||
DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_HELLEN_154_HYUNDAI
|
DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_HELLEN_154_HYUNDAI
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
# Combine the related files for a specific platform and MCU.
|
||||||
|
|
||||||
|
# Target ECU board design
|
||||||
|
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
|
||||||
|
# Set this if you want a default engine type other than normal
|
||||||
|
ifeq ($(VAR_DEF_ENGINE_TYPE),)
|
||||||
|
VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=engine_type_e::HELLEN_154_HYUNDAI_COUPE_BK2
|
||||||
|
endif
|
||||||
|
|
||||||
|
DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DDEFS += -DCH_DBG_ENABLE_ASSERTS=FALSE
|
||||||
|
DDEFS += -DENABLE_PERF_TRACE=FALSE
|
||||||
|
USE_OPT += -Wl,--defsym=FLASH_SIZE=768k
|
||||||
|
|
||||||
|
|
||||||
|
# Add them all together
|
||||||
|
DDEFS += $(VAR_DEF_ENGINE_TYPE)
|
||||||
|
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
|
||||||
|
DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_HELLEN_154_HYUNDAI
|
||||||
|
|
||||||
|
include $(BOARDS_DIR)/hellen/hellen-common144.mk
|
||||||
|
DDEFS += -DHW_HELLEN_HYUNDAI=1
|
|
@ -0,0 +1,194 @@
|
||||||
|
/**
|
||||||
|
* @file boards/hellen/hellen154hyundai/board_configuration.cpp
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @brief Configuration defaults for the hellen154hyundai board
|
||||||
|
*
|
||||||
|
* See https://rusefi.com/s/hellen154hyundai
|
||||||
|
*
|
||||||
|
* @author andreika <prometheus.pcb@gmail.com>
|
||||||
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "pch.h"
|
||||||
|
#include "defaults.h"
|
||||||
|
#include "hellen_meta.h"
|
||||||
|
|
||||||
|
static void setInjectorPins() {
|
||||||
|
engineConfiguration->injectionPins[0] = Gpio::H144_LS_1;
|
||||||
|
engineConfiguration->injectionPins[1] = Gpio::H144_LS_2;
|
||||||
|
engineConfiguration->injectionPins[2] = Gpio::H144_LS_3;
|
||||||
|
engineConfiguration->injectionPins[3] = Gpio::H144_LS_4;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setIgnitionPins() {
|
||||||
|
engineConfiguration->ignitionPins[0] = Gpio::H144_IGN_1;
|
||||||
|
engineConfiguration->ignitionPins[1] = Gpio::H144_IGN_2;
|
||||||
|
engineConfiguration->ignitionPins[2] = Gpio::H144_IGN_3;
|
||||||
|
engineConfiguration->ignitionPins[3] = Gpio::H144_IGN_4;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setupDefaultSensorInputs() {
|
||||||
|
engineConfiguration->vvtMode[0] = VVT_SINGLE_TOOTH;
|
||||||
|
engineConfiguration->vvtMode[1] = VVT_SINGLE_TOOTH;
|
||||||
|
|
||||||
|
engineConfiguration->vehicleSpeedSensorInputPin = Gpio::H144_IN_VSS;
|
||||||
|
|
||||||
|
setTPS1Inputs(H144_IN_TPS, H144_IN_AUX1);
|
||||||
|
|
||||||
|
setPPSInputs(EFI_ADC_3, EFI_ADC_14);
|
||||||
|
|
||||||
|
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP1;
|
||||||
|
|
||||||
|
engineConfiguration->afr.hwChannel = EFI_ADC_NONE;
|
||||||
|
|
||||||
|
engineConfiguration->clt.adcChannel = H144_IN_CLT;
|
||||||
|
|
||||||
|
engineConfiguration->iat.adcChannel = H144_IN_IAT;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static bool isFirstInvocation = true;
|
||||||
|
|
||||||
|
int hackHellenBoardId(int detectedId) {
|
||||||
|
if (detectedId == BOARD_ID_VAG121_D) {
|
||||||
|
// wow something bad has happened to that batch of boards?!
|
||||||
|
return BOARD_ID_154HYUNDAI_C;
|
||||||
|
}
|
||||||
|
return detectedId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setBoardConfigOverrides() {
|
||||||
|
setHellenVbatt();
|
||||||
|
|
||||||
|
setHellenSdCardSpi2();
|
||||||
|
|
||||||
|
setDefaultHellenAtPullUps();
|
||||||
|
|
||||||
|
// trigger inputs
|
||||||
|
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
|
||||||
|
// Direct hall-only cam input
|
||||||
|
// exhaust input same on both revisions
|
||||||
|
engineConfiguration->camInputs[1] = Gpio::H144_IN_D_AUX4;
|
||||||
|
|
||||||
|
int16_t hellenBoardId = engine->engineState.hellenBoardId;
|
||||||
|
|
||||||
|
if (hellenBoardId == -1) {
|
||||||
|
engineConfiguration->triggerInputPins[0] = Gpio::H144_IN_CRANK;
|
||||||
|
engineConfiguration->camInputs[0] = Gpio::H144_IN_CAM;
|
||||||
|
|
||||||
|
// control pins are inverted since overall ECU pinout seems to be inverted
|
||||||
|
engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_PWM3;
|
||||||
|
engineConfiguration->etbIo[0].directionPin2 = Gpio::H144_OUT_PWM2;
|
||||||
|
engineConfiguration->etbIo[0].controlPin = Gpio::H144_OUT_IO12;
|
||||||
|
engineConfiguration->etbIo[0].disablePin = Gpio::Unassigned;
|
||||||
|
engineConfiguration->etb_use_two_wires = true;
|
||||||
|
|
||||||
|
// first revision of did not have Hellen Board ID
|
||||||
|
// https://github.com/rusefi/hellen154hyundai/issues/55
|
||||||
|
engineConfiguration->etbIo[1].directionPin1 = Gpio::Unassigned;
|
||||||
|
engineConfiguration->etbIo[1].directionPin2 = Gpio::Unassigned;
|
||||||
|
engineConfiguration->etbIo[1].controlPin = Gpio::Unassigned;
|
||||||
|
engineConfiguration->etbIo[1].disablePin = Gpio::Unassigned;
|
||||||
|
|
||||||
|
if (isFirstInvocation) {
|
||||||
|
isFirstInvocation = false;
|
||||||
|
efiSetPadMode("ETB FIX0", Gpio::H144_OUT_PWM4, PAL_MODE_INPUT_ANALOG);
|
||||||
|
efiSetPadMode("ETB FIX1", Gpio::H144_OUT_PWM5, PAL_MODE_INPUT_ANALOG);
|
||||||
|
efiSetPadMode("ETB FIX2", Gpio::H144_OUT_IO13, PAL_MODE_INPUT_ANALOG);
|
||||||
|
}
|
||||||
|
engineConfiguration->stepperDcInvertedPins = false;
|
||||||
|
} else if (hellenBoardId == BOARD_ID_154HYUNDAI_C || hellenBoardId == BOARD_ID_154HYUNDAI_D) {
|
||||||
|
engineConfiguration->triggerInputPins[0] = Gpio::H144_IN_SENS2;
|
||||||
|
engineConfiguration->camInputs[0] = Gpio::H144_IN_SENS3;
|
||||||
|
|
||||||
|
|
||||||
|
// todo You would not believe how you invert TLE9201 #4579
|
||||||
|
engineConfiguration->stepperDcInvertedPins = true;
|
||||||
|
|
||||||
|
//ETB1
|
||||||
|
// PWM pin
|
||||||
|
engineConfiguration->etbIo[0].controlPin = Gpio::H144_OUT_PWM2;
|
||||||
|
// DIR pin
|
||||||
|
engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_PWM3;
|
||||||
|
// Disable pin
|
||||||
|
engineConfiguration->etbIo[0].disablePin = Gpio::H144_OUT_IO12;
|
||||||
|
|
||||||
|
// wastegate DC motor
|
||||||
|
//ETB2
|
||||||
|
// PWM pin
|
||||||
|
engineConfiguration->etbIo[1].controlPin = Gpio::H144_OUT_PWM4;
|
||||||
|
// DIR pin
|
||||||
|
engineConfiguration->etbIo[1].directionPin1 = Gpio::H144_OUT_PWM5;
|
||||||
|
// Disable pin
|
||||||
|
engineConfiguration->etbIo[1].disablePin = Gpio::H144_OUT_IO13;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Board-specific configuration defaults.
|
||||||
|
*
|
||||||
|
* See also setDefaultEngineConfiguration
|
||||||
|
*
|
||||||
|
|
||||||
|
*/
|
||||||
|
void setBoardDefaultConfiguration() {
|
||||||
|
setInjectorPins();
|
||||||
|
setIgnitionPins();
|
||||||
|
|
||||||
|
setHellenCan();
|
||||||
|
|
||||||
|
engineConfiguration->fuelPumpPin = Gpio::H144_OUT_IO9;
|
||||||
|
engineConfiguration->fanPin = Gpio::H144_OUT_IO7;
|
||||||
|
engineConfiguration->mainRelayPin = Gpio::H144_OUT_IO3; // pin: 111a
|
||||||
|
// BK1 uses wire, BK2 uses CANbus
|
||||||
|
engineConfiguration->malfunctionIndicatorPin = Gpio::H144_OUT_PWM8;
|
||||||
|
|
||||||
|
engineConfiguration->brakePedalPin = Gpio::H144_IN_RES3;
|
||||||
|
engineConfiguration->clutchUpPin = Gpio::H144_IN_RES2;
|
||||||
|
engineConfiguration->acSwitch = Gpio::H144_IN_RES1;
|
||||||
|
|
||||||
|
// "required" hardware is done - set some reasonable defaults
|
||||||
|
setupDefaultSensorInputs();
|
||||||
|
|
||||||
|
engineConfiguration->etbFunctions[1] = DC_Wastegate;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Gpio OUTPUTS[] = {
|
||||||
|
Gpio::H144_LS_1, // 0: INJ_1 k25
|
||||||
|
Gpio::H144_LS_2, // INJ_2 k26
|
||||||
|
Gpio::H144_LS_3, // INJ_3 k27
|
||||||
|
Gpio::H144_LS_4, // 3: INJ_4 k28
|
||||||
|
Gpio::H144_LS_5, // VVT1
|
||||||
|
Gpio::H144_LS_6, // 5: VVT2
|
||||||
|
Gpio::H144_LS_7, // K47 BK1 Wastegate Solenoid
|
||||||
|
Gpio::H144_OUT_IO7, // Fan Relay Low
|
||||||
|
Gpio::H144_OUT_IO3, // Main Relay K64
|
||||||
|
Gpio::H144_OUT_IO9, // Fuel Pump K70
|
||||||
|
Gpio::H144_OUT_IO10, // 10: K87 AC Relay
|
||||||
|
Gpio::H144_OUT_IO8, // Fan Relay HI
|
||||||
|
Gpio::H144_IGN_1, // Coil 1
|
||||||
|
Gpio::H144_IGN_2, // Coil 2
|
||||||
|
Gpio::H144_IGN_3, // Coil 3
|
||||||
|
Gpio::H144_IGN_4, // Coil 4
|
||||||
|
Gpio::H144_OUT_PWM8, // MIL
|
||||||
|
// QC procedure seems to not work for that one Gpio::H144_OUT_PWM7, // low side? Tacho unused CAN tachometer right?
|
||||||
|
// Gpio::H_SPI1_SCK, // X8 AuxLS1
|
||||||
|
};
|
||||||
|
|
||||||
|
int getBoardMetaOutputsCount() {
|
||||||
|
return efi::size(OUTPUTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
int getBoardMetaLowSideOutputsCount() {
|
||||||
|
return getBoardMetaOutputsCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
int getBoardMetaDcOutputsCount() {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gpio* getBoardMetaOutputs() {
|
||||||
|
return OUTPUTS;
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
#include "../hellen_knock_config.h"
|
|
@ -1,3 +1,2 @@
|
||||||
SHORT_BOARD_NAME=hellen154hyundai_f7
|
SHORT_BOARD_NAME=hellen154hyundai_f7
|
||||||
PROJECT_CPU=ARCH_STM32F7
|
PROJECT_CPU=ARCH_STM32F7
|
||||||
SKIP_RATE=90
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
#define MAIN_HELP_URL "https://rusefi.com/s/hellen154hyuindai"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define ts_show_vbatt false
|
||||||
|
#define ts_show_clt_iat_pullup false
|
||||||
|
#define ts_show_egt false
|
||||||
|
|
||||||
|
#define ts_show_etb_pins false
|
||||||
|
#define ts_show_analog_divider false
|
||||||
|
#define ts_show_spi false
|
||||||
|
#define ts_show_sd_card true
|
||||||
|
#define ts_show_can_pins false
|
||||||
|
#define ts_show_tunerstudio_port false
|
||||||
|
#define ts_show_can2 false
|
||||||
|
#define ts_show_software_knock true
|
||||||
|
#define ts_show_hardware_simulator false
|
||||||
|
#define ts_show_sd_pins false
|
||||||
|
#define ts_show_ignitionPinMode false
|
||||||
|
#define ts_show_tps2 false
|
||||||
|
#define ts_show_speedo_settings false
|
||||||
|
|
||||||
|
#define ts_show_bank2_cam1 false
|
||||||
|
#define ts_show_bank2_cam2 false
|
||||||
|
|
||||||
|
|
||||||
|
#define ts_show_starter_disable false
|
||||||
|
#define ts_show_fuel_pump false
|
||||||
|
#define ts_show_status_leds false
|
||||||
|
#define ts_show_idle_hardware false
|
||||||
|
#define ts_show_hd false
|
||||||
|
#define ts_show_odd_fire false
|
||||||
|
#define ts_show_rotary false
|
||||||
|
#define ts_show_cylinder_bank false
|
||||||
|
#define ts_show_maf false
|
||||||
|
|
||||||
|
#define ts_show_cylinder_9 false
|
||||||
|
#define ts_show_cylinder_10 false
|
||||||
|
#define ts_show_cylinder_11 false
|
||||||
|
#define ts_show_cylinder_12 false
|
||||||
|
|
||||||
|
#define show_Hellen_hyundai_154 true
|
Loading…
Reference in New Issue