From d09bd5559a4911d8ad4eed0fbb72bcca3c491f03 Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Fri, 7 May 2021 09:47:33 +0000 Subject: [PATCH] Refs #1261. Improved timer reset. git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@847 5dc33758-31d5-4daf-9ae8-b24bf3d40d73 --- Target/Source/ARMCM0_S32K11/timer.c | 4 +++- Target/Source/ARMCM0_XMC1/timer.c | 4 +++- Target/Source/ARMCM3_EFM32/timer.c | 4 +++- Target/Source/ARMCM3_LM3S/timer.c | 4 +++- Target/Source/ARMCM4_S32K14/timer.c | 4 +++- Target/Source/ARMCM4_TM4C/timer.c | 4 +++- Target/Source/ARMCM4_XMC4/timer.c | 4 +++- 7 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Target/Source/ARMCM0_S32K11/timer.c b/Target/Source/ARMCM0_S32K11/timer.c index 82e5b234..0a399f8c 100644 --- a/Target/Source/ARMCM0_S32K11/timer.c +++ b/Target/Source/ARMCM0_S32K11/timer.c @@ -70,8 +70,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* Set the systick's status and control register back into the default reset value. */ + /* Set the systick's registers back into the default reset value. */ S32_SysTick->CSR = 0; + S32_SysTick->RVR = 0; + S32_SysTick->CVR = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM0_XMC1/timer.c b/Target/Source/ARMCM0_XMC1/timer.c index 241cf091..fcda57d6 100644 --- a/Target/Source/ARMCM0_XMC1/timer.c +++ b/Target/Source/ARMCM0_XMC1/timer.c @@ -99,8 +99,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* set the systick's status and control register back into the default reset value */ + /* set the systick's registers back into the default reset value */ SYSTICK->CTRL = 0; + SYSTICK->LOAD = 0; + SYSTICK->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM3_EFM32/timer.c b/Target/Source/ARMCM3_EFM32/timer.c index c7f10360..2439f7c7 100644 --- a/Target/Source/ARMCM3_EFM32/timer.c +++ b/Target/Source/ARMCM3_EFM32/timer.c @@ -99,8 +99,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* set the systick's status and control register back into the default reset value */ + /* set the systick's registers back into the default reset value */ SYSTICK->CTRL = 0; + SYSTICK->LOAD = 0; + SYSTICK->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM3_LM3S/timer.c b/Target/Source/ARMCM3_LM3S/timer.c index cb6022ed..11004453 100644 --- a/Target/Source/ARMCM3_LM3S/timer.c +++ b/Target/Source/ARMCM3_LM3S/timer.c @@ -99,8 +99,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* set the systick's status and control register back into the default reset value */ + /* set the systick's registers back into the default reset value */ SYSTICK->CTRL = 0; + SYSTICK->LOAD = 0; + SYSTICK->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM4_S32K14/timer.c b/Target/Source/ARMCM4_S32K14/timer.c index a1924ee7..ca87beaf 100644 --- a/Target/Source/ARMCM4_S32K14/timer.c +++ b/Target/Source/ARMCM4_S32K14/timer.c @@ -70,8 +70,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* Set the systick's status and control register back into the default reset value. */ + /* Set the systick's registers back into the default reset value. */ S32_SysTick->CSR = 0; + S32_SysTick->RVR = 0; + S32_SysTick->CVR = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM4_TM4C/timer.c b/Target/Source/ARMCM4_TM4C/timer.c index 00c15867..c3a5444b 100644 --- a/Target/Source/ARMCM4_TM4C/timer.c +++ b/Target/Source/ARMCM4_TM4C/timer.c @@ -99,8 +99,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* set the systick's status and control register back into the default reset value */ + /* set the systick's registers back into the default reset value */ SYSTICK->CTRL = 0; + SYSTICK->LOAD = 0; + SYSTICK->VAL = 0; } /* end of TimerReset */ diff --git a/Target/Source/ARMCM4_XMC4/timer.c b/Target/Source/ARMCM4_XMC4/timer.c index 944c5777..5628473c 100644 --- a/Target/Source/ARMCM4_XMC4/timer.c +++ b/Target/Source/ARMCM4_XMC4/timer.c @@ -99,8 +99,10 @@ void TimerInit(void) ****************************************************************************************/ void TimerReset(void) { - /* set the systick's status and control register back into the default reset value */ + /* set the systick's registers back into the default reset value */ SYSTICK->CTRL = 0; + SYSTICK->LOAD = 0; + SYSTICK->VAL = 0; } /* end of TimerReset */