From 1fdba29ff13a3864754fc41c25d3487e09f617e4 Mon Sep 17 00:00:00 2001 From: armink Date: Fri, 4 Oct 2013 22:48:57 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91p?= =?UTF-8?q?orttimer.c=E6=96=87=E4=BB=B6=E4=B8=AD=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=86=85=E5=AE=B9=EF=BC=8C=E8=A7=A3=E5=86=B3?= =?UTF-8?q?Keil=E7=BC=96=E8=AF=91=E5=87=BA=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- FreeModbus/port/porttimer_m.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FreeModbus/port/porttimer_m.c b/FreeModbus/port/porttimer_m.c index c5dc612..39c02f9 100644 --- a/FreeModbus/port/porttimer_m.c +++ b/FreeModbus/port/porttimer_m.c @@ -73,10 +73,11 @@ BOOL xMBMasterPortTimersInit(USHORT usTimeOut50us) void vMBMasterPortTimersT35Enable() { + TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; + /* Set current timer mode,don't change it.*/ vMBMasterSetCurTimerMode(MB_TMODE_T35); - TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; TIM_TimeBaseStructure.TIM_Prescaler = usPrescalerValue; TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; @@ -91,10 +92,11 @@ void vMBMasterPortTimersT35Enable() void vMBMasterPortTimersConvertDelayEnable() { + TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; + /* Set current timer mode,don't change it.*/ vMBMasterSetCurTimerMode(MB_TMODE_CONVERT_DELAY); - TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; TIM_TimeBaseStructure.TIM_Prescaler = usPrescalerValue; TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; @@ -109,10 +111,11 @@ void vMBMasterPortTimersConvertDelayEnable() void vMBMasterPortTimersRespondTimeoutEnable() { + TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; + /* Set current timer mode,don't change it.*/ vMBMasterSetCurTimerMode(MB_TMODE_RESPOND_TIMEOUT); - TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; TIM_TimeBaseStructure.TIM_Prescaler = usPrescalerValue; TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;