export board-specific macro for stm32 pins based on board yaml #3298
This commit is contained in:
parent
5a66cc6c8f
commit
05f68d68f2
|
@ -20,8 +20,8 @@ static OutputPin alpha2stepPullDown;
|
|||
static OutputPin alphaCamPullDown;
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[0] = Gpio::H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = Gpio::H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = Gpio::Unassigned;
|
||||
engineConfiguration->injectionPins[3] = Gpio::Unassigned;
|
||||
|
||||
|
@ -32,9 +32,9 @@ static void setInjectorPins() {
|
|||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[0] = Gpio::H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
|
||||
engineConfiguration->ignitionPins[2] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = Gpio::H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[3] = Gpio::Unassigned;
|
||||
}
|
||||
|
||||
|
@ -127,12 +127,12 @@ void setBoardDefaultConfiguration() {
|
|||
int16_t hellenBoardId = engine->engineState.hellenBoardId;
|
||||
if (isMegaModuleRevision()) {
|
||||
setHellenMMbaro();
|
||||
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP3; // On-board MAP
|
||||
engineConfiguration->map.sensor.hwChannel = Gpio::H144_IN_MAP3; // On-board MAP
|
||||
engineConfiguration->map.sensor.type = MT_MPXH6400;
|
||||
} else {
|
||||
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP2; // B2 external signal
|
||||
engineConfiguration->baroSensor.type = MT_MPXH6400;
|
||||
engineConfiguration->baroSensor.hwChannel = H144_IN_MAP3; // On-board MAP
|
||||
engineConfiguration->baroSensor.hwChannel = Gpio::H144_IN_MAP3; // On-board MAP
|
||||
}
|
||||
|
||||
engineConfiguration->boardUseTempPullUp = true;
|
||||
|
@ -141,7 +141,7 @@ void setBoardDefaultConfiguration() {
|
|||
engineConfiguration->fuelPumpPin = H144_OUT_PWM2;
|
||||
engineConfiguration->fanPin = H144_OUT_PWM4;
|
||||
engineConfiguration->mainRelayPin = Gpio::Unassigned;
|
||||
engineConfiguration->tachOutputPin = H144_OUT_PWM3;
|
||||
engineConfiguration->tachOutputPin = Gpio::H144_OUT_PWM3;
|
||||
|
||||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
@ -161,8 +161,8 @@ void boardPrepareForStop() {
|
|||
}
|
||||
|
||||
static Gpio OUTPUTS[] = {
|
||||
H144_LS_1,
|
||||
H144_LS_2,
|
||||
Gpio::H144_LS_1,
|
||||
Gpio::H144_LS_2,
|
||||
};
|
||||
|
||||
int getBoardMetaOutputsCount() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# https://github.com/rusefi/rusefi/blob/master/firmware/config/boards/hellen/hellen_meta.h
|
||||
meta: config/boards/hellen_meta.h
|
||||
|
||||
pins:
|
||||
- pin: A1
|
||||
|
@ -37,8 +37,7 @@ pins:
|
|||
color: brown
|
||||
|
||||
- pin: A6
|
||||
# H144_IGN_1
|
||||
id: C13
|
||||
meta: H144_IGN_1
|
||||
class: outputs
|
||||
function: Smart Ignition A Output
|
||||
type: ign
|
||||
|
@ -46,8 +45,7 @@ pins:
|
|||
color: yellow
|
||||
|
||||
- pin: A7
|
||||
# H144_IGN_2
|
||||
id: E5
|
||||
meta: H144_IGN_2
|
||||
class: outputs
|
||||
function: Smart Ignition B Output
|
||||
type: ign
|
||||
|
@ -55,8 +53,7 @@ pins:
|
|||
color: yellow
|
||||
|
||||
- pin: A8
|
||||
# H144_LS_1
|
||||
id: G7
|
||||
meta: H144_LS_1
|
||||
function: Injector A Output
|
||||
class: outputs
|
||||
type: inj
|
||||
|
@ -122,8 +119,7 @@ pins:
|
|||
color: orange
|
||||
|
||||
- pin: B8
|
||||
# H144_LS_2
|
||||
id: G8
|
||||
meta: H144_LS_2
|
||||
function: Injector B Output
|
||||
class: outputs
|
||||
type: inj
|
||||
|
|
|
@ -25,10 +25,10 @@ static OutputPin alphaD4PullDown;
|
|||
static OutputPin alphaD5PullDown;
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = H144_LS_3;
|
||||
engineConfiguration->injectionPins[3] = H144_LS_4;
|
||||
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;
|
||||
|
||||
engineConfiguration->clutchDownPin = Gpio::Unassigned;
|
||||
engineConfiguration->clutchDownPinMode = PI_PULLDOWN;
|
||||
|
@ -57,10 +57,10 @@ static void setupEtb() {
|
|||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = H144_IGN_3;
|
||||
engineConfiguration->ignitionPins[3] = H144_IGN_4;
|
||||
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 setupVbatt() {
|
||||
|
@ -116,12 +116,12 @@ void boardInitHardware() {
|
|||
alphaCamPullDown.initPin("a-cam", H144_OUT_IO8);
|
||||
alphaD3PullDown.initPin("a-d3", H144_LS_6);
|
||||
} else {
|
||||
alphaD2PullDown.initPin("a-d2", H144_OUT_IO13);
|
||||
alphaD2PullDown.initPin("a-d2", Gpio::H144_OUT_IO13;);
|
||||
alphaCamPullDown.initPin("a-cam", H144_GP4);
|
||||
alphaD3PullDown.initPin("a-d3", H144_OUT_IO8);
|
||||
}
|
||||
|
||||
alphaD4PullDown.initPin("a-d4", H144_LS_7);
|
||||
alphaD4PullDown.initPin("a-d4", Gpio::H144_LS_7);
|
||||
alphaD5PullDown.initPin("a-d5", H144_LS_8);
|
||||
boardOnConfigurationChange(nullptr);
|
||||
}
|
||||
|
@ -173,30 +173,30 @@ void setBoardDefaultConfiguration() {
|
|||
setIgnitionPins();
|
||||
setupEtb();
|
||||
if (is_F_OrOlder()) {
|
||||
engineConfiguration->tachOutputPin = H144_OUT_IO13;
|
||||
engineConfiguration->tachOutputPin = Gpio::H144_OUT_IO13;;
|
||||
engineConfiguration->vvtPins[0] = H144_OUT_PWM7;
|
||||
engineConfiguration->vvtPins[1] = H144_OUT_PWM8;
|
||||
} else {
|
||||
engineConfiguration->vvtPins[0] = H144_IGN_7;
|
||||
engineConfiguration->vvtPins[1] = H144_IGN_8;
|
||||
engineConfiguration->tachOutputPin = H144_GP3;
|
||||
engineConfiguration->vvtPins[0] = Gpio::H144_IGN_7;
|
||||
engineConfiguration->vvtPins[1] = Gpio::H144_IGN_8;
|
||||
engineConfiguration->tachOutputPin = Gpio::H144_GP3;
|
||||
}
|
||||
|
||||
|
||||
// todo: should be conditional? currently set best for newest boards based on MegaModule
|
||||
setHellenMMbaro();
|
||||
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP3; // On-board MAP
|
||||
engineConfiguration->map.sensor.hwChannel = Gpio::H144_IN_MAP3; // On-board MAP
|
||||
engineConfiguration->map.sensor.type = MT_MPXH6400;
|
||||
// engineConfiguration->baroSensor.type = MT_MPXH6400;
|
||||
// engineConfiguration->baroSensor.hwChannel = H144_IN_MAP3; // On-board MAP
|
||||
// engineConfiguration->baroSensor.hwChannel = Gpio::H144_IN_MAP3; // On-board MAP
|
||||
|
||||
engineConfiguration->boardUseTempPullUp = true;
|
||||
|
||||
engineConfiguration->acSwitch = Gpio::Unassigned;
|
||||
engineConfiguration->fuelPumpPin = H144_OUT_IO12;
|
||||
engineConfiguration->fanPin = H144_OUT_IO11;
|
||||
engineConfiguration->mainRelayPin = H144_OUT_IO10;
|
||||
engineConfiguration->boostControlPin = H144_OUT_PWM3;
|
||||
engineConfiguration->fuelPumpPin = Gpio::H144_OUT_IO12;
|
||||
engineConfiguration->fanPin = Gpio::H144_OUT_IO11;
|
||||
engineConfiguration->mainRelayPin = Gpio::H144_OUT_IO10;
|
||||
engineConfiguration->boostControlPin = Gpio::H144_OUT_PWM3;
|
||||
|
||||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
@ -220,10 +220,10 @@ void boardPrepareForStop() {
|
|||
}
|
||||
|
||||
static Gpio OUTPUTS[] = {
|
||||
H144_LS_1,
|
||||
H144_LS_2,
|
||||
H144_LS_3,
|
||||
H144_LS_4,
|
||||
Gpio::H144_LS_1,
|
||||
Gpio::H144_LS_2,
|
||||
Gpio::H144_LS_3,
|
||||
Gpio::H144_LS_4,
|
||||
};
|
||||
|
||||
int getBoardMetaOutputsCount() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# https://github.com/rusefi/rusefi/blob/master/firmware/config/boards/hellen/hellen_meta.h
|
||||
meta: config/boards/hellen_meta.h
|
||||
|
||||
pins:
|
||||
- pin: A1
|
||||
|
@ -21,16 +21,14 @@ pins:
|
|||
color: purple
|
||||
|
||||
- pin: A4old
|
||||
# H144_OUT_IO13
|
||||
id: G6
|
||||
meta: H144_OUT_IO13
|
||||
class: outputs
|
||||
function: Tachometer Output
|
||||
ts_name: A4 - Tachometer legacy up to rev F
|
||||
color: purple
|
||||
|
||||
- pin: A4
|
||||
# H144_GP3
|
||||
id: G10
|
||||
meta: H144_GP3
|
||||
class: outputs
|
||||
function: Tachometer Output
|
||||
ts_name: A4 - Tachometer
|
||||
|
@ -42,8 +40,7 @@ pins:
|
|||
color: brown
|
||||
|
||||
- pin: A6
|
||||
# H144_IGN_1
|
||||
id: C13
|
||||
meta: H144_IGN_1
|
||||
class: outputs
|
||||
function: Smart Ignition 1
|
||||
type: ign
|
||||
|
@ -51,8 +48,7 @@ pins:
|
|||
color: yellow
|
||||
|
||||
- pin: A7
|
||||
# H144_IGN_2
|
||||
id: E5
|
||||
meta: H144_IGN_2
|
||||
class: outputs
|
||||
function: Smart Ignition 2 Output
|
||||
type: ign
|
||||
|
@ -60,8 +56,7 @@ pins:
|
|||
color: yellow
|
||||
|
||||
- pin: A8
|
||||
# H144_LS_1
|
||||
id: G7
|
||||
meta: H144_LS_1
|
||||
function: Injector 1 Output
|
||||
class: outputs
|
||||
type: inj
|
||||
|
@ -74,8 +69,7 @@ pins:
|
|||
color: black
|
||||
|
||||
- pin: On-board MAP
|
||||
# H144_IN_MAP3
|
||||
id: EFI_ADC_2
|
||||
meta: H144_IN_MAP3
|
||||
class: analog_inputs
|
||||
function: MAP Sensor Input
|
||||
ts_name: On-board MAP
|
||||
|
@ -127,8 +121,7 @@ pins:
|
|||
color: orange
|
||||
|
||||
- pin: B8
|
||||
# H144_LS_2
|
||||
id: G8
|
||||
meta: H144_LS_2
|
||||
function: Injector 2 Output
|
||||
class: outputs
|
||||
type: inj
|
||||
|
@ -136,8 +129,7 @@ pins:
|
|||
color: blue
|
||||
|
||||
- pin: C1
|
||||
# H144_OUT_IO11
|
||||
id: G2
|
||||
meta: H144_OUT_IO11
|
||||
class: outputs
|
||||
function: Fan Relay or 5A Power Output (low)
|
||||
type: ls
|
||||
|
@ -200,8 +192,7 @@ pins:
|
|||
color: brown
|
||||
|
||||
- pin: C8
|
||||
# H144_OUT_PWM1
|
||||
id: D13
|
||||
meta: H144_OUT_PWM1
|
||||
class: outputs
|
||||
function: Idle Output (low)
|
||||
type: ls
|
||||
|
@ -209,8 +200,7 @@ pins:
|
|||
color: purple
|
||||
|
||||
- pin: D1
|
||||
# H144_LS_3
|
||||
id: D11
|
||||
meta: H144_LS_3
|
||||
function: Injector 3
|
||||
class: outputs
|
||||
type: inj
|
||||
|
@ -218,8 +208,7 @@ pins:
|
|||
color: blue
|
||||
|
||||
- pin: D2
|
||||
# H144_OUT_PWM3
|
||||
id: C7
|
||||
meta: H144_OUT_PWM3
|
||||
function: Out Boost
|
||||
class: outputs
|
||||
ts_name: D2 - Out Boost
|
||||
|
@ -259,8 +248,7 @@ pins:
|
|||
color: orange
|
||||
|
||||
- pin: D6
|
||||
# H144_IGN_3
|
||||
id: E4
|
||||
meta: H144_IGN_3
|
||||
class: outputs
|
||||
function: Smart Ignition 3 Output
|
||||
type: ign
|
||||
|
@ -268,8 +256,7 @@ pins:
|
|||
color: yellow
|
||||
|
||||
- pin: D7
|
||||
# H144_IGN_4
|
||||
id: E3
|
||||
meta: H144_IGN_4
|
||||
class: outputs
|
||||
function: Smart Ignition 4 Output
|
||||
type: ign
|
||||
|
@ -282,8 +269,7 @@ pins:
|
|||
color: black
|
||||
|
||||
- pin: E1
|
||||
# H144_LS_4
|
||||
id: D10
|
||||
meta: H144_LS_4
|
||||
function: Injector 4
|
||||
class: outputs
|
||||
type: inj
|
||||
|
@ -291,8 +277,7 @@ pins:
|
|||
color: blue
|
||||
|
||||
- pin: E2
|
||||
# H144_OUT_IO6
|
||||
id: G11
|
||||
meta: H144_OUT_IO6
|
||||
function: Out NOS
|
||||
class: outputs
|
||||
ts_name: E2 - Out NOS
|
||||
|
@ -370,8 +355,7 @@ pins:
|
|||
color: purple
|
||||
|
||||
- pin: F2g
|
||||
# H144_IGN_7
|
||||
id: B9
|
||||
meta: H144_IGN_7
|
||||
function: VVT#1 rev G
|
||||
class: outputs
|
||||
type: ls
|
||||
|
@ -398,8 +382,7 @@ pins:
|
|||
color: purple
|
||||
|
||||
- pin: F4g
|
||||
# H144_IGN_8
|
||||
id: E6
|
||||
meta: H144_IGN_8
|
||||
function: VVT#2 rev G
|
||||
class: outputs
|
||||
type: ls
|
||||
|
|
|
@ -24,10 +24,10 @@ static OutputPin alphaD4PullDown;
|
|||
//static OutputPin alphaD5PullDown;
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = H144_LS_3;
|
||||
engineConfiguration->injectionPins[3] = H144_LS_4;
|
||||
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;
|
||||
|
||||
engineConfiguration->clutchDownPin = Gpio::Unassigned;
|
||||
engineConfiguration->clutchDownPinMode = PI_PULLDOWN;
|
||||
|
@ -54,7 +54,7 @@ static void setupEtb() {
|
|||
// PWM pin
|
||||
engineConfiguration->etbIo[1].controlPin = H144_GP4;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[1].directionPin1 = H144_GP3;
|
||||
engineConfiguration->etbIo[1].directionPin1 = Gpio::H144_GP3;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[1].disablePin = Gpio::Unassigned;
|
||||
// Unused
|
||||
|
@ -64,10 +64,10 @@ static void setupEtb() {
|
|||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = H144_IGN_3;
|
||||
engineConfiguration->ignitionPins[3] = H144_IGN_4;
|
||||
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 setupVbatt() {
|
||||
|
@ -100,7 +100,7 @@ static void setupDefaultSensorInputs() {
|
|||
engineConfiguration->mafAdcChannel = EFI_ADC_NONE;
|
||||
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP2;
|
||||
engineConfiguration->baroSensor.type = MT_MPXH6400;
|
||||
// engineConfiguration->baroSensor.hwChannel = H144_IN_MAP3;
|
||||
// engineConfiguration->baroSensor.hwChannel = Gpio::H144_IN_MAP3;
|
||||
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_NONE;
|
||||
|
||||
|
@ -167,10 +167,10 @@ void setBoardDefaultConfiguration() {
|
|||
|
||||
engineConfiguration->boardUseTempPullUp = true;
|
||||
|
||||
engineConfiguration->mainRelayPin = H144_OUT_IO10;
|
||||
engineConfiguration->fanPin = H144_OUT_IO11;
|
||||
engineConfiguration->fuelPumpPin = H144_OUT_IO12;
|
||||
engineConfiguration->tachOutputPin = H144_OUT_IO13;
|
||||
engineConfiguration->mainRelayPin = Gpio::H144_OUT_IO10;
|
||||
engineConfiguration->fanPin = Gpio::H144_OUT_IO11;
|
||||
engineConfiguration->fuelPumpPin = Gpio::H144_OUT_IO12;
|
||||
engineConfiguration->tachOutputPin = Gpio::H144_OUT_IO13;;
|
||||
|
||||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
@ -195,10 +195,10 @@ void boardPrepareForStop() {
|
|||
}
|
||||
|
||||
static Gpio OUTPUTS[] = {
|
||||
H144_LS_1,
|
||||
H144_LS_2,
|
||||
H144_LS_3,
|
||||
H144_LS_4,
|
||||
Gpio::H144_LS_1,
|
||||
Gpio::H144_LS_2,
|
||||
Gpio::H144_LS_3,
|
||||
Gpio::H144_LS_4,
|
||||
};
|
||||
|
||||
int getBoardMetaOutputsCount() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
meta: config/boards/hellen_meta.h
|
||||
|
||||
pins:
|
||||
- pin: On-board MAP
|
||||
# H144_IN_MAP2
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
meta: config/boards/hellen_meta.h
|
||||
|
||||
pins:
|
||||
- pin: 1C
|
||||
# H144_LS_8
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
pins:
|
||||
meta: config/boards/hellen_meta.h
|
||||
|
||||
pins:
|
||||
- pin: 1D
|
||||
function: DC3 positive
|
||||
type: etb
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
#include "defaults.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[0] = Gpio::H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = Gpio::H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = Gpio::Unassigned;
|
||||
engineConfiguration->injectionPins[3] = Gpio::Unassigned;
|
||||
|
||||
|
@ -25,8 +25,8 @@ static void setInjectorPins() {
|
|||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[0] = Gpio::H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = Gpio::H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = Gpio::Unassigned;
|
||||
engineConfiguration->ignitionPins[3] = Gpio::Unassigned;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ static void setupEtb() {
|
|||
// PWM pin
|
||||
engineConfiguration->etbIo[0].controlPin = H144_OUT_PWM2;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[0].directionPin1 = H144_OUT_PWM1;
|
||||
engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_PWM1;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[0].disablePin = H144_OUT_IO1;
|
||||
// Unused
|
||||
|
@ -80,7 +80,7 @@ static void setupDefaultSensorInputs() {
|
|||
engineConfiguration->mafAdcChannel = H144_IN_MAP1;
|
||||
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP2;
|
||||
engineConfiguration->baroSensor.type = MT_MPXH6400;
|
||||
engineConfiguration->baroSensor.hwChannel = H144_IN_MAP3;
|
||||
engineConfiguration->baroSensor.hwChannel = Gpio::H144_IN_MAP3;
|
||||
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_NONE;
|
||||
|
||||
|
@ -126,7 +126,7 @@ void setBoardDefaultConfiguration() {
|
|||
// engineConfiguration->fuelPumpPin = Gpio::Unassigned;//H144_OUT_PWM2;
|
||||
// engineConfiguration->fanPin = Gpio::Unassigned;//H144_OUT_PWM4;
|
||||
engineConfiguration->mainRelayPin = Gpio::Unassigned;
|
||||
engineConfiguration->tachOutputPin = H144_OUT_PWM3;
|
||||
engineConfiguration->tachOutputPin = Gpio::H144_OUT_PWM3;
|
||||
|
||||
// "required" hardware is done - set some reasonable defaults
|
||||
setupDefaultSensorInputs();
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
#include "defaults.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = H144_LS_3;
|
||||
engineConfiguration->injectionPins[3] = H144_LS_4;
|
||||
engineConfiguration->injectionPins[4] = H144_LS_5;
|
||||
engineConfiguration->injectionPins[5] = H144_LS_6;
|
||||
engineConfiguration->injectionPins[6] = H144_LS_7;
|
||||
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;
|
||||
engineConfiguration->injectionPins[4] = Gpio::H144_LS_5;
|
||||
engineConfiguration->injectionPins[5] = Gpio::H144_LS_6;
|
||||
engineConfiguration->injectionPins[6] = Gpio::H144_LS_7;
|
||||
engineConfiguration->injectionPins[7] = H144_LS_8;
|
||||
|
||||
engineConfiguration->clutchDownPin = Gpio::C4; // Clutch switch input
|
||||
|
@ -30,14 +30,14 @@ static void setInjectorPins() {
|
|||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = H144_IGN_3;
|
||||
engineConfiguration->ignitionPins[3] = H144_IGN_4;
|
||||
engineConfiguration->ignitionPins[4] = H144_IGN_5;
|
||||
engineConfiguration->ignitionPins[5] = H144_IGN_6;
|
||||
engineConfiguration->ignitionPins[6] = H144_IGN_7;
|
||||
engineConfiguration->ignitionPins[7] = H144_IGN_8;
|
||||
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;
|
||||
engineConfiguration->ignitionPins[4] = Gpio::H144_IGN_5;;
|
||||
engineConfiguration->ignitionPins[5] = Gpio::H144_IGN_6;
|
||||
engineConfiguration->ignitionPins[6] = Gpio::H144_IGN_7;
|
||||
engineConfiguration->ignitionPins[7] = Gpio::H144_IGN_8;
|
||||
}
|
||||
|
||||
static void setupVbatt() {
|
||||
|
@ -94,7 +94,7 @@ void setBoardConfigOverrides() {
|
|||
// PWM pin
|
||||
engineConfiguration->etbIo[0].controlPin = H144_OUT_PWM8;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[0].directionPin1 = H144_OUT_IO13;
|
||||
engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_IO13;;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[0].disablePin = H144_OUT_IO4;
|
||||
// Unused
|
||||
|
@ -118,17 +118,17 @@ void setBoardDefaultConfiguration() {
|
|||
|
||||
engineConfiguration->invertPrimaryTriggerSignal = true;
|
||||
|
||||
engineConfiguration->luaOutputPins[0] = H144_OUT_IO6; // starter relay
|
||||
engineConfiguration->luaOutputPins[0] = Gpio::H144_OUT_IO6; // starter relay
|
||||
|
||||
engineConfiguration->boostControlPin = H144_OUT_PWM5;
|
||||
engineConfiguration->brakePedalPin = H144_IN_RES2;
|
||||
// engineConfiguration->acSwitch =
|
||||
// engineConfiguration->acRelayPin =
|
||||
engineConfiguration->fuelPumpPin = H144_OUT_IO5;
|
||||
engineConfiguration->fanPin = H144_OUT_IO12;
|
||||
engineConfiguration->fanPin = Gpio::H144_OUT_IO12;
|
||||
engineConfiguration->mainRelayPin = H144_OUT_IO3;
|
||||
engineConfiguration->tachOutputPin = H144_OUT_PWM7;
|
||||
engineConfiguration->alternatorControlPin = H144_OUT_PWM1;
|
||||
engineConfiguration->alternatorControlPin = Gpio::H144_OUT_PWM1;
|
||||
// engineConfiguration->fan2Pin =
|
||||
|
||||
// "required" hardware is done - set some reasonable defaults
|
||||
|
|
|
@ -12,17 +12,17 @@
|
|||
#include "honda_k_dbc.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = H144_LS_3;
|
||||
engineConfiguration->injectionPins[3] = H144_LS_4;
|
||||
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] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = H144_IGN_3;
|
||||
engineConfiguration->ignitionPins[3] = H144_IGN_4;
|
||||
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 setupVbatt() {
|
||||
|
@ -82,9 +82,9 @@ void setBoardConfigOverrides() {
|
|||
// // PWM pin
|
||||
// engineConfiguration->etbIo[0].controlPin = H144_OUT_PWM2;
|
||||
// // DIR pin
|
||||
// engineConfiguration->etbIo[0].directionPin1 = H144_OUT_PWM3;
|
||||
// engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_PWM3;
|
||||
// // Disable pin
|
||||
// engineConfiguration->etbIo[0].disablePin = H144_OUT_IO12;
|
||||
// engineConfiguration->etbIo[0].disablePin = Gpio::H144_OUT_IO12;
|
||||
// // Unused
|
||||
// engineConfiguration->etbIo[0].directionPin2 = Gpio::Unassigned;
|
||||
|
||||
|
@ -117,11 +117,11 @@ void setBoardDefaultConfiguration() {
|
|||
engineConfiguration->vvtPins[0] = H144_OUT_PWM4;
|
||||
|
||||
gppwm_channel *vtsControl = &engineConfiguration->gppwm[0];
|
||||
// vtsControl->pin = H144_OUT_IO6;
|
||||
// vtsControl->pin = Gpio::H144_OUT_IO6;
|
||||
|
||||
engineConfiguration->fuelPumpPin = H144_OUT_IO13;
|
||||
engineConfiguration->idle.solenoidPin = H144_LS_6;
|
||||
engineConfiguration->fanPin = H144_OUT_IO12;
|
||||
engineConfiguration->fuelPumpPin = Gpio::H144_OUT_IO13;;
|
||||
engineConfiguration->idle.solenoidPin = Gpio::H144_LS_6;
|
||||
engineConfiguration->fanPin = Gpio::H144_OUT_IO12;
|
||||
engineConfiguration->mainRelayPin = H144_OUT_IO3;
|
||||
engineConfiguration->malfunctionIndicatorPin = H144_OUT_IO7;
|
||||
|
||||
|
@ -138,8 +138,8 @@ void setBoardDefaultConfiguration() {
|
|||
engineConfiguration->verboseKLine = true;
|
||||
|
||||
engineConfiguration->brakePedalPin = H144_IN_CAM;
|
||||
engineConfiguration->acRelayPin = H144_LS_5;
|
||||
engineConfiguration->tachOutputPin = H144_OUT_IO10;
|
||||
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
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
#include "hellen_meta.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = H144_LS_3;
|
||||
engineConfiguration->injectionPins[3] = H144_LS_4;
|
||||
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;
|
||||
|
||||
engineConfiguration->clutchDownPin = Gpio::C4; // Clutch switch input
|
||||
engineConfiguration->clutchDownPinMode = PI_PULLDOWN;
|
||||
|
@ -26,9 +26,9 @@ static void setInjectorPins() {
|
|||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[0] = Gpio::H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
|
||||
engineConfiguration->ignitionPins[2] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = Gpio::H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[3] = Gpio::Unassigned;
|
||||
}
|
||||
|
||||
|
@ -89,14 +89,14 @@ void setBoardDefaultConfiguration() {
|
|||
|
||||
engineConfiguration->enableSoftwareKnock = true;
|
||||
|
||||
engineConfiguration->boostControlPin = H144_LS_6;
|
||||
engineConfiguration->boostControlPin = Gpio::H144_LS_6;
|
||||
engineConfiguration->acSwitch = H144_IN_D_AUX3;
|
||||
engineConfiguration->acRelayPin = H144_OUT_IO6;
|
||||
engineConfiguration->acRelayPin = Gpio::H144_OUT_IO6;
|
||||
engineConfiguration->fuelPumpPin = Gpio::G2; // OUT_IO9
|
||||
engineConfiguration->idle.solenoidPin = Gpio::D14; // OUT_PWM5
|
||||
engineConfiguration->fanPin = Gpio::D12; // OUT_PWM8
|
||||
engineConfiguration->mainRelayPin = Gpio::I2; // OUT_LOW3
|
||||
engineConfiguration->tachOutputPin = H144_OUT_PWM1;
|
||||
engineConfiguration->tachOutputPin = Gpio::H144_OUT_PWM1;
|
||||
engineConfiguration->alternatorControlPin = H144_OUT_PWM7;
|
||||
engineConfiguration->fan2Pin = H144_OUT_IO2;
|
||||
|
||||
|
|
|
@ -16,21 +16,21 @@
|
|||
#include "hellen_meta.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = H144_LS_3;
|
||||
engineConfiguration->injectionPins[3] = H144_LS_4;
|
||||
engineConfiguration->injectionPins[4] = H144_LS_5;
|
||||
engineConfiguration->injectionPins[5] = H144_LS_6;
|
||||
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;
|
||||
engineConfiguration->injectionPins[4] = Gpio::H144_LS_5;
|
||||
engineConfiguration->injectionPins[5] = Gpio::H144_LS_6;
|
||||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = H144_IGN_3;
|
||||
engineConfiguration->ignitionPins[3] = H144_IGN_4;
|
||||
engineConfiguration->ignitionPins[4] = H144_IGN_5;
|
||||
engineConfiguration->ignitionPins[5] = H144_IGN_6;
|
||||
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;
|
||||
engineConfiguration->ignitionPins[4] = Gpio::H144_IGN_5;;
|
||||
engineConfiguration->ignitionPins[5] = Gpio::H144_IGN_6;
|
||||
}
|
||||
|
||||
static void setupVbatt() {
|
||||
|
|
|
@ -15,17 +15,17 @@
|
|||
#include "hellen_meta.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = H144_LS_3;
|
||||
engineConfiguration->injectionPins[3] = H144_LS_4;
|
||||
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] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = H144_IGN_3;
|
||||
engineConfiguration->ignitionPins[3] = H144_IGN_4;
|
||||
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 setupVbatt() {
|
||||
|
@ -84,9 +84,9 @@ void setBoardConfigOverrides() {
|
|||
engineConfiguration->camInputs[0] = H144_IN_CAM;
|
||||
|
||||
// control pins are inverted since overall ECU pinout seems to be inverted
|
||||
engineConfiguration->etbIo[0].directionPin1 = H144_OUT_PWM3;
|
||||
engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_PWM3;
|
||||
engineConfiguration->etbIo[0].directionPin2 = H144_OUT_PWM2;
|
||||
engineConfiguration->etbIo[0].controlPin = H144_OUT_IO12;
|
||||
engineConfiguration->etbIo[0].controlPin = Gpio::H144_OUT_IO12;
|
||||
engineConfiguration->etbIo[0].disablePin = Gpio::Unassigned;
|
||||
engineConfiguration->etb_use_two_wires = true;
|
||||
|
||||
|
@ -101,7 +101,7 @@ void setBoardConfigOverrides() {
|
|||
isFirstInvocation = false;
|
||||
efiSetPadMode("ETB FIX0", H144_OUT_PWM4, PAL_MODE_INPUT_ANALOG);
|
||||
efiSetPadMode("ETB FIX1", H144_OUT_PWM5, PAL_MODE_INPUT_ANALOG);
|
||||
efiSetPadMode("ETB FIX2", H144_OUT_IO13, 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) {
|
||||
|
@ -116,9 +116,9 @@ void setBoardConfigOverrides() {
|
|||
// PWM pin
|
||||
engineConfiguration->etbIo[0].controlPin = H144_OUT_PWM2;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[0].directionPin1 = H144_OUT_PWM3;
|
||||
engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_PWM3;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[0].disablePin = H144_OUT_IO12;
|
||||
engineConfiguration->etbIo[0].disablePin = Gpio::H144_OUT_IO12;
|
||||
// Unused
|
||||
engineConfiguration->etbIo[0].directionPin2 = Gpio::Unassigned;
|
||||
|
||||
|
@ -129,7 +129,7 @@ void setBoardConfigOverrides() {
|
|||
// DIR pin
|
||||
engineConfiguration->etbIo[1].directionPin1 = H144_OUT_PWM5;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[1].disablePin = H144_OUT_IO13;
|
||||
engineConfiguration->etbIo[1].disablePin = Gpio::H144_OUT_IO13;;
|
||||
// Unused
|
||||
engineConfiguration->etbIo[1].directionPin2 = Gpio::Unassigned;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ void setBoardConfigOverrides() {
|
|||
}
|
||||
|
||||
// NB2 still uses L6205PD
|
||||
engineConfiguration->etbIo[0].directionPin1 = H144_OUT_PWM3; // ETB+
|
||||
engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_PWM3; // ETB+
|
||||
engineConfiguration->etbIo[0].directionPin2 = H144_OUT_PWM4; // ETB-
|
||||
engineConfiguration->etbIo[0].controlPin = H144_OUT_PWM2; // ETB_EN
|
||||
engineConfiguration->etb_use_two_wires = true;
|
||||
|
|
|
@ -13,21 +13,21 @@
|
|||
#include "defaults.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = H144_LS_3;
|
||||
engineConfiguration->injectionPins[3] = H144_LS_4;
|
||||
engineConfiguration->injectionPins[4] = H144_LS_5;
|
||||
engineConfiguration->injectionPins[5] = H144_LS_6;
|
||||
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;
|
||||
engineConfiguration->injectionPins[4] = Gpio::H144_LS_5;
|
||||
engineConfiguration->injectionPins[5] = Gpio::H144_LS_6;
|
||||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = H144_IGN_3;
|
||||
engineConfiguration->ignitionPins[3] = H144_IGN_4;
|
||||
engineConfiguration->ignitionPins[4] = H144_IGN_5;
|
||||
engineConfiguration->ignitionPins[5] = H144_IGN_6;
|
||||
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;
|
||||
engineConfiguration->ignitionPins[4] = Gpio::H144_IGN_5;;
|
||||
engineConfiguration->ignitionPins[5] = Gpio::H144_IGN_6;
|
||||
}
|
||||
|
||||
static void setupVbatt() {
|
||||
|
@ -72,8 +72,8 @@ void setBoardConfigOverrides() {
|
|||
|
||||
// hellen88bmw uses L6205PD
|
||||
engineConfiguration->etbIo[0].directionPin1 = H144_OUT_PWM2; // ETB+
|
||||
engineConfiguration->etbIo[0].directionPin2 = H144_OUT_PWM3; // ETB-
|
||||
engineConfiguration->etbIo[0].controlPin = H144_OUT_PWM1; // ETB_EN
|
||||
engineConfiguration->etbIo[0].directionPin2 = Gpio::H144_OUT_PWM3; // ETB-
|
||||
engineConfiguration->etbIo[0].controlPin = Gpio::H144_OUT_PWM1; // ETB_EN
|
||||
engineConfiguration->etb_use_two_wires = true;
|
||||
|
||||
setHellenSdCardSpi3();
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
#include "hellen_meta.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = H144_LS_1;
|
||||
engineConfiguration->injectionPins[1] = H144_LS_2;
|
||||
engineConfiguration->injectionPins[2] = H144_LS_3;
|
||||
engineConfiguration->injectionPins[3] = H144_LS_4;
|
||||
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;
|
||||
|
||||
engineConfiguration->clutchDownPin = Gpio::C4; // Clutch switch input
|
||||
engineConfiguration->clutchDownPinMode = PI_PULLDOWN;
|
||||
|
@ -26,9 +26,9 @@ static void setInjectorPins() {
|
|||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[0] = Gpio::H144_IGN_1;
|
||||
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
|
||||
engineConfiguration->ignitionPins[2] = H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[2] = Gpio::H144_IGN_2;
|
||||
engineConfiguration->ignitionPins[3] = Gpio::Unassigned;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ static void setupDefaultSensorInputs() {
|
|||
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;
|
||||
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_10;
|
||||
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP3;
|
||||
engineConfiguration->map.sensor.hwChannel = Gpio::H144_IN_MAP3;
|
||||
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_1;
|
||||
|
||||
|
@ -94,13 +94,13 @@ void setBoardDefaultConfiguration() {
|
|||
|
||||
engineConfiguration->enableSoftwareKnock = true;
|
||||
|
||||
engineConfiguration->boostControlPin = H144_LS_6;
|
||||
engineConfiguration->boostControlPin = Gpio::H144_LS_6;
|
||||
engineConfiguration->acSwitch = H144_IN_D_AUX3;
|
||||
engineConfiguration->acRelayPin = H144_OUT_IO6;
|
||||
engineConfiguration->acRelayPin = Gpio::H144_OUT_IO6;
|
||||
engineConfiguration->fuelPumpPin = Gpio::G2; // OUT_IO9
|
||||
engineConfiguration->idle.solenoidPin = Gpio::D14; // OUT_PWM5
|
||||
engineConfiguration->fanPin = Gpio::D12; // OUT_PWM8
|
||||
engineConfiguration->tachOutputPin = H144_OUT_PWM1;
|
||||
engineConfiguration->tachOutputPin = Gpio::H144_OUT_PWM1;
|
||||
engineConfiguration->fan2Pin = H144_OUT_IO2;
|
||||
|
||||
// "required" hardware is done - set some reasonable defaults
|
||||
|
|
|
@ -70,23 +70,23 @@ void detectHellenBoardType();
|
|||
|
||||
#define H176_LED1_RED Gpio::H8
|
||||
|
||||
#define H144_LS_1 Gpio::G7
|
||||
#define H144_LS_2 Gpio::G8
|
||||
#define H144_LS_3 Gpio::D11
|
||||
#define H144_LS_4 Gpio::D10
|
||||
#define H144_LS_5 Gpio::D9
|
||||
#define H144_LS_6 Gpio::F12
|
||||
#define H144_LS_7 Gpio::F13
|
||||
#define H144_LS_8 Gpio::F14
|
||||
#define H144_LS_1 G7
|
||||
#define H144_LS_2 G8
|
||||
#define H144_LS_3 D11
|
||||
#define H144_LS_4 D10
|
||||
#define H144_LS_5 D9
|
||||
#define H144_LS_6 F12
|
||||
#define H144_LS_7 F13
|
||||
#define H144_LS_8 F14
|
||||
|
||||
#define H144_IGN_1 Gpio::C13
|
||||
#define H144_IGN_2 Gpio::E5
|
||||
#define H144_IGN_3 Gpio::E4
|
||||
#define H144_IGN_4 Gpio::E3
|
||||
#define H144_IGN_5 Gpio::E2
|
||||
#define H144_IGN_6 Gpio::B8
|
||||
#define H144_IGN_7 Gpio::B9
|
||||
#define H144_IGN_8 Gpio::E6
|
||||
#define H144_IGN_1 C13
|
||||
#define H144_IGN_2 E5
|
||||
#define H144_IGN_3 E4
|
||||
#define H144_IGN_4 E3
|
||||
#define H144_IGN_5 E2
|
||||
#define H144_IGN_6 B8
|
||||
#define H144_IGN_7 B9
|
||||
#define H144_IGN_8 E6
|
||||
|
||||
#define H176_IGN_1 Gpio::I8
|
||||
#define H176_IGN_2 Gpio::E5
|
||||
|
@ -94,9 +94,9 @@ void detectHellenBoardType();
|
|||
#define H176_IGN_4 Gpio::E3
|
||||
#define H176_IGN_5 Gpio::E2
|
||||
|
||||
#define H144_OUT_PWM1 Gpio::D13
|
||||
#define H144_OUT_PWM1 D13
|
||||
#define H144_OUT_PWM2 Gpio::C6
|
||||
#define H144_OUT_PWM3 Gpio::C7
|
||||
#define H144_OUT_PWM3 C7
|
||||
#define H144_OUT_PWM4 Gpio::C8
|
||||
#define H144_OUT_PWM5 Gpio::C9
|
||||
#define H144_OUT_PWM6 Gpio::D14
|
||||
|
@ -108,7 +108,7 @@ void detectHellenBoardType();
|
|||
#define H144_GP1 Gpio::D4
|
||||
// also IO2/IO5 on rev 0.6
|
||||
#define H144_GP2 Gpio::D7
|
||||
#define H144_GP3 Gpio::G10
|
||||
#define H144_GP3 G10
|
||||
#define H144_GP4 Gpio::G9
|
||||
#define H144_GP5 Gpio::G15
|
||||
#define H144_GP6 Gpio::D8
|
||||
|
@ -121,14 +121,14 @@ void detectHellenBoardType();
|
|||
#define H144_OUT_IO3 Gpio::G14
|
||||
#define H144_OUT_IO4 Gpio::G5
|
||||
#define H144_OUT_IO5 Gpio::D2
|
||||
#define H144_OUT_IO6 Gpio::G11
|
||||
#define H144_OUT_IO6 G11
|
||||
#define H144_OUT_IO7 Gpio::G3
|
||||
#define H144_OUT_IO8 Gpio::G4
|
||||
#define H144_OUT_IO9 Gpio::G13
|
||||
#define H144_OUT_IO10 Gpio::G12
|
||||
#define H144_OUT_IO11 Gpio::G2
|
||||
#define H144_OUT_IO12 Gpio::A8
|
||||
#define H144_OUT_IO13 Gpio::G6
|
||||
#define H144_OUT_IO10 G12
|
||||
#define H144_OUT_IO11 G2
|
||||
#define H144_OUT_IO12 A8
|
||||
#define H144_OUT_IO13 G6
|
||||
|
||||
// A24
|
||||
#define H144_IN_CRANK Gpio::B1
|
||||
|
|
|
@ -21,7 +21,7 @@ void setStepperHw() {
|
|||
setPPSInputs(EFI_ADC_NONE, EFI_ADC_NONE);
|
||||
// using 8chan pinout for DC1: A26 (OUT_DC1+ AH pin "D") and A27 (OUT_DC1- AL pin "C")
|
||||
engineConfiguration->stepperDcIo[0].controlPin = H144_GP4; // DC1_PWM
|
||||
engineConfiguration->stepperDcIo[0].directionPin1 = H144_GP3; // DC1_DIR
|
||||
engineConfiguration->stepperDcIo[0].directionPin1 = Gpio::H144_GP3; // DC1_DIR
|
||||
engineConfiguration->stepperDcIo[0].directionPin2 = Gpio::Unassigned;
|
||||
engineConfiguration->stepperDcIo[0].disablePin = H144_GP5; // ETB_DIS
|
||||
// using 8chan pinout for DC2: A28 (OUT_DC2+ BL pin "A") and A29 (OUT_DC2- BH pin "B")
|
||||
|
|
|
@ -17,7 +17,7 @@ static void common() {
|
|||
void setHellenMercedes128_4_cyl() {
|
||||
common();
|
||||
#if HW_HELLEN
|
||||
engineConfiguration->injectionPins[0] = H144_LS_7;
|
||||
engineConfiguration->injectionPins[0] = Gpio::H144_LS_7;
|
||||
engineConfiguration->injectionPins[1] = H176_LS_6;
|
||||
engineConfiguration->injectionPins[2] = H176_LS_8;
|
||||
engineConfiguration->injectionPins[3] = H176_LS_5;
|
||||
|
|
|
@ -66,7 +66,7 @@ public class FileSystemBoardInputsImpl implements BoardInputs {
|
|||
@Override
|
||||
public List<String> getBoardMeta(String boardMetaFileName) {
|
||||
try {
|
||||
return Files.readAllLines(Paths.get(URI.create(boardMetaFileName)));
|
||||
return Files.readAllLines(Paths.get(boardMetaFileName));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
@ -145,6 +145,15 @@ public class PinoutLogic {
|
|||
Objects.requireNonNull(data, "data");
|
||||
for (Map<String, Object> pin : data) {
|
||||
Object pinId = pin.get("id");
|
||||
String meta = (String) pin.get("meta");
|
||||
if (meta != null && pinId != null) {
|
||||
throw new IllegalStateException(pinId + " not expected with meta=" + meta);
|
||||
}
|
||||
if (meta != null) {
|
||||
pinId = map.get(meta);
|
||||
if (pinId == null)
|
||||
throw new IllegalStateException("Failing to resolve [" + meta + "]");
|
||||
}
|
||||
Object pinClass = pin.get("class");
|
||||
Object pinName = pin.get("pin");
|
||||
Object pinTsName = pin.get("ts_name");
|
||||
|
@ -180,7 +189,7 @@ public class PinoutLogic {
|
|||
|
||||
private Map<String, String> processMetaHeader(Map<String, Object> yamlData) {
|
||||
String metaHeader = (String) yamlData.get("meta");
|
||||
if (metaHeader==null)
|
||||
if (metaHeader == null)
|
||||
return Collections.emptyMap();
|
||||
|
||||
return getStringStringMap(boardInputs.getBoardMeta(metaHeader));
|
||||
|
|
|
@ -16,7 +16,7 @@ import static org.junit.Assert.assertEquals;
|
|||
public class PinoutLogicIntegratedTest {
|
||||
|
||||
private static final List<String> META_CONTENT = Arrays.asList("#define H144_LS_1 Gpio::G7\n",
|
||||
"#define H144_LS_2 Gpio::G8\n",
|
||||
"#define H144_LS_2 G8\n",
|
||||
"// IN_O2S AIN13 A13 PA0\n",
|
||||
"#define H144_IN_O2S EFI_ADC_0\n",
|
||||
"// IN_O2S2 AIN12 PA1\n",
|
||||
|
@ -32,8 +32,7 @@ public class PinoutLogicIntegratedTest {
|
|||
|
||||
@Test
|
||||
public void testWholeThing() throws IOException {
|
||||
runPinoutTest("meta: meta.h\n" +
|
||||
"pins:\n" +
|
||||
runPinoutTest("pins:\n" +
|
||||
" - pin: 1\n" +
|
||||
" id: [E11, E11]\n" +
|
||||
" class: [event_inputs, switch_inputs]\n" +
|
||||
|
@ -58,9 +57,10 @@ public class PinoutLogicIntegratedTest {
|
|||
|
||||
@Test
|
||||
public void testTemplate() throws IOException {
|
||||
runPinoutTest("pins:\n" +
|
||||
runPinoutTest("meta: meta.h\n" +
|
||||
"pins:\n" +
|
||||
" - pin: 2\n" +
|
||||
" id: G8\n" +
|
||||
" meta: H144_LS_2\n" +
|
||||
" class: outputs\n" +
|
||||
" function: Digital trigger/switch input for instance Hall type CAM\n" +
|
||||
" ts_name: ___ - Digital 1\n" +
|
||||
|
|
Loading…
Reference in New Issue