summaryrefslogtreecommitdiff
path: root/Demo/CORTEX_LM3Sxxxx_IAR_Keil/timertest.c
diff options
context:
space:
mode:
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2008-04-16 08:00:30 +0000
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2008-04-16 08:00:30 +0000
commit39a369502fad44306b96f0974708ecf2a24ec0e3 (patch)
tree11617bda93a4c297065e801bca662efb0d58a7dc /Demo/CORTEX_LM3Sxxxx_IAR_Keil/timertest.c
parent84b008e6eb8caf1bd5c98ab8381c9c1cb69b91ee (diff)
downloadfreertos-39a369502fad44306b96f0974708ecf2a24ec0e3.tar.gz
freertos-39a369502fad44306b96f0974708ecf2a24ec0e3.tar.bz2
freertos-39a369502fad44306b96f0974708ecf2a24ec0e3.tar.xz
Update to V5.0.0.
git-svn-id: https://freertos.svn.sourceforge.net/svnroot/freertos/trunk@324 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
Diffstat (limited to 'Demo/CORTEX_LM3Sxxxx_IAR_Keil/timertest.c')
-rw-r--r--Demo/CORTEX_LM3Sxxxx_IAR_Keil/timertest.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/Demo/CORTEX_LM3Sxxxx_IAR_Keil/timertest.c b/Demo/CORTEX_LM3Sxxxx_IAR_Keil/timertest.c
index e4f14bd4..ff08689c 100644
--- a/Demo/CORTEX_LM3Sxxxx_IAR_Keil/timertest.c
+++ b/Demo/CORTEX_LM3Sxxxx_IAR_Keil/timertest.c
@@ -1,5 +1,5 @@
/*
- FreeRTOS.org V4.8.0 - Copyright (C) 2003-2008 Richard Barry.
+ FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry.
This file is part of the FreeRTOS.org distribution.
@@ -59,6 +59,7 @@
#include "interrupt.h"
#include "sysctl.h"
#include "lmi_timer.h"
+#include "hw_timer.h"
/* The set frequency of the interrupt. Deviations from this are measured as
the jitter. */
@@ -73,7 +74,7 @@ zero. */
/* Misc defines. */
#define timerMAX_32BIT_VALUE ( 0xffffffffUL )
-#define timerTIMER_1_COUNT_VALUE ( * ( ( unsigned long * ) ( TIMER1_BASE + 0x48 ) ) )
+#define timerTIMER_1_COUNT_VALUE ( * ( ( volatile unsigned long * ) ( ( unsigned portLONG ) TIMER1_BASE + 0x48UL ) ) )
/*-----------------------------------------------------------*/
@@ -119,14 +120,15 @@ unsigned long ulFrequency;
void Timer0IntHandler( void )
{
-unsigned portLONG ulDifference;
-volatile unsigned portLONG ulCurrentCount;
-static portLONG ulMaxDifference = 0, ulLastCount = 0;
+unsigned portLONG ulDifference, ulCurrentCount;
+static unsigned portLONG ulMaxDifference = 0, ulLastCount = 0;
/* We use the timer 1 counter value to measure the clock cycles between
the timer 0 interrupts. */
ulCurrentCount = timerTIMER_1_COUNT_VALUE;
+ TimerIntClear( TIMER0_BASE, TIMER_TIMA_TIMEOUT );
+
if( ulCurrentCount < ulLastCount )
{
/* How many times has timer 1 counted since the last interrupt? */
@@ -141,11 +143,11 @@ static portLONG ulMaxDifference = 0, ulLastCount = 0;
}
ulLastCount = ulCurrentCount;
-
- TimerIntClear( TIMER0_BASE, TIMER_TIMA_TIMEOUT );
}
+
+