]> git.sur5r.net Git - freertos/blobdiff - Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/timertest.c
Update to V5.0.0.
[freertos] / Demo / CORTEX_LM3Sxxxx_Eclipse / RTOSDemo / timertest.c
index c17c9fe4a75164fb86a289244b9173d890bc9589..994efcdbff496a9f30656013b338646e5a9c2056 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-       FreeRTOS.org V4.8.0 - Copyright (C) 2003-2008 Richard Barry.\r
+       FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry.\r
 \r
        This file is part of the FreeRTOS.org distribution.\r
 \r
@@ -81,7 +81,7 @@ zero. */
 void Timer0IntHandler( void );\r
 \r
 /* Stores the value of the maximum recorded jitter between interrupts. */\r
-unsigned portLONG ulMaxJitter = 0;\r
+volatile unsigned portLONG ulMaxJitter = 0;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -102,6 +102,9 @@ unsigned long ulFrequency;
        /* Just used to measure time. */\r
     TimerLoadSet(TIMER1_BASE, TIMER_A, timerMAX_32BIT_VALUE );\r
        \r
+       /* Ensure interrupts do not start until the scheduler is running. */\r
+       portDISABLE_INTERRUPTS();\r
+       \r
        /* The rate at which the timer will interrupt. */\r
        ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY;    \r
     TimerLoadSet( TIMER0_BASE, TIMER_A, ulFrequency );\r
@@ -116,7 +119,8 @@ unsigned long ulFrequency;
 \r
 void Timer0IntHandler( void )\r
 {\r
-unsigned portLONG ulDifference, ulCurrentCount;\r
+unsigned portLONG ulDifference;\r
+volatile unsigned portLONG ulCurrentCount;\r
 static portLONG ulMaxDifference = 0, ulLastCount = 0;\r
 \r
        /* We use the timer 1 counter value to measure the clock cycles between\r