diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index db5885cbb8..ca305b1cc4 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -222,10 +222,15 @@ #define EFI_CAN_SUPPORT TRUE #endif -#ifndef EFI_CAN_SERIAL +#if !defined(EFI_CAN_SERIAL) && EFI_CAN_SUPPORT #define EFI_CAN_SERIAL TRUE #endif +#if !defined(EFI_CAN_GPIO) && EFI_CAN_SUPPORT +// see CAN_PIN_0 +#define EFI_CAN_GPIO TRUE +#endif + #define EFI_WIDEBAND_FIRMWARE_UPDATE TRUE #ifndef EFI_AUX_SERIAL diff --git a/firmware/hw_layer/drivers/gpio/can_gpio.h b/firmware/hw_layer/drivers/gpio/can_gpio.h new file mode 100644 index 0000000000..2381a70f52 --- /dev/null +++ b/firmware/hw_layer/drivers/gpio/can_gpio.h @@ -0,0 +1,10 @@ +#pragma once + +#include "efifeatures.h" + +#if EFI_CAN_GPIO +// not number of pins but number of entities in IO module set +#define BOARD_CAN_GPIO_COUNT 1 +#else +#define BOARD_CAN_GPIO_COUNT 0 +#endif \ No newline at end of file diff --git a/firmware/hw_layer/smart_gpio.h b/firmware/hw_layer/smart_gpio.h index 19ce552b77..34ada0d399 100644 --- a/firmware/hw_layer/smart_gpio.h +++ b/firmware/hw_layer/smart_gpio.h @@ -13,6 +13,7 @@ #include "drivers/gpio/mc33972.h" #include "drivers/gpio/tle8888.h" #include "drivers/gpio/drv8860.h" +#include "drivers/gpio/can_gpio.h" // we seem OK without L9779 here do we need those includes at all? #endif /* EFI_PROD_CODE */ @@ -26,6 +27,7 @@ BOARD_TLE8888_COUNT + \ BOARD_DRV8860_COUNT + \ BOARD_MC33810_COUNT + \ BOARD_L9779_COUNT + \ +BOARD_CAN_GPIO_COUNT + \ 0) #endif