Question
How can I resolve a conflicting type error from automatically generated TouchGFX/cubeMX code?
I have built a simple gui using TouchGFX 4.18.0 for my H747I-DISCO.
I also need to use I2C to read some sensors, so I have used CubeMX 6.4.0 to enable I2C4 (and also the NVIC interrupts), and generated the code.
When I try to compile this in CubeIDE 1.8.0 (or TouchGFX), I get the following error:
C:/TouchGFXProjects/testApplication/CM7/Core/Src/main.c:86:13: error: conflicting types for 'MX_I2C4_Init'
86 | static void MX_I2C4_Init(void);
| ^~~~~~~~~~~~
In file included from ../../../CM7/Core/Inc/main.h:37,
from C:/TouchGFXProjects/testApplication/CM7/Core/Src/main.c:21:
../../../Drivers/BSP/STM32H747I-Discovery/stm32h747i_discovery_bus.h:115:19: note: previous declaration of 'MX_I2C4_Init' was here
115 | HAL_StatusTypeDef MX_I2C4_Init(I2C_HandleTypeDef *phi2c, uint32_t timing);
| ^~~~~~~~~~~~
make: *** [Application/User/Core/subdir.mk:39: Application/User/Core/main.o] Error 1Is there any way I can avoid this, aside from manually renaming one of the automatically generated functions?
