summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2009-01-07 11:00:48 +0000
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2009-01-07 11:00:48 +0000
commit808f4c304a723c3aad8b8784296caec6aebea00c (patch)
treeef3117f59928ed929e9a6ad145c365710dbb1b4c /Source
parentd837145dace6b86847e2d3fc9f33cfceb6a0e5df (diff)
downloadfreertos-808f4c304a723c3aad8b8784296caec6aebea00c.tar.gz
freertos-808f4c304a723c3aad8b8784296caec6aebea00c.tar.bz2
freertos-808f4c304a723c3aad8b8784296caec6aebea00c.tar.xz
Work in progress on new port - correct the configuration of the timer interrupt.
git-svn-id: https://freertos.svn.sourceforge.net/svnroot/freertos/trunk@601 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
Diffstat (limited to 'Source')
-rw-r--r--Source/portable/IAR/AtmelSAM9XE/port.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/portable/IAR/AtmelSAM9XE/port.c b/Source/portable/IAR/AtmelSAM9XE/port.c
index 0ecb0ebf..6d09bae1 100644
--- a/Source/portable/IAR/AtmelSAM9XE/port.c
+++ b/Source/portable/IAR/AtmelSAM9XE/port.c
@@ -78,7 +78,7 @@
/* Constants required to setup the PIT. */
#define port1MHz_IN_Hz ( 1000000ul )
-#define port1SECOND_IN_uS ( 1000000ul )
+#define port1SECOND_IN_uS ( 1000000.0 )
/* Constants required to handle critical sections. */
#define portNO_CRITICAL_NESTING ( ( unsigned portLONG ) 0 )
@@ -210,7 +210,7 @@ volatile unsigned portLONG ulDummy;
processor time no matter what its priority. */
vTaskIncrementTick();
- #if configUSE_PREEMPTION == 0
+ #if configUSE_PREEMPTION == 1
vTaskSwitchContext();
#endif
@@ -226,7 +226,7 @@ volatile unsigned portLONG ulDummy;
static void prvSetupTimerInterrupt( void )
{
-const unsigned portLONG ulPeriodIn_uS = ( 1 / configTICK_RATE_HZ ) * port1SECOND_IN_uS;
+const unsigned portLONG ulPeriodIn_uS = ( 1.0 / ( double ) configTICK_RATE_HZ ) * port1SECOND_IN_uS;
/* Setup the PIT for the required frequency. */
PIT_Init( ulPeriodIn_uS, BOARD_MCK / port1MHz_IN_Hz );
@@ -236,9 +236,6 @@ const unsigned portLONG ulPeriodIn_uS = ( 1 / configTICK_RATE_HZ ) * port1SECOND
AIC_ConfigureIT( AT91C_ID_SYS, AT91C_AIC_PRIOR_LOWEST, vPortTickISR );
AIC_EnableIT( AT91C_ID_SYS );
PIT_EnableIT();
-
- /* Enable the PIT itself. */
- PIT_Enable();
}
/*-----------------------------------------------------------*/