]> git.sur5r.net Git - freertos/blobdiff - Demo/CORTEX_LM3Sxxxx_IAR_Keil/timertest.c
UpdUpdate IAR projects to use Embedded Workbench V5.11.
[freertos] / Demo / CORTEX_LM3Sxxxx_IAR_Keil / timertest.c
index 1a88989d5cd5fa1ab6ee4045d3473a0fa79e8dbd..6e46bb4b7105ced95cce0734a503f774de86f518 100644 (file)
@@ -68,7 +68,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
@@ -89,6 +89,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
@@ -103,7 +106,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