Custom initialization of peripherals
Hello,
I am working with timers in a stm32 project. In the generic INIT function that is generated using the .ioc file important functions like HAL_PWM_Init(), HAL_TIMEx_MasterConfigSynchronization() etc are understandably called outside the user code sections. Now, I want to customize the init function so that I can use variables for prescaler, period etc. For that I need to add user code and call functions like PWM_init and ConfigSync again after they are already called(?) Wouldn't that be inefficient? Alternatively, if I remove the code outside the user code section or completely remove the function itself it will reappear once I generate code after making some changes to the .ioc file. I can make custom init functions but the init functions will still remain in the code. I know I can stop using the generate code functionality but is there some way around it where I can have my cake and eat it too? Modify code outside the user code sections and it not be overwritten when I need other peripherals' code added/modified using the .ioc file?
