Convert the remaining ports to use xTaskIncrementTick() in place of vTaskIncremenTick().

pull/4/head
Richard Barry 12 years ago
parent 2fc9d033c6
commit c04b074707

@ -415,16 +415,11 @@ keyword. */
TIM2->OC1R += s_nPulseLength;
/* Increment the tick counter. */
vTaskIncrementTick();
#if configUSE_PREEMPTION == 1
if( xTaskIncrementTick() != pdFALSE )
{
/* The new tick value might unblock a task. Ensure the highest task that
is ready to execute is the task that will execute when the tick ISR
exits. */
/* Select a new task to run. */
vTaskSwitchContext();
}
#endif
/* Clear the interrupt in the watchdog. */
TIM2->SR &= ~TIM_FLAG_OC1;

@ -611,14 +611,11 @@ static void prvTickISR( void )
PIR1bits.CCP1IF = 0;
/* Maintain the tick count. */
vTaskIncrementTick();
#if configUSE_PREEMPTION == 1
if( xTaskIncrementTick() != pdFALSE )
{
/* Switch to the highest priority task that is ready to run. */
vTaskSwitchContext();
}
#endif
portRESTORE_CONTEXT();
}

@ -358,9 +358,9 @@ void __attribute__((__interrupt__, auto_psv)) _T1Interrupt( void )
/* Clear the timer interrupt. */
IFS0bits.T1IF = 0;
vTaskIncrementTick();
#if configUSE_PREEMPTION == 1
if( xTaskIncrementTick() != pdFALSE )
{
portYIELD();
#endif
}
}

@ -220,10 +220,11 @@ is being used. */
static void __interrupt __far prvPreemptiveTick( void )
{
/* Get the scheduler to update the task states following the tick. */
vTaskIncrementTick();
if( xTaskIncrementTick() != pdFALSE )
{
/* Switch in the context of the next task to be run. */
portSWITCH_CONTEXT();
}
/* Reset interrupt. */
outport( portEIO_REGISTER, portCLEAR_INTERRUPT );
@ -233,7 +234,8 @@ is being used. */
{
/* Same as preemptive tick, but the cooperative scheduler is being used
so we don't have to switch in the context of the next task. */
vTaskIncrementTick();
xTaskIncrementTick();
/* Reset interrupt. */
outport( portEIO_REGISTER, portCLEAR_INTERRUPT );
}

@ -204,10 +204,11 @@ is being used. */
static void __interrupt __far prvPreemptiveTick( void )
{
/* Get the scheduler to update the task states following the tick. */
vTaskIncrementTick();
if( xTaskIncrementTick() != pdFALSE )
{
/* Switch in the context of the next task to be run. */
portEND_SWITCHING_ISR();
}
/* Reset interrupt. */
outport( portEIO_REGISTER, portCLEAR_INTERRUPT );
@ -217,7 +218,8 @@ is being used. */
{
/* Same as preemptive tick, but the cooperative scheduler is being used
so we don't have to switch in the context of the next task. */
vTaskIncrementTick();
xTaskIncrementTick();
/* Reset interrupt. */
outport( portEIO_REGISTER, portCLEAR_INTERRUPT );
}

@ -236,7 +236,7 @@ void vPortEndScheduler( void )
{
/* Increment the tick count - this may make a delaying task ready
to run - but a context switch is not performed. */
vTaskIncrementTick();
xTaskIncrementTick();
T0IR = portTIMER_MATCH_ISR_BIT; /* Clear the timer event */
VICVectAddr = portCLEAR_VIC_INTERRUPT; /* Acknowledge the Interrupt */

@ -54,7 +54,7 @@
INCLUDE portmacro.inc
IMPORT vTaskSwitchContext
IMPORT vTaskIncrementTick
IMPORT xTaskIncrementTick
EXPORT vPortYieldProcessor
EXPORT vPortStartFirstTask
@ -127,7 +127,7 @@ vPreemptiveTick
portSAVE_CONTEXT ; Save the context of the current task.
LDR R0, =vTaskIncrementTick ; Increment the tick count.
LDR R0, =xTaskIncrementTick ; Increment the tick count.
MOV LR, PC ; This may make a delayed task ready
BX R0 ; to run.

@ -325,13 +325,6 @@ __asm void xPortPendSVHandler( void )
void xPortSysTickHandler( void )
{
#if configUSE_PREEMPTION == 1
{
/* If using preemption, also force a context switch. */
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
}
#endif
/* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to
1. If it is set to 0 tickless idle is not being used. If it is set to a
value other than 0 or 1 then a timer other than the SysTick is being used
@ -342,7 +335,11 @@ void xPortSysTickHandler( void )
( void ) portSET_INTERRUPT_MASK_FROM_ISR();
{
vTaskIncrementTick();
if( xTaskIncrementTick() != pdFALSE )
{
/* Pend a context switch. */
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
}
}
portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );
}

