13 #include "stm32/stm32f4xx_misc.h"
25 volatile uint32_t gTimeCounter = 0;
27 static void tim7_irq_handler(
void)
32 TIM_ClearITPendingBit(TIM7, TIM_IT_Update);
38 TIM_ITConfig(TIM7, TIM_IT_Update, DISABLE);
39 TIM_Cmd(TIM7, DISABLE);
44 TIM_ITConfig(TIM7, TIM_IT_Update, ENABLE);
45 TIM_Cmd(TIM7, ENABLE);
59 NVIC_InitStructure.NVIC_Handler = tim7_irq_handler;
60 NVIC_Init(&NVIC_InitStructure);
62 RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM7, ENABLE);
63 RCC_APB1PeriphClockLPModeCmd(RCC_APB1Periph_TIM7, ENABLE);
70 TIM_TimeBaseInit(TIM7, &TIM_TimeBaseStructure);
73 #if !USE_BOOT_TIME_CRITICAL
80 return now.value - before.value;
This file contains all the functions prototypes for the RCC firmware library.
void delay_wait_ms(uint32_t ms)
Wait for at least that time.
This file contains all the functions prototypes for the TIM firmware library.
libheivs configuration file
uint8_t NVIC_IRQChannelSubPriority
NVIC Init Structure definition.
static timeout_t time_get(void)
Get current time in obscure format from boot.
TIM Time Base Init structure definition.
FunctionalState NVIC_IRQChannelCmd
uint8_t NVIC_IRQChannelPreemptionPriority
uint16_t TIM_ClockDivision
timeout_t time_set_timeout_ms(uint32_t ms)
Set an obscure time at least ms milliseconds in the future.
struct system_clock_t SystemClock