only:uaefi
This commit is contained in:
parent
03a48a9d8a
commit
33e6ee9b8c
|
@ -0,0 +1,22 @@
|
||||||
|
# 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
|
||||||
|
|
||||||
|
#no mux on mm100
|
||||||
|
|
||||||
|
# Add them all together
|
||||||
|
DDEFS += -DFIRMWARE_ID=\"uaefi\" $(VAR_DEF_ENGINE_TYPE)
|
||||||
|
#DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
|
||||||
|
|
||||||
|
SHORT_BOARD_NAME=uaefi
|
||||||
|
|
||||||
|
DDEFS += -DHELLEN_BOARD_ID_DEBUG
|
||||||
|
|
||||||
|
include $(BOARDS_DIR)/hellen/hellen-common100.mk
|
|
@ -0,0 +1,158 @@
|
||||||
|
/**
|
||||||
|
* @file boards/hellen/uaefi/board_configuration.cpp
|
||||||
|
*
|
||||||
|
* See https://rusefi.com/s/uaefi
|
||||||
|
*
|
||||||
|
* @author Andrey Belomutskiy, (c) 2012-2023
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "pch.h"
|
||||||
|
#include "defaults.h"
|
||||||
|
#include "hellen_meta.h"
|
||||||
|
|
||||||
|
static void setInjectorPins() {
|
||||||
|
engineConfiguration->injectionPins[0] = Gpio::MM100_INJ1;
|
||||||
|
engineConfiguration->injectionPins[1] = Gpio::MM100_INJ2;
|
||||||
|
engineConfiguration->injectionPins[2] = Gpio::MM100_INJ3;
|
||||||
|
engineConfiguration->injectionPins[3] = Gpio::MM100_INJ4;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setIgnitionPins() {
|
||||||
|
engineConfiguration->ignitionPins[0] = Gpio::MM100_IGN1;
|
||||||
|
engineConfiguration->ignitionPins[1] = Gpio::MM100_IGN2;
|
||||||
|
engineConfiguration->ignitionPins[2] = Gpio::MM100_IGN3;
|
||||||
|
engineConfiguration->ignitionPins[3] = Gpio::MM100_IGN4;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setupVbatt() {
|
||||||
|
// 4.7k high side/4.7k low side = 2.0 ratio divider
|
||||||
|
engineConfiguration->analogInputDividerCoefficient = 2.0f;
|
||||||
|
|
||||||
|
// set vbatt_divider 5.835
|
||||||
|
// 33k / 6.8k
|
||||||
|
engineConfiguration->vbattDividerCoeff = (33 + 6.8) / 6.8; // 5.835
|
||||||
|
|
||||||
|
// pin input +12 from Main Relay
|
||||||
|
engineConfiguration->vbattAdcChannel = MM100_IN_VBATT;
|
||||||
|
|
||||||
|
engineConfiguration->adcVcc = 3.29f;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setupDefaultSensorInputs() {
|
||||||
|
engineConfiguration->vehicleSpeedSensorInputPin = Gpio::MM100_IN_D2;
|
||||||
|
|
||||||
|
engineConfiguration->tps1_1AdcChannel = MM100_IN_TPS_ANALOG;
|
||||||
|
engineConfiguration->tps1_2AdcChannel = MM100_IN_O2S_ANALOG;
|
||||||
|
|
||||||
|
setPPSInputs(MM100_IN_PPS_ANALOG, MM100_IN_AUX2_ANALOG);
|
||||||
|
|
||||||
|
engineConfiguration->mafAdcChannel = EFI_ADC_NONE;
|
||||||
|
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP1;
|
||||||
|
|
||||||
|
// engineConfiguration->afr.hwChannel = EFI_ADC_NONE;
|
||||||
|
|
||||||
|
engineConfiguration->clt.adcChannel = MM100_IN_CLT_ANALOG;
|
||||||
|
|
||||||
|
engineConfiguration->iat.adcChannel = MM100_IN_IAT_ANALOG;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "hellen_leds_100.cpp"
|
||||||
|
|
||||||
|
void setBoardConfigOverrides() {
|
||||||
|
// rev A needs EN pin but newer revisions would potentially not use it
|
||||||
|
setHellenMegaEnPin();
|
||||||
|
setupVbatt();
|
||||||
|
|
||||||
|
setHellenSdCardSpi1();
|
||||||
|
configureHellenMegaAccCS2Pin();
|
||||||
|
configureHellenCanTerminator();
|
||||||
|
setHellenCan();
|
||||||
|
|
||||||
|
engineConfiguration->clt.config.bias_resistor = 4700;
|
||||||
|
engineConfiguration->iat.config.bias_resistor = 4700;
|
||||||
|
|
||||||
|
engineConfiguration->triggerInputPins[0] = Gpio::MM100_IN_CRANK;
|
||||||
|
engineConfiguration->camInputs[0] = Gpio::MM100_IN_D1;
|
||||||
|
|
||||||
|
//ETB1
|
||||||
|
// PWM pin
|
||||||
|
engineConfiguration->etbIo[0].controlPin = Gpio::MM100_OUT_PWM6;
|
||||||
|
// DIR pin
|
||||||
|
engineConfiguration->etbIo[0].directionPin1 = Gpio::MM100_SPI2_MISO;
|
||||||
|
// Disable pin
|
||||||
|
engineConfiguration->etbIo[0].disablePin = Gpio::MM100_SPI2_MOSI;
|
||||||
|
// Unused
|
||||||
|
engineConfiguration->etbIo[0].directionPin2 = Gpio::Unassigned;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Board-specific configuration defaults.
|
||||||
|
*
|
||||||
|
* See also setDefaultEngineConfiguration
|
||||||
|
*
|
||||||
|
* @todo Add your board-specific code, if any.
|
||||||
|
*/
|
||||||
|
void setBoardDefaultConfiguration() {
|
||||||
|
setInjectorPins();
|
||||||
|
setIgnitionPins();
|
||||||
|
|
||||||
|
// not override since sometimes we have issues?
|
||||||
|
// setHellenMMbaro();
|
||||||
|
|
||||||
|
engineConfiguration->displayLogicLevelsInEngineSniffer = true;
|
||||||
|
|
||||||
|
engineConfiguration->globalTriggerAngleOffset = 0;
|
||||||
|
|
||||||
|
engineConfiguration->enableSoftwareKnock = true;
|
||||||
|
|
||||||
|
engineConfiguration->canTxPin = Gpio::MM100_CAN_TX;
|
||||||
|
engineConfiguration->canRxPin = Gpio::MM100_CAN_RX;
|
||||||
|
|
||||||
|
engineConfiguration->fuelPumpPin = Gpio::MM100_OUT_PWM5;
|
||||||
|
// engineConfiguration->idle.solenoidPin = Gpio::H144_LS_6;
|
||||||
|
// engineConfiguration->fanPin = Gpio::H144_OUT_IO12;
|
||||||
|
engineConfiguration->mainRelayPin = Gpio::MM100_IGN8;
|
||||||
|
// engineConfiguration->malfunctionIndicatorPin = Gpio::H144_OUT_IO7;
|
||||||
|
|
||||||
|
// how come this is not denso 183?!
|
||||||
|
setCustomMap(/*lowValue*/ 11.4, /*mapLowValueVoltage*/ 0.5, /*highValue*/ 170.7, 4.8);
|
||||||
|
|
||||||
|
// engineConfiguration->brakePedalPin = Gpio::H144_IN_CAM;
|
||||||
|
// engineConfiguration->acRelayPin = Gpio::H144_LS_5;
|
||||||
|
// engineConfiguration->tachOutputPin = Gpio::H144_OUT_IO10;
|
||||||
|
// A/C switch on k-line
|
||||||
|
|
||||||
|
// "required" hardware is done - set some reasonable defaults
|
||||||
|
setupDefaultSensorInputs();
|
||||||
|
engineConfiguration->enableVerboseCanTx = true;
|
||||||
|
|
||||||
|
engineConfiguration->etbFunctions[0] = DC_Throttle1;
|
||||||
|
|
||||||
|
// Some sensible defaults for other options
|
||||||
|
setCrankOperationMode();
|
||||||
|
|
||||||
|
setAlgorithm(LM_SPEED_DENSITY);
|
||||||
|
|
||||||
|
engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure;
|
||||||
|
|
||||||
|
setCommonNTCSensor(&engineConfiguration->clt, HELLEN_DEFAULT_AT_PULLUP);
|
||||||
|
setCommonNTCSensor(&engineConfiguration->iat, HELLEN_DEFAULT_AT_PULLUP);
|
||||||
|
|
||||||
|
setTPS1Calibration(100, 650);
|
||||||
|
//hellenWbo();
|
||||||
|
}
|
||||||
|
|
||||||
|
//static Gpio OUTPUTS[] = {
|
||||||
|
//};
|
||||||
|
|
||||||
|
//int getBoardMetaOutputsCount() {
|
||||||
|
// return efi::size(OUTPUTS);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//Gpio* getBoardMetaOutputs() {
|
||||||
|
// return OUTPUTS;
|
||||||
|
//}
|
||||||
|
|
||||||
|
int getBoardMetaDcOutputsCount() {
|
||||||
|
return 2;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
bash ../common_make.sh hellen/uaefi ARCH_STM32F4
|
|
@ -0,0 +1 @@
|
||||||
|
#include "../hellen_knock_config.h"
|
Loading…
Reference in New Issue