From c0029b7f78d709ca5fe388cb820bbce735e1219d Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 10 Oct 2021 21:46:26 -0400 Subject: [PATCH] refactoring --- .../hellen/hellen121nissan/board_configuration.cpp | 6 +++--- firmware/config/boards/hellen/hellen_meta.h | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp b/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp index 7fa86903c1..3912389900 100644 --- a/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp @@ -67,14 +67,14 @@ static void setupVbatt() { static void setupDefaultSensorInputs() { // trigger inputs - engineConfiguration->triggerInputPins[0] = GPIOB_1; + engineConfiguration->triggerInputPins[0] = H144_IN_CRANK; engineConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED; engineConfiguration->triggerInputPins[2] = GPIO_UNASSIGNED; // Direct hall-only cam input - engineConfiguration->camInputs[0] = GPIOA_6; + engineConfiguration->camInputs[0] = H144_IN_CAM; // todo: remove from default since 4 cylinder does not use it // todo: this requires unit test change - engineConfiguration->camInputs[1 * CAMS_PER_BANK] = GPIOA_7; + engineConfiguration->camInputs[1 * CAMS_PER_BANK] = H144_IN_D_AUX4; engineConfiguration->tps1_1AdcChannel = H144_IN_TPS; engineConfiguration->tps1_2AdcChannel = H144_IN_AUX1; diff --git a/firmware/config/boards/hellen/hellen_meta.h b/firmware/config/boards/hellen/hellen_meta.h index 452961cea4..6093029d6d 100644 --- a/firmware/config/boards/hellen/hellen_meta.h +++ b/firmware/config/boards/hellen/hellen_meta.h @@ -38,6 +38,13 @@ #define H144_OUT_IO12 GPIOA_8 #define H144_OUT_IO13 GPIOG_6 +// A24 +#define H144_IN_CRANK GPIOB_1 +// A19 +#define H144_IN_CAM GPIOA_6 +// DIN5 +#define H144_IN_VSS GPIOF_11 + // IN_CLT AIN11 PC2 #define H144_IN_CLT EFI_ADC_12 #define H144_IN_IAT EFI_ADC_13 @@ -49,6 +56,8 @@ // #define H144_IN_AUX2 EFI_ADC_14 +#define H144_IN_D_AUX4 GPIOA_7 + #define H176_LS_1 GPIOG_7 #define H176_LS_2 GPIOG_8 #define H176_LS_3 GPIOD_11