]> git.sur5r.net Git - freertos/commitdiff
Add logic to determine the tick timer source and vector installation into the PIC32MZ...
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 18 Feb 2014 10:10:32 +0000 (10:10 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 18 Feb 2014 10:10:32 +0000 (10:10 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2215 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c
FreeRTOS/Source/portable/MPLAB/PIC32MZ/port_asm.S

index 1bf713e6b5ea5f6331cc8e8c55c76745f40677ad..57b7bb46b7b48838ff5db0308d0384b32efb9eb6 100644 (file)
@@ -159,22 +159,6 @@ task stack, not the ISR stack). */
 \r
 /*-----------------------------------------------------------*/\r
 \r
-/*\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 vApplicationSetupTickTimerInterrupt().\r
- */\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
- * the interrupt is written in assembly, the IPL setting in the following line of\r
- * code has no effect.  The interrupt priority is set by the call to\r
- * mConfigIntCoreSW0() in xPortStartScheduler().\r
- */\r
-void __attribute__( (interrupt(ipl1), vector(_CORE_SOFTWARE_0_VECTOR))) vPortYieldISR( void );\r
-\r
 /*\r
  * Used to catch tasks that attempt to return from their implementing function.\r
  */\r
index 3114cb5e260931faa1a2974c1ee94a15bff18c3f..bad1f83f16917d14e7ac553ddbdb052c173e08dd 100644 (file)
 \r
 #include <xc.h>\r
 #include <sys/asm.h>\r
+#include "FreeRTOSConfig.h"\r
 #include "ISR_Support.h"\r
 \r
 \r
-       .set    nomips16\r
-       .set    noreorder\r
-\r
-       .extern pxCurrentTCB\r
-       .extern vTaskSwitchContext\r
-       .extern vPortIncrementTick\r
+       .extern pxCurrentTCB\r
+       .extern vTaskSwitchContext\r
+       .extern vPortIncrementTick\r
        .extern xISRStackTop\r
 \r
-       .global vPortStartFirstTask\r
+       .global vPortStartFirstTask\r
        .global vPortYieldISR\r
        .global vPortTickInterruptHandler\r
 \r
 \r
 /******************************************************************/\r
 \r
-       .set            noreorder\r
-       .set            noat\r
+       .set  nomips16\r
+       .set  nomicromips\r
+       .set  noreorder\r
+       .set  noat\r
+\r
+       /***************************************************************\r
+       *  The following is needed to locate the\r
+       *  vPortTickInterruptHandler function into the correct vector\r
+       ***************************************************************/\r
+       #ifdef configTICK_INTERRUPT_VECTOR\r
+               #if (configTICK_INTERRUPT_VECTOR == _CORE_TIMER_VECTOR)\r
+                       .equ     __vector_dispatch_0, vPortTickInterruptHandler\r
+                       .global  __vector_dispatch_0\r
+                       .section .vector_0, code, keep\r
+               #elif (configTICK_INTERRUPT_VECTOR == _TIMER_1_VECTOR)\r
+                       .equ     __vector_dispatch_4, vPortTickInterruptHandler\r
+                       .global  __vector_dispatch_4\r
+                       .section .vector_4, code, keep\r
+               #elif (configTICK_INTERRUPT_VECTOR == _TIMER_2_VECTOR)\r
+                       .equ     __vector_dispatch_9, vPortTickInterruptHandler\r
+                       .global  __vector_dispatch_9\r
+                       .section .vector_9, code, keep\r
+               #elif (configTICK_INTERRUPT_VECTOR == _TIMER_3_VECTOR)\r
+                       .equ     __vector_dispatch_14, vPortTickInterruptHandler\r
+                       .global  __vector_dispatch_14\r
+                       .section .vector_14, code, keep\r
+               #elif (configTICK_INTERRUPT_VECTOR == _TIMER_4_VECTOR)\r
+                       .equ     __vector_dispatch_19, vPortTickInterruptHandler\r
+                       .global  __vector_dispatch_19\r
+                       .section .vector_19, code, keep\r
+               #elif (configTICK_INTERRUPT_VECTOR == _TIMER_5_VECTOR)\r
+                       .equ     __vector_dispatch_24, vPortTickInterruptHandler\r
+                       .global  __vector_dispatch_24\r
+                       .section .vector_24, code, keep\r
+               #elif (configTICK_INTERRUPT_VECTOR == _TIMER_6_VECTOR)\r
+                       .equ     __vector_dispatch_28, vPortTickInterruptHandler\r
+                       .global  __vector_dispatch_28\r
+                       .section .vector_28, code, keep\r
+               #elif (configTICK_INTERRUPT_VECTOR == _TIMER_7_VECTOR)\r
+                       .equ     __vector_dispatch_32, vPortTickInterruptHandler\r
+                       .global  __vector_dispatch_32\r
+                       .section .vector_32, code, keep\r
+               #elif (configTICK_INTERRUPT_VECTOR == _TIMER_8_VECTOR)\r
+                       .equ     __vector_dispatch_36, vPortTickInterruptHandler\r
+                       .global  __vector_dispatch_36\r
+                       .section .vector_36, code, keep\r
+               #elif (configTICK_INTERRUPT_VECTOR == _TIMER_9_VECTOR)\r
+                       .equ     __vector_dispatch_40, vPortTickInterruptHandler\r
+                       .global  __vector_dispatch_40\r
+                       .section .vector_40, code, keep\r
+               #endif\r
+       #else\r
+               .equ     __vector_dispatch_4, vPortTickInterruptHandler\r
+               .global  __vector_dispatch_4\r
+               .section .vector_4, code, keep\r
+       #endif\r
+\r
        .ent            vPortTickInterruptHandler\r
 \r
 vPortTickInterruptHandler:\r
@@ -102,6 +155,7 @@ vPortTickInterruptHandler:
 \r
        .set            noreorder\r
        .set            noat\r
+       .section .text, code\r
        .ent            vPortStartFirstTask\r
 \r
 vPortStartFirstTask:\r
@@ -116,10 +170,19 @@ vPortStartFirstTask:
 \r
 /*******************************************************************/\r
 \r
-       .set            noreorder\r
-       .set            noat\r
-       .ent            vPortYieldISR\r
-\r
+       .set  nomips16\r
+       .set  nomicromips\r
+       .set  noreorder\r
+       .set  noat\r
+       /***************************************************************\r
+       *  The following is needed to locate the vPortYieldISR function\r
+       *  into the correct vector\r
+       ***************************************************************/\r
+       .equ     __vector_dispatch_1, vPortYieldISR\r
+       .global  __vector_dispatch_1\r
+       .section .vector_1, code\r
+\r
+       .ent  vPortYieldISR\r
 vPortYieldISR:\r
 \r
        /* Make room for the context. First save the current status so it can be\r