You could solve this with conditional compilations like
Ifdef STM32L4
include stm32l4xx_hal.h
elif STM32F4
include stm32f4xx_hal.h
but that can be somewhat bloated if we need to do that for every file. An ideal situation would be to include only one header file and then on the backend it handles which header is used at compile time.
In current files, we only include the "stm32l4xx_hal.h" or "stm32f4xx_hal.h" not both. Meaning tests like https://github.com/lhr-solar/Embedded-Sharepoint/blob/STM32L4/HwTests/Heartbeat.c won't work on the F4 chip.
You could solve this with conditional compilations like
Ifdef STM32L4
include stm32l4xx_hal.h
elif STM32F4
include stm32f4xx_hal.h
but that can be somewhat bloated if we need to do that for every file. An ideal situation would be to include only one header file and then on the backend it handles which header is used at compile time.