Void delay_s (int x)
{
__HAL_RCC_TIM1_CLK_ENABLE ();
TIM1 - & gt; ARR=x * 10-1;
TIM1 - & gt; PSC=11999;
TIM1 - & gt; EGR=TIM_EGR_UG;
TIM1 - & gt; CR1=TIM_CR1_OPM | TIM_CR1_CEN;
While (TIM1 - & gt; CR1 & amp; TIM_CR1_CEN);
}
Bosses do I use STM32F207 microcontroller, why not use time delay function, the above is my set 1 s, f2 is 120 MZH