the first task is being restored. */\r
#define portINITIAL_SR ( portIE_BIT | portEXL_BIT )\r
\r
+#ifndef configTICK_INTERRUPT_VECTOR\r
+ #define configTICK_INTERRUPT_VECTOR _TIMER_1_VECTOR\r
+#endif\r
+\r
/* Records the interrupt nesting depth. This starts at one as it will be\r
decremented to 0 when the first task starts. */\r
volatile unsigned portBASE_TYPE uxInterruptNesting = 0x01;\r
* Place the prototype here to ensure the interrupt vector is correctly installed. \r
* Note that because the interrupt is written in assembly, the IPL setting in the\r
* following line of code has no effect. The interrupt priority is set by the\r
- * call to ConfigIntTimer1() in prvSetupTimerInterrupt(). \r
+ * call to ConfigIntTimer1() in vApplicationSetupTickTimerInterrupt(). \r
*/\r
-extern void __attribute__( (interrupt(ipl1), vector(_TIMER_1_VECTOR))) vT1InterruptHandler( void );\r
+extern void __attribute__( (interrupt(ipl1), vector( configTICK_INTERRUPT_VECTOR ))) vPortTickInterruptHandler( void );\r
\r
/*\r
* The software interrupt handler that performs the yield. Note that, because\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- * Setup a timer for a regular tick.\r
+ * Setup a timer for a regular tick. This function uses peripheral timer 1.\r
+ * The function is declared weak so an application writer can use a different\r
+ * timer by redefining this implementation. If a different timer is used then\r
+ * configTICK_INTERRUPT_VECTOR must also be defined in FreeRTOSConfig.h to\r
+ * ensure the RTOS provided tick interrupt handler is installed on the correct\r
+ * vector number. When Timer 1 is used the vector number is defined as \r
+ * _TIMER_1_VECTOR.\r
*/\r
-void prvSetupTimerInterrupt( void )\r
+__attribute__(( weak )) void vApplicationSetupTickTimerInterrupt( void )\r
{\r
const unsigned long ulCompareMatch = ( (configPERIPHERAL_CLOCK_HZ / portTIMER_PRESCALE) / configTICK_RATE_HZ ) - 1;\r
\r
\r
/* Setup the timer to generate the tick. Interrupts will have been \r
disabled by the time we get here. */\r
- prvSetupTimerInterrupt();\r
+ vApplicationSetupTickTimerInterrupt();\r
\r
/* Kick off the highest priority task that has been created so far. \r
Its stack location is loaded into uxSavedTaskStackPointer. */\r
\r
.global vPortStartFirstTask\r
.global vPortYieldISR\r
- .global vT1InterruptHandler\r
+ .global vPortTickInterruptHandler\r
\r
\r
/******************************************************************/\r
\r
.set noreorder\r
.set noat\r
- .ent vT1InterruptHandler\r
+ .ent vPortTickInterruptHandler\r
\r
-vT1InterruptHandler:\r
+vPortTickInterruptHandler:\r
\r
portSAVE_CONTEXT\r
\r
\r
portRESTORE_CONTEXT\r
\r
- .end vT1InterruptHandler\r
+ .end vPortTickInterruptHandler\r
\r
/******************************************************************/\r
\r