]> git.sur5r.net Git - freertos/commitdiff
Work in progress on new port - correct the configuration of the timer interrupt.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 7 Jan 2009 11:00:48 +0000 (11:00 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 7 Jan 2009 11:00:48 +0000 (11:00 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@601 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/portable/IAR/AtmelSAM9XE/port.c

index 0ecb0ebfce31b0fdb7e5a0b6c7ad34288eb64a6c..6d09bae18ab60060119779890f0873ebdf3b797e 100644 (file)
@@ -78,7 +78,7 @@
 \r
 /* Constants required to setup the PIT. */\r
 #define port1MHz_IN_Hz                                         ( 1000000ul )\r
-#define port1SECOND_IN_uS                              ( 1000000ul )\r
+#define port1SECOND_IN_uS                              ( 1000000.0 )\r
 \r
 /* Constants required to handle critical sections. */\r
 #define portNO_CRITICAL_NESTING                ( ( unsigned portLONG ) 0 )\r
@@ -210,7 +210,7 @@ volatile unsigned portLONG ulDummy;
        processor time no matter what its priority. */\r
        vTaskIncrementTick();\r
 \r
-       #if configUSE_PREEMPTION == 0\r
+       #if configUSE_PREEMPTION == 1\r
                vTaskSwitchContext();\r
        #endif  \r
                \r
@@ -226,7 +226,7 @@ volatile unsigned portLONG ulDummy;
 \r
 static void prvSetupTimerInterrupt( void )\r
 {\r
-const unsigned portLONG ulPeriodIn_uS = ( 1 / configTICK_RATE_HZ ) * port1SECOND_IN_uS;\r
+const unsigned portLONG ulPeriodIn_uS = ( 1.0 / ( double ) configTICK_RATE_HZ ) * port1SECOND_IN_uS;\r
 \r
        /* Setup the PIT for the required frequency. */\r
        PIT_Init( ulPeriodIn_uS, BOARD_MCK / port1MHz_IN_Hz );\r
@@ -236,9 +236,6 @@ const unsigned portLONG ulPeriodIn_uS = ( 1 / configTICK_RATE_HZ ) * port1SECOND
        AIC_ConfigureIT( AT91C_ID_SYS, AT91C_AIC_PRIOR_LOWEST, vPortTickISR );\r
        AIC_EnableIT( AT91C_ID_SYS );\r
        PIT_EnableIT();\r
-       \r
-       /* Enable the PIT itself. */\r
-       PIT_Enable();\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r