From 38ea81a00c539cbd5de9b4a5efe89215260262d2 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Wed, 16 Apr 2008 16:29:28 +0000 Subject: [PATCH] Correct timer calculation. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@327 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Source/portable/GCC/STR75x/port.c | 2 +- Source/portable/IAR/STR75x/port.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/portable/GCC/STR75x/port.c b/Source/portable/GCC/STR75x/port.c index 3050a6221..2cce4c643 100644 --- a/Source/portable/GCC/STR75x/port.c +++ b/Source/portable/GCC/STR75x/port.c @@ -192,7 +192,7 @@ TB_InitTypeDef TB_InitStructure; /* Setup the TB for the generation of the tick interrupt. */ TB_InitStructure.TB_Mode = TB_Mode_Timing; TB_InitStructure.TB_CounterMode = TB_CounterMode_Down; - TB_InitStructure.TB_Prescaler = portPRESCALE; + TB_InitStructure.TB_Prescaler = portPRESCALE - 1; TB_InitStructure.TB_AutoReload = ( ( configCPU_CLOCK_HZ / ( portPRESCALE + 1 ) ) / configTICK_RATE_HZ ) + 1; TB_Init(&TB_InitStructure); diff --git a/Source/portable/IAR/STR75x/port.c b/Source/portable/IAR/STR75x/port.c index d6e3a339b..588508e01 100644 --- a/Source/portable/IAR/STR75x/port.c +++ b/Source/portable/IAR/STR75x/port.c @@ -207,7 +207,7 @@ TB_InitTypeDef TB_InitStructure; /* Setup the TB for the generation of the tick interrupt. */ TB_InitStructure.TB_Mode = TB_Mode_Timing; TB_InitStructure.TB_CounterMode = TB_CounterMode_Down; - TB_InitStructure.TB_Prescaler = portPRESCALE; + TB_InitStructure.TB_Prescaler = portPRESCALE - 1; TB_InitStructure.TB_AutoReload = ( ( configCPU_CLOCK_HZ / ( portPRESCALE + 1 ) ) / configTICK_RATE_HZ ) + 1; TB_Init(&TB_InitStructure); -- 2.39.5