2022-11-29 08:05 AM
I have a project I'm taking over where it appears the last developer ignored the fact there was an IOC File. So when I added spi, the code generation had many conflicts. I have no choice now to do this all manually. When I add all the SPI init code it complains about
error: unknown type name 'SPI_HandleTypeDef'; did you mean 'TIM_HandleTypeDef'?
Guessing because there is no header included. I also have no stm32f1xx_hal_conf.h file, is this a cube thing? Should I not have that?
So what do I need to include to use SPI_HandleTypeDef'
2022-11-29 08:14 AM
Oh nevermin, I was able to copy the main file, re do the IOC, have it change code, copy back in the SPI parts. Pain in the *** but it worked.
2022-11-29 08:56 AM
Many developers don't use the code generators to keep recreating code, it was initially envisioned as a tool to create startup and pin configuration code, and morphed into this thing where functionality keeps getting added or changed and you pound on the button again..
The stm32fxx_hal_conf.h is a top level way of controlling what gets pulled in. Others just include the individual include files, or do what works for them, and as they've had to port from SPL or other libraries.
The C compiler is somewhat ambivalent to what structural form a project has, it just pulls in the files it's directed too.