Andrey 2021-06-29 01:00:32 -04:00
parent 4eb2da685e
commit 75cffa26d3
4 changed files with 146 additions and 31 deletions

View File

@ -6,15 +6,11 @@ BOARDINC = $(BOARDS_DIR)/hellen/hellen121nissan
# Set this if you want a default engine type other than normal hellen121nissan # Set this if you want a default engine type other than normal hellen121nissan
ifeq ($(DEFAULT_ENGINE_TYPE),) ifeq ($(DEFAULT_ENGINE_TYPE),)
DEFAULT_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_NB2 DEFAULT_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_121_NISSAN
endif endif
ifeq ($(LED_CRITICAL_ERROR_BRAIN_PIN),) ifeq ($(LED_CRITICAL_ERROR_BRAIN_PIN),)
LED_CRITICAL_ERROR_BRAIN_PIN = -DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOH_8 LED_CRITICAL_ERROR_BRAIN_PIN = -DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOG_0
endif
ifeq ($(LED_COMMUNICATION_BRAIN_PIN),)
LED_COMMUNICATION_BRAIN_PIN = -DEFI_COMMUNICATION_PIN=GPIOH_10
endif endif
DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE

View File

@ -28,14 +28,12 @@ static void setInjectorPins() {
engineConfiguration->injectionPins[1] = GPIOG_8; engineConfiguration->injectionPins[1] = GPIOG_8;
engineConfiguration->injectionPins[2] = GPIOD_11; engineConfiguration->injectionPins[2] = GPIOD_11;
engineConfiguration->injectionPins[3] = GPIOD_10; engineConfiguration->injectionPins[3] = GPIOD_10;
engineConfiguration->injectionPins[4] = GPIOD_9;
engineConfiguration->injectionPins[5] = GPIOF_12;
//engineConfiguration->injectionPins[4] = GPIOD_9;
//engineConfiguration->injectionPins[5] = GPIOF_12;
//engineConfiguration->injectionPins[6] = GPIOF_13;
//engineConfiguration->injectionPins[7] = GPIOF_14;
// Disable remainder // Disable remainder
for (int i = 4; i < INJECTION_PIN_COUNT;i++) { for (int i = 6; i < INJECTION_PIN_COUNT;i++) {
engineConfiguration->injectionPins[i] = GPIO_UNASSIGNED; engineConfiguration->injectionPins[i] = GPIO_UNASSIGNED;
} }
@ -43,18 +41,15 @@ static void setInjectorPins() {
} }
static void setIgnitionPins() { static void setIgnitionPins() {
engineConfiguration->ignitionPins[0] = GPIOI_8; // 3F - IGN_1 (1&4) engineConfiguration->ignitionPins[0] = GPIOC_13;
engineConfiguration->ignitionPins[1] = GPIO_UNASSIGNED ; // GPIOE_4 engineConfiguration->ignitionPins[1] = GPIOE_5;
engineConfiguration->ignitionPins[2] = GPIOE_5; // 3I - IGN_2 (2&3) engineConfiguration->ignitionPins[2] = GPIOE_4;
engineConfiguration->ignitionPins[3] = GPIO_UNASSIGNED; // GPIOE_3 engineConfiguration->ignitionPins[3] = GPIOE_3;
engineConfiguration->ignitionPins[4] = GPIOE_2;
//engineConfiguration->ignitionPins[4] = GPIOE_2; engineConfiguration->ignitionPins[5] = GPIOB_8;
//engineConfiguration->ignitionPins[5] = GPIOI_5;
//engineConfiguration->ignitionPins[6] = GPIOI_6;
//engineConfiguration->ignitionPins[7] = GPIOI_7;
// disable remainder // disable remainder
for (int i = 4; i < IGNITION_PIN_COUNT; i++) { for (int i = 6; i < IGNITION_PIN_COUNT; i++) {
engineConfiguration->ignitionPins[i] = GPIO_UNASSIGNED; engineConfiguration->ignitionPins[i] = GPIO_UNASSIGNED;
} }
@ -65,10 +60,10 @@ static void setLedPins() {
#ifdef EFI_COMMUNICATION_PIN #ifdef EFI_COMMUNICATION_PIN
engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN; engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN;
#else #else
engineConfiguration->communicationLedPin = GPIOH_10; engineConfiguration->communicationLedPin = GPIOE_7;
#endif /* EFI_COMMUNICATION_PIN */ #endif /* EFI_COMMUNICATION_PIN */
engineConfiguration->runningLedPin = GPIOH_9; // green engineConfiguration->runningLedPin = GPIOG_1; // green
engineConfiguration->warningLedPin = GPIOH_11; // yellow engineConfiguration->warningLedPin = GPIOE_8; // yellow
} }
static void setupVbatt() { static void setupVbatt() {
@ -152,10 +147,10 @@ void setBoardDefaultConfiguration(void) {
engineConfiguration->canTxPin = GPIOD_1; engineConfiguration->canTxPin = GPIOD_1;
engineConfiguration->canRxPin = GPIOD_0; engineConfiguration->canRxPin = GPIOD_0;
engineConfiguration->fuelPumpPin = GPIOG_2; // OUT_IO9 // engineConfiguration->fuelPumpPin = GPIOG_2; // OUT_IO9
engineConfiguration->idle.solenoidPin = GPIOD_14; // OUT_PWM5 // engineConfiguration->idle.solenoidPin = GPIOD_14; // OUT_PWM5
engineConfiguration->fanPin = GPIOD_12; // OUT_PWM8 // engineConfiguration->fanPin = GPIOD_12; // OUT_PWM8
engineConfiguration->mainRelayPin = GPIOI_2; // OUT_LOW3 // engineConfiguration->mainRelayPin = GPIOI_2; // OUT_LOW3
// "required" hardware is done - set some reasonable defaults // "required" hardware is done - set some reasonable defaults
setupDefaultSensorInputs(); setupDefaultSensorInputs();
@ -166,8 +161,8 @@ void setBoardDefaultConfiguration(void) {
engineConfiguration->useOnlyRisingEdgeForTrigger = true; engineConfiguration->useOnlyRisingEdgeForTrigger = true;
setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX); setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX);
engineConfiguration->specs.cylindersCount = 4; engineConfiguration->specs.cylindersCount = 6;
engineConfiguration->specs.firingOrder = FO_1_3_4_2; engineConfiguration->specs.firingOrder = FO_1_2_3_4_5_6;
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;

View File

@ -13,20 +13,138 @@ pins:
ts_name: ETB_OUT- ts_name: ETB_OUT-
function: -ETB_OUT function: -ETB_OUT
- pin: 21a
id: GPIOD_9
class: outputs
ts_name: 21 - INJ_5
function: Injector 5
type: inj
- pin: 22a
id: GPIOD_11
class: outputs
ts_name: 22 - INJ_3
function: Injector 3
type: inj
- pin: 23a
id: GPIOG_7
class: outputs
ts_name: 23 - INJ_1
function: Injector 1
type: inj
- pin: 40a
id: GPIOF_12
class: outputs
ts_name: 40 - INJ_6
function: Injector 6
type: inj
- pin: 41a
id: GPIOD_10
class: outputs
ts_name: 41 - INJ_4
function: Injector 4
type: inj
- pin: 42a
id: GPIOG_8
class: outputs
ts_name: 42 - INJ_2
function: Injector 2
type: inj
- pin: 47a
function: +5v
- pin: 48a
function: +5v
- pin: 50a
# id: EFI_ADC_4
class: analog_inputs
ts_name: 50 - TPS 1
function: TPS 1 sensor input
- pin: 60a
id: GPIOE_2
class: outputs
ts_name: 60 - Coil 5
function: Coil 5
type: ign
- pin: 61a
id: GPIOE_4
class: outputs
ts_name: 61 - Coil 3
function: Coil 3
type: ign
- pin: 62a
id: GPIOC_13
class: outputs
ts_name: 62 - Coil 1
function: Coil 1
type: ign
- pin: 66a - pin: 66a
function: GNDA function: GNDA
- pin: 67a - pin: 67a
function: GNDA function: GNDA
- pin: 69a
# id: EFI_ADC_4
class: analog_inputs
ts_name: 69 - TPS 2
function: TPS 2 sensor input
- pin: 78a - pin: 78a
function: GNDA function: GNDA
- pin: 79a
id: GPIOB_8
class: outputs
ts_name: 79 - Coil 6
function: Coil 6
type: ign
- pin: 80a
id: GPIOE_3
class: outputs
ts_name: 80 - Coil 4
function: Coil 4
type: ign
- pin: 81a
id: GPIOE_5
class: outputs
ts_name: 81 - Coil 2
function: Coil 2
type: ign
- pin: 82a
function: GNDA
- pin: 83a
function: GNDA
- pin: 86a - pin: 86a
function: CAN bus low function: CAN bus low
type: can type: can
- pin: 90a
function: +5v
- pin: 91a
function: +5v
- pin: 94a - pin: 94a
function: CAN bus high function: CAN bus high
type: can type: can
@ -52,6 +170,12 @@ pins:
function: GND function: GND
type: GND type: GND
- pin: 119a
function: +12v from main relay
- pin: 120a
function: +12v from main relay
- pin: 121a - pin: 121a
function: Bat+ (Hot all times), 12v 20A fuse from battery function: Bat+ (Hot all times), 12v 20A fuse from battery

View File

@ -33,7 +33,7 @@ typedef enum {
// 6 cylinder // 6 cylinder
FO_1_5_3_6_2_4 = 4, FO_1_5_3_6_2_4 = 4,
FO_1_4_2_5_3_6 = 7, FO_1_4_2_5_3_6 = 7,
FO_1_2_3_4_5_6 = 9, FO_1_2_3_4_5_6 = 9, // all Nissan v6
FO_1_6_3_2_5_4 = 13, // EG33 FO_1_6_3_2_5_4 = 13, // EG33
// todo: one day we shall support 7 cylinder radial, probably not before one actually approaches us // todo: one day we shall support 7 cylinder radial, probably not before one actually approaches us