From 66570a0f284e5b0876acf310ab39675d22c8a28c Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 6 Apr 2020 14:28:08 -0400 Subject: [PATCH] smart gpio clean-up --- firmware/config/boards/kinetis/efifeatures.h | 3 --- firmware/config/boards/skeleton/efifeatures.h | 4 ---- firmware/config/boards/subaru-ej20gn/efifeatures.h | 4 ---- firmware/config/stm32f4ems/efifeatures.h | 4 ---- firmware/hw_layer/pin_repository.cpp | 4 ---- firmware/hw_layer/smart_gpio.h | 2 ++ 6 files changed, 2 insertions(+), 19 deletions(-) diff --git a/firmware/config/boards/kinetis/efifeatures.h b/firmware/config/boards/kinetis/efifeatures.h index be1a0353a4..976a34a176 100644 --- a/firmware/config/boards/kinetis/efifeatures.h +++ b/firmware/config/boards/kinetis/efifeatures.h @@ -347,9 +347,6 @@ #define BOARD_MC33972_COUNT 0 #define BOARD_TLE8888_COUNT 0 -// todo: move this outside of efifeatures.h -#define BOARD_EXT_PINREPOPINS 24 - #define TLE6240_SS_PORT GPIOB #define TLE6240_SS_PAD 0U #define TLE6240_RESET_PORT NULL diff --git a/firmware/config/boards/skeleton/efifeatures.h b/firmware/config/boards/skeleton/efifeatures.h index 4983ecdc9e..1be102a999 100644 --- a/firmware/config/boards/skeleton/efifeatures.h +++ b/firmware/config/boards/skeleton/efifeatures.h @@ -86,10 +86,6 @@ #define BOARD_MC33972_COUNT 0 #define BOARD_TLE8888_COUNT 0 -// Future: move these outside of efifeatures.h -#define BOARD_EXT_PINREPOPINS 24 - - /** * if you have a 60-2 trigger, or if you just want better performance, you * probably want EFI_ENABLE_ASSERTS to be FALSE. Also you would probably want to FALSE diff --git a/firmware/config/boards/subaru-ej20gn/efifeatures.h b/firmware/config/boards/subaru-ej20gn/efifeatures.h index fad647cd57..5a9ebc6ef2 100644 --- a/firmware/config/boards/subaru-ej20gn/efifeatures.h +++ b/firmware/config/boards/subaru-ej20gn/efifeatures.h @@ -24,10 +24,6 @@ /* do not use serial device for console */ #undef TS_SERIAL_DEVICE -/* additional space for pins on gpioext */ -#undef BOARD_EXT_PINREPOPINS -#define BOARD_EXT_PINREPOPINS (16 + 22) - #undef EFI_RTC #define EFI_RTC FALSE diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index 59689fc7d6..8d4328bfe1 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -146,10 +146,6 @@ #define BOARD_TLE8888_COUNT 1 #endif - -// todo: move this outside of efifeatures.h -#define BOARD_EXT_PINREPOPINS 24 - #define EFI_ANALOG_SENSORS TRUE #ifndef EFI_MAX_31855 diff --git a/firmware/hw_layer/pin_repository.cpp b/firmware/hw_layer/pin_repository.cpp index 0b9a3141c4..bf02f15e81 100644 --- a/firmware/hw_layer/pin_repository.cpp +++ b/firmware/hw_layer/pin_repository.cpp @@ -18,10 +18,6 @@ #include "drivers/gpio/gpio_ext.h" #include "smart_gpio.h" -#ifndef BOARD_EXT_PINREPOPINS - #define BOARD_EXT_PINREPOPINS 0 -#endif - static bool initialized = false; static LoggingWithStorage logger("pin repos"); diff --git a/firmware/hw_layer/smart_gpio.h b/firmware/hw_layer/smart_gpio.h index 12fa1fc6e6..024c6738a9 100644 --- a/firmware/hw_layer/smart_gpio.h +++ b/firmware/hw_layer/smart_gpio.h @@ -12,8 +12,10 @@ #include "drivers/gpio/tle6240.h" #include "drivers/gpio/mc33972.h" #include "drivers/gpio/tle8888.h" + #define BOARD_EXT_PINREPOPINS (BOARD_TLE6240_COUNT * TLE6240_OUTPUTS + BOARD_MC33972_COUNT * MC33972_INPUTS + BOARD_TLE8888_COUNT * TLE8888_OUTPUTS) #else /* EFI_PROD_CODE */ + #define BOARD_EXT_PINREPOPINS 0 #endif /* EFI_PROD_CODE */ #if EFI_UNIT_TEST