@ -388,13 +388,6 @@ __asm void xPortPendSVHandler( void )
void xPortSysTickHandler( void )
{
#if configUSE_PREEMPTION == 1
{
/* If using preemption, also force a context switch. */
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
}
#endif
/* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to
1. If it is set to 0 tickless idle is not being used. If it is set to a
value other than 0 or 1 then a timer other than the SysTick is being used
@ -405,7 +398,11 @@ void xPortSysTickHandler( void )
( void ) portSET_INTERRUPT_MASK_FROM_ISR();
{
vTaskIncrementTick();
if( xTaskIncrementTick() != pdFALSE )
{
/* Pend a context switch. */
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
}
}
portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );
}

@ -350,16 +350,12 @@ void prvTickISR( void )
necessitates. */
set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );
{
vTaskIncrementTick();
}
set_ipl( configKERNEL_INTERRUPT_PRIORITY );
/* Only select a new task if the preemptive scheduler is being used. */
#if( configUSE_PREEMPTION == 1 )
if( xTaskIncrementTick() != pdFALSE )
{
taskYIELD();
}
#endif
}
set_ipl( configKERNEL_INTERRUPT_PRIORITY );
#if configUSE_TICKLESS_IDLE == 1
{

@ -267,16 +267,12 @@ void vTickISR( void )
necessitates. */
set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );
{
vTaskIncrementTick();
}
set_ipl( configKERNEL_INTERRUPT_PRIORITY );
/* Only select a new task if the preemptive scheduler is being used. */
#if( configUSE_PREEMPTION == 1 )
if( xTaskIncrementTick() != pdFALSE )
{
taskYIELD();
}
#endif
}
set_ipl( configKERNEL_INTERRUPT_PRIORITY );
}
/*-----------------------------------------------------------*/

@ -268,14 +268,12 @@ void vTickISR( void )
necessitates. */
set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );
{
vTaskIncrementTick();
if( xTaskIncrementTick() != pdFALSE )
{
taskYIELD();
}
}
set_ipl( configKERNEL_INTERRUPT_PRIORITY );
/* Only select a new task if the preemptive scheduler is being used. */
#if( configUSE_PREEMPTION == 1 )
taskYIELD();
#endif
}
/*-----------------------------------------------------------*/

@ -53,7 +53,7 @@
.import _pxCurrentTCB
.import _vTaskSwitchContext
.import _vTaskIncrementTick
.import _xTaskIncrementTick
.export _vPortStartFirstTask
.export _ulPortGetGBR
@ -89,7 +89,7 @@ _vPortPreemptiveTick
portSAVE_CONTEXT
mov.l #_vTaskIncrementTick, r0
mov.l #_xTaskIncrementTick, r0
jsr @r0
nop
@ -105,7 +105,7 @@ _vPortCooperativeTick
portSAVE_CONTEXT
mov.l #_vTaskIncrementTick, r0
mov.l #_xTaskIncrementTick, r0
jsr @r0
nop

@ -89,7 +89,7 @@
_vTickISR:
portSAVE_CONTEXT
call #_vTaskIncrementTick
call #_xTaskIncrementTick
#if configUSE_PREEMPTION == 1
call #_vTaskSwitchContext

