mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 21:41:59 -04:00
Update the PIC32 port to use xTaskIncrementTick() and change the macro used to detect if XC is being used.
This commit is contained in:
parent
51d9ee0c1c
commit
2fc9d033c6
|
@ -76,7 +76,7 @@
|
||||||
* Implementation of functions defined in portable.h for the PIC32MX port.
|
* Implementation of functions defined in portable.h for the PIC32MX port.
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef __XC__
|
#ifndef __XC
|
||||||
#error This port is designed to work with XC32. Please update your C compiler version.
|
#error This port is designed to work with XC32. Please update your C compiler version.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -245,15 +245,15 @@ void vPortIncrementTick( void )
|
||||||
unsigned portBASE_TYPE uxSavedStatus;
|
unsigned portBASE_TYPE uxSavedStatus;
|
||||||
|
|
||||||
uxSavedStatus = uxPortSetInterruptMaskFromISR();
|
uxSavedStatus = uxPortSetInterruptMaskFromISR();
|
||||||
vTaskIncrementTick();
|
{
|
||||||
|
if( xTaskIncrementTick() != pdFALSE )
|
||||||
|
{
|
||||||
|
/* Pend a context switch. */
|
||||||
|
_CP0_BIS_CAUSE( portCORE_SW_0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
vPortClearInterruptMaskFromISR( uxSavedStatus );
|
vPortClearInterruptMaskFromISR( uxSavedStatus );
|
||||||
|
|
||||||
/* If we are using the preemptive scheduler then we might want to select
|
|
||||||
a different task to execute. */
|
|
||||||
#if configUSE_PREEMPTION == 1
|
|
||||||
_CP0_BIS_CAUSE( portCORE_SW_0 );
|
|
||||||
#endif /* configUSE_PREEMPTION */
|
|
||||||
|
|
||||||
/* Clear timer 1 interrupt. */
|
/* Clear timer 1 interrupt. */
|
||||||
IFS0CLR = _IFS0_T1IF_MASK;
|
IFS0CLR = _IFS0_T1IF_MASK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,9 +131,9 @@ vPortStartFirstTask:
|
||||||
|
|
||||||
vPortYieldISR:
|
vPortYieldISR:
|
||||||
|
|
||||||
/* Make room for the context. First save the current status so we can
|
/* Make room for the context. First save the current status so it can be
|
||||||
manipulate it, and the cause and EPC registers so we capture their
|
manipulated, and the cause and EPC registers so thier original values are
|
||||||
original values in case of interrupt nesting. */
|
captured. */
|
||||||
mfc0 k0, _CP0_CAUSE
|
mfc0 k0, _CP0_CAUSE
|
||||||
addiu sp, sp, -portCONTEXT_SIZE
|
addiu sp, sp, -portCONTEXT_SIZE
|
||||||
mfc0 k1, _CP0_STATUS
|
mfc0 k1, _CP0_STATUS
|
||||||
|
@ -145,7 +145,7 @@ vPortYieldISR:
|
||||||
sw s5, 40(sp)
|
sw s5, 40(sp)
|
||||||
sw k1, portSTATUS_STACK_LOCATION(sp)
|
sw k1, portSTATUS_STACK_LOCATION(sp)
|
||||||
|
|
||||||
/* Enable interrupts above the current priority. */
|
/* Interrupts above the kernel priority are going to be re-enabled. */
|
||||||
srl k0, k0, 0xa
|
srl k0, k0, 0xa
|
||||||
ins k1, k0, 10, 6
|
ins k1, k0, 10, 6
|
||||||
ins k1, zero, 1, 4
|
ins k1, zero, 1, 4
|
||||||
|
|
Loading…
Reference in a new issue