Skip to content

Instantly share code, notes, and snippets.

@fujin
Created June 9, 2016 04:27
Show Gist options
  • Select an option

  • Save fujin/24f27cd7e87dd44b7e44fdb9b16d90a5 to your computer and use it in GitHub Desktop.

Select an option

Save fujin/24f27cd7e87dd44b7e44fdb9b16d90a5 to your computer and use it in GitHub Desktop.
static const TIM_TimeBaseInitTypeDef tim_apb2_time_base = {
.TIM_Prescaler = (PIOS_PERIPHERAL_APB2_CLOCK / 1000000) - 1,
.TIM_ClockDivision = TIM_CKD_DIV1,
.TIM_CounterMode = TIM_CounterMode_Up,
.TIM_Period = ((1000000 / PIOS_SERVO_UPDATE_HZ) - 1),
.TIM_RepetitionCounter = 0x0000,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment