File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/drivers/hardware_specific/stm32 Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -716,15 +716,19 @@ void* _configure8PWM(long pwm_frequency, float dead_zone)
716
716
htim1.Init .Period = 4359 ;
717
717
htim1.Init .ClockDivision = TIM_CLOCKDIVISION_DIV1;
718
718
htim1.Init .RepetitionCounter = 1 ;
719
- HAL_TIM_PWM_Init (&htim1);
719
+ if (HAL_TIM_PWM_Init (&htim1)!= HAL_OK)
720
+ {return (STM32DriverParams*)SIMPLEFOC_DRIVER_INIT_FAILED;
721
+ }else {Serial.println (" TIM1 INIT OK!" );}
720
722
721
723
htim8.Instance = TIM8;
722
724
htim8.Init .Prescaler = 0 ;
723
725
htim8.Init .CounterMode = TIM_COUNTERMODE_CENTERALIGNED3;
724
726
htim8.Init .Period = 4359 ;
725
727
htim8.Init .ClockDivision = TIM_CLOCKDIVISION_DIV1;
726
728
htim8.Init .RepetitionCounter = 1 ;
727
- HAL_TIM_PWM_Init (&htim8);
729
+ if (HAL_TIM_PWM_Init (&htim8)!= HAL_OK)
730
+ {return (STM32DriverParams*)SIMPLEFOC_DRIVER_INIT_FAILED;
731
+ }else {Serial.println (" TIM8 INIT OK!" );}
728
732
729
733
sMasterConfig .MasterOutputTrigger = TIM_TRGO_RESET;
730
734
sMasterConfig .MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
You can’t perform that action at this time.
0 commit comments