From fcb53a243d90ebe0af69cf65fb5184d2ee8478f7 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Sat, 18 Jun 2016 00:15:52 +0000 Subject: [PATCH] correct -1 offset in timer divisor git-svn-id: https://svn.code.sf.net/p/freetel/code@2827 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2-dev/stm32/src/stm32f4_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec2-dev/stm32/src/stm32f4_adc.c b/codec2-dev/stm32/src/stm32f4_adc.c index 00d4fed3..7ebd1140 100644 --- a/codec2-dev/stm32/src/stm32f4_adc.c +++ b/codec2-dev/stm32/src/stm32f4_adc.c @@ -98,7 +98,7 @@ static void tim2_config(int fs_divisor) /* Time base configuration */ TIM_TimeBaseStructInit(&TIM_TimeBaseStructure); - TIM_TimeBaseStructure.TIM_Period = fs_divisor; + TIM_TimeBaseStructure.TIM_Period = fs_divisor - 1; TIM_TimeBaseStructure.TIM_Prescaler = 0; TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; -- 2.25.1