Conflicting types (function signature for MX_I2C4_Init()) in auto generated code. How to fix this properly?
I configured I2C4 for a H747 DISCO board.
Here's generated code in main.c:
static void MX_I2C4_Init(void);
// ...
MX_I2C4_Init();
// ...
static void MX_I2C4_Init(void)
{
// ...
}It doesn't compile because of function signature conflict with
HAL_StatusTypeDef MX_I2C4_Init(I2C_HandleTypeDef *phi2c, uint32_t timing);defined in stm32h747i_discovery_bus.h.
AFAIK in C you can't overload functions, so it's the reason it doesn't work.
My workaround for this is either changing function signature in main.c by adding "1" to the name, or - change the function in stm32h747i_discovery_bus.h by adding "1" at the end of the name.
The downside is at least in main.c the code is generated, so each time I would use code generation option my changes would be overwritten.
Is there a better way to solve this issue?
