kotyamba (kotyamba) wrote, 2017-10-14 13:31:00 kotyamba kotyamba 2017-10-14 13:31:00 Previous Share Flag STM32, Hal & delay_us TIM2 в режиме OnePulse "тикает" раз в мксvoid delay_us(uint32_t value){// #include "stm32f1xx_ll_tim.h" !!! LL_TIM_SetAutoReload(htim2.Instance, value - 1); LL_TIM_SetCounter(htim2.Instance,0); HAL_TIM_Base_Start(&htim2); while(LL_TIM_IsActiveFlag_UPDATE(htim2.Instance) == 0); LL_TIM_ClearFlag_UPDATE(htim2.Instance);} Tags: #include Subscribe Post a new comment Error Comments allowed for friends only Anonymous comments are disabled in this journal We will log you in after post We will log you in after post We will log you in after post We will log you in after post We will log you in after post Anonymously switch LiveJournal Facebook Twitter OpenId Google MailRu VKontakte Anonymously default userpic Your reply will be screened Your IP address will be recorded Post a new comment Preview comment Help 0 comments Post a new comment 0 comments
TIM2 в режиме OnePulse "тикает" раз в мксvoid delay_us(uint32_t value){// #include "stm32f1xx_ll_tim.h" !!! LL_TIM_SetAutoReload(htim2.Instance, value - 1); LL_TIM_SetCounter(htim2.Instance,0); HAL_TIM_Base_Start(&htim2); while(LL_TIM_IsActiveFlag_UPDATE(htim2.Instance) == 0); LL_TIM_ClearFlag_UPDATE(htim2.Instance);}