\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
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
\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
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