diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index d09e0e6a25..0c6846dfc4 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -133,9 +133,6 @@ // todo: move this outside of efifeatures.h #define BOARD_EXT_PINREPOPINS 24 -// todo: remove this, use 'BOARD_TLE8888_COUNT' -#define EFI_TLE8888 TRUE - #define EFI_ANALOG_SENSORS TRUE #ifndef EFI_MAX_31855 diff --git a/firmware/hw_layer/drivers/gpio/tle8888.c b/firmware/hw_layer/drivers/gpio/tle8888.c index 1ecc891ebd..657c76d5c1 100644 --- a/firmware/hw_layer/drivers/gpio/tle8888.c +++ b/firmware/hw_layer/drivers/gpio/tle8888.c @@ -14,7 +14,7 @@ #include "global.h" -#if EFI_TLE8888 +#if (BOARD_TLE6240_COUNT > 0) /* to be moved to smart_gpio.cpp */ #include "engine_configuration.h" @@ -597,4 +597,4 @@ void initTle8888(DECLARE_ENGINE_PARAMETER_SIGNATURE) /*********TO BE REMOVED FROM THIS FILE ENDS***********/ -#endif /* EFI_TLE8888 */ +#endif /* (BOARD_TLE6240_COUNT > 0) */ diff --git a/firmware/hw_layer/pin_repository.cpp b/firmware/hw_layer/pin_repository.cpp index 3f37582328..2b2376bde5 100644 --- a/firmware/hw_layer/pin_repository.cpp +++ b/firmware/hw_layer/pin_repository.cpp @@ -136,6 +136,7 @@ static void reportPins(void) { /* here show all pins, unused too */ if (pin_name != NULL) { + // this probably uses a lot of output buffer! scheduleMsg(&logger, "ext %s: %s", pin_name, pin_user ? pin_user : "free"); } else { diff --git a/firmware/hw_layer/smart_gpio.cpp b/firmware/hw_layer/smart_gpio.cpp index d7635c9b6b..561321b7c4 100644 --- a/firmware/hw_layer/smart_gpio.cpp +++ b/firmware/hw_layer/smart_gpio.cpp @@ -6,6 +6,8 @@ */ #include "global.h" + +#if EFI_PROD_CODE #include "smart_gpio.h" #include "efi_gpio.h" #include "engine_configuration.h" @@ -14,10 +16,9 @@ #include "drivers/gpio/mc33972.h" #include "drivers/gpio/tle8888.h" -#if EFI_PROD_CODE - EXTERN_CONFIG; +#if (BOARD_TLE6240_COUNT > 0) const struct tle6240_config tle6240 = { .spi_bus = NULL /* TODO software lookup &SPID4 */, .spi_config = { @@ -54,8 +55,9 @@ const struct tle6240_config tle6240 = { }, .reset = {.port = GPIOG, .pad = 3} }; +#endif /* (BOARD_TLE6240_COUNT > 0) */ - +#if (BOARD_MC33972_COUNT > 0) const struct mc33972_config mc33972 = { .spi_bus = NULL /* TODO software lookup &SPID4 */, .spi_config = { @@ -75,8 +77,7 @@ const struct mc33972_config mc33972 = { .cr2 = SPI_CR2_24BIT_MODE }, }; - -#endif /* EFI_PROD_CODE */ +#endif /* (BOARD_MC33972_COUNT > 0) */ void initSmartGpio() { @@ -85,7 +86,7 @@ void initSmartGpio() { tle6240_add(0, &tle6240); #else gpiochip_use_gpio_base(TLE6240_OUTPUTS); -#endif +#endif /* (BOARD_TLE6240_COUNT > 0) */ #if (BOARD_MC33972_COUNT > 0) mc33972.spi_bus = getSpiDevice(engineConfiguration->mc33972spiDevice); @@ -93,10 +94,10 @@ void initSmartGpio() { mc33972_add(0, &mc33972); #else gpiochip_use_gpio_base(MC33972_INPUTS); -#endif +#endif /* (BOARD_MC33972_COUNT > 0) */ -#if EFI_TLE8888 +#if (BOARD_TLE6240_COUNT > 0) if (engineConfiguration->tle8888_cs != GPIO_UNASSIGNED) { static OutputPin tle8888Cs; // // SPI pins are enabled in initSpiModules() @@ -105,5 +106,7 @@ void initSmartGpio() { } initTle8888(PASS_ENGINE_PARAMETER_SIGNATURE); -#endif /* EFI_TLE8888 */ +#endif /* (BOARD_TLE6240_COUNT > 0) */ } + +#endif /* EFI_PROD_CODE */ diff --git a/firmware/hw_layer/smart_gpio.h b/firmware/hw_layer/smart_gpio.h index 5877a0aec8..a77c0f767e 100644 --- a/firmware/hw_layer/smart_gpio.h +++ b/firmware/hw_layer/smart_gpio.h @@ -24,7 +24,7 @@ void initSmartGpio(void); #endif -#if EFI_TLE8888 || (BOARD_TLE6240_COUNT > 0) +#if (BOARD_TLE6240_COUNT > 0) #if defined(STM_F4_FAMILY) #define SPI_CR1_16BIT_MODE SPI_CR1_DFF @@ -44,6 +44,6 @@ void initSmartGpio(void); unexpected platform #endif -#endif /* EFI_TLE8888 */ +#endif /* (BOARD_TLE6240_COUNT > 0) */ #endif /* HW_LAYER_SMART_GPIO_H_ */ diff --git a/simulator/Makefile b/simulator/Makefile index c8d9e6c767..61daad42ed 100644 --- a/simulator/Makefile +++ b/simulator/Makefile @@ -179,6 +179,7 @@ INCDIR = . \ $(PROJECT_DIR)/config/engines \ $(PROJECT_DIR)/ext_algo \ $(PROJECT_DIR)/controllers \ + $(HW_LAYER_DRIVERS_INC) \ $(PROJECT_DIR)/hw_layer \ $(PROJECT_DIR)/hw_layer/algo \ $(HW_SENSORS_INC) \ diff --git a/simulator/simulator/efifeatures.h b/simulator/simulator/efifeatures.h index 8727fc4977..e057ff8e58 100644 --- a/simulator/simulator/efifeatures.h +++ b/simulator/simulator/efifeatures.h @@ -79,7 +79,11 @@ #define EFI_CJ125 FALSE #define EFI_CAN_SUPPORT FALSE #define EFI_MAX_31855 FALSE -#define EFI_TLE8888 FALSE + +#define BOARD_TLE6240_COUNT 0 +#define BOARD_MC33972_COUNT 0 +#define BOARD_TLE8888_COUNT 0 + #define EFI_ELECTRONIC_THROTTLE_BODY FALSE #define EFI_AUX_PID FALSE #define EFI_ICU_INPUTS FALSE