Unexpected type errors on repeated builds
Hi,
I’m trying to combine HAL and SPL in my project. I understand this might not be the best idea, but I just wanted to merge something generated from CubeMX (thus HAL based) with the Standard Peripheral Library, which I do prefer to do most of the stuff.
When I have realized that HAL and SPL code might use the same names for types (such as GPIO_InitTypeDef), I made my best to only include headers I really need and I have also renamed the SPL types for names that were still in conflict (->SPL_GPIO_InitTypeDef). This did not seem to work, but after restarting the Ac6 IDE, the build succeeded as I would expect. But when I tried to rebuild again, without any code change, then I got again the same list of errors, complaining that members of GPIO_InitTypeDef couldn’t be resolved. Another restart of IDE and another successful first build followed by errorneous build attempts...
Could anybody please advise how to get rid of this issue? Is there any kind of option to be enabled/disabled in the IDE that could help me? (Such as disabling some kind of indexing or another reason why Ac6/Eclipse suddenly sees conflicting type definitions?).
Also, as a side question: why does STM use the same names for types/macros/etc. in both HAL and SPL? This kind of issues could be easily avoided by prefixing the names with HAL_/SPL_...
Thank you in advance for your help
Jindrich