How to set USE_HAL_***_REGISTER_CALLBACKS from CubeMX
In order to use the HAL's register callback capability, various flags are set for each peripheral in the stm32***_hal_config.h generated by CubeMX such as USE_HAL_FDCAN_REGISTER_CALLBACKS.
The issue is that these defines don't look for a prior define first, so it's not possible to override via compiler options etc and each time the project is regenerated it replaces this file.
Is there not a way that these can be set that won't be erased upon each generation?
Many thanks