2021-01-06 06:45 AM
Dear ST Hello,
Could you please help me to organize my project code for motor control?
I have several states:
The idea is to develop a small OS for my application. The application will be triggered by an interruption. The EPWM interrupt will be triggered every 80us and I have to loop all the states if needed otherwise loop in the wait state.
I have to create a different directory for any Driver in this project. Each driver has his own folder(.c .h inline) EPWM eCAp, ADC, SPI CAN CMPSS, and SCI..
Could you please suggest any way to organize the code? The idea is to have an extensible project for any other states, we are in the project foundations so we take time to have a good code format.
The variables have to be shared between drivers and states and we are looking to have a better way to share variables.
Any suggestion or link is welcomed. I am interested in any idea on this top.
Thank you in advance,
S.Tarik
2021-01-06 08:28 AM
>>The variables have to be shared between drivers and states and we are looking to have a better way to share variables.
Use structures, not globals
2021-01-06 10:29 AM
Would you please give me an example,
For example, Ish is a current variable produced in the ADC peripharal, this variable will be used in close loop state.