2017-07-02 8:09 AM
Hello,
I have a temperature sensor connected to the I2C1 bus of my board. To help me with basic configuration I use STM32 Cube to generate the base of my code. I usually then go on to write my own libraires to use at later time. It is probably not the most optimal, but helps my understanding quite a bit. Somewhere close to the top of the code there is multiple (I2C,TIM,USAT)_HandleTypeDef. How to I go around using these in other files? Do I need to redefine them in all the file I write them in or simply pass them around as arguments to functions?
Thank you in advance
MT
2017-07-02 8:59 AM
Decide which ones actually need global scope, instead of GPIO or TIM initializations which occur once.
Use 'extern' in secondary use cases.