@ -405,8 +405,10 @@ void vPortYield( void ) _naked
portSAVE_CONTEXT();
portCOPY_STACK_TO_XRAM();
vTaskIncrementTick();
if( xTaskIncrementTick() != pdFALSE )
{
vTaskSwitchContext();
}
portCLEAR_INTERRUPT_FLAG();
portCOPY_XRAM_TO_STACK();
@ -418,7 +420,7 @@ void vPortYield( void ) _naked
/* When using the cooperative scheduler the timer 2 ISR is only
required to increment the RTOS tick count. */
vTaskIncrementTick();
xTaskIncrementTick();
portCLEAR_INTERRUPT_FLAG();
}
#endif

@ -292,7 +292,7 @@ const unsigned short usReloadValue = ( unsigned short ) ( ( ( configPER_CLOCK_HZ
LDI #_tmcsr0, R0
AND R1,@R0 ;Clear RLT0 interrupt flag
CALL32 _vTaskIncrementTick,R12 ;Increment Tick
CALL32 _xTaskIncrementTick,R12 ;Increment Tick
CALL32 _vTaskSwitchContext,R12 ;Switch context if required
ANDCCR #0xEF ;Disable Interrupts
@ -314,7 +314,7 @@ const unsigned short usReloadValue = ( unsigned short ) ( ( ( configPER_CLOCK_HZ
{
/* Clear RLT0 interrupt flag */
TMCSR0_UF = 0;
vTaskIncrementTick();
xTaskIncrementTick();
}
#endif

@ -474,8 +474,10 @@ void vPortEndScheduler( void )
/* Increment the tick count then switch to the highest priority task
that is ready to run. */
vTaskIncrementTick();
if( xTaskIncrementTick() != pdFALSE )
{
vTaskSwitchContext();
}
/* Disable interrupts so that portRESTORE_CONTEXT() is not interrupted */
__DI();
@ -499,7 +501,7 @@ void vPortEndScheduler( void )
/* Clear RLT0 interrupt flag */
TMCSR0_UF = 0;
vTaskIncrementTick();
xTaskIncrementTick();
}
#endif

@ -237,14 +237,13 @@ void SysTick_Handler( void )
{
unsigned long ulDummy;
/* If using preemption, also force a context switch. */
#if configUSE_PREEMPTION == 1
*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
#endif
ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
{
vTaskIncrementTick();
if( xTaskIncrementTick() != pdFALSE )
{
/* Pend a context switch. */
*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
}
}
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy );
}

@ -109,9 +109,7 @@ Changes from V3.0.1
/*
* Maintain the tick count.
*/
vTaskIncrementTick();
#if configUSE_PREEMPTION == 1
if( xTaskIncrementTick() != pdFALSE )
{
/*
* Ask for a switch to the highest priority task
@ -119,7 +117,6 @@ Changes from V3.0.1
*/
uxSwitchRequested = pdTRUE;
}
#endif
}
}

@ -197,10 +197,11 @@ kernel is being used. */
static void __interrupt __far prvPreemptiveTick( void )
{
/* Get the scheduler to update the task states following the tick. */
vTaskIncrementTick();
if( xTaskIncrementTick() != pdFALSE )
{
/* Switch in the context of the next task to be run. */
portSWITCH_CONTEXT();
}
/* Reset the PIC ready for the next time. */
portRESET_PIC();
@ -210,7 +211,7 @@ kernel is being used. */
{
/* Same as preemptive tick, but the cooperative scheduler is being used
so we don't have to switch in the context of the next task. */
vTaskIncrementTick();
xTaskIncrementTick();
portRESET_PIC();
}
#endif

@ -228,10 +228,11 @@ is being used. */
static void __interrupt __far prvPreemptiveTick( void )
{
/* Get the scheduler to update the task states following the tick. */
vTaskIncrementTick();
if( xTaskIncrementTick() != pdFALSE )
{
/* Switch in the context of the next task to be run. */
portSWITCH_CONTEXT();
}
/* Reset the PIC ready for the next time. */
prvPortResetPIC();
@ -241,7 +242,7 @@ is being used. */
{
/* Same as preemptive tick, but the cooperative scheduler is being used
so we don't have to switch in the context of the next task. */
vTaskIncrementTick();
xTaskIncrementTick();
prvPortResetPIC();
}
#endif

Loading…
Cancel
Save