changed the code for the PWM signals

This commit is contained in:
hamza
2024-06-06 16:46:57 +03:00
parent 8983097b87
commit 5ed35b605b
6 changed files with 33 additions and 34 deletions

View File

@ -12,15 +12,15 @@ TIM_HandleTypeDef* powerground, *battery_cooling;
the value of the TIMx_ARR register and a duty cycle determined by the value of the TIMx_CCRx register.
*/
void PWM_control_init(TIM_HandleTypeDef* pg1, TIM_HandleTypeDef* pg2, TIM_HandleTypeDef* bat_cool){
void PWM_control_init(TIM_HandleTypeDef* pg, TIM_HandleTypeDef* bat_cool){
powerground_status = 0;
battery_cooling_status = 0;
HAL_TIM_PWM_Start(pg1, TIM_CHANNEL_1); //TIM15CH1
HAL_TIM_PWM_Start(pg2, TIM_CHANNEL_2); //TIM15CH2
HAL_TIM_PWM_Start(pg, TIM_CHANNEL_1); //TIM15CH1
HAL_TIM_PWM_Start(pg, TIM_CHANNEL_2); //TIM15CH2
HAL_TIM_PWM_Start(bat_cool, TIM_CHANNEL_3); //TIM1CH3
powerground = pg1;
powerground = pg;
battery_cooling = bat_cool;
__HAL_TIM_SET_COMPARE(powerground, TIM_CHANNEL_1, 2000);
__HAL_TIM_SET_COMPARE(powerground, TIM_CHANNEL_2, 2000);