From 32acd4ad0d6eac5a2c92e783f4a250f684c22460 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Wed, 7 Jan 2009 11:00:48 +0000 Subject: [PATCH] Work in progress on new port - correct the configuration of the timer interrupt. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@601 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Source/portable/IAR/AtmelSAM9XE/port.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/portable/IAR/AtmelSAM9XE/port.c b/Source/portable/IAR/AtmelSAM9XE/port.c index 0ecb0ebfc..6d09bae18 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(); } /*-----------------------------------------------------------*/ -- 2.39.2