mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Update port layers to make better use of the xTaskIncrementTick() return value.
This commit is contained in:
parent
c75c01ffdf
commit
62c0ae0926
9 changed files with 124 additions and 102 deletions
|
@ -56,19 +56,19 @@
|
|||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, and our new
|
||||
fully thread aware and reentrant UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems, who sell the code with commercial support,
|
||||
indemnification and middleware, under the OpenRTOS brand.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
*/
|
||||
#include "FreeRTOSConfig.h"
|
||||
|
@ -81,7 +81,7 @@
|
|||
EXPORT vTickISR
|
||||
EXPORT vPortYield
|
||||
EXPORT xPortStartScheduler
|
||||
|
||||
|
||||
RSEG CODE
|
||||
|
||||
/*
|
||||
|
@ -94,13 +94,13 @@
|
|||
*/
|
||||
vTickISR:
|
||||
portSAVE_CONTEXT
|
||||
|
||||
call #xTaskIncrementTick
|
||||
|
||||
#if configUSE_PREEMPTION == 1
|
||||
call #vTaskSwitchContext
|
||||
#endif
|
||||
|
||||
call #xTaskIncrementTick
|
||||
cmp.w #0x0, R12
|
||||
jeq SkipContextSwitch
|
||||
call #vTaskSwitchContext
|
||||
SkipContextSwitch:
|
||||
|
||||
portRESTORE_CONTEXT
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -111,16 +111,16 @@ vTickISR:
|
|||
vPortYield:
|
||||
|
||||
/* Mimic an interrupt by pushing the SR. */
|
||||
push SR
|
||||
push SR
|
||||
|
||||
/* Now the SR is stacked we can disable interrupts. */
|
||||
dint
|
||||
|
||||
dint
|
||||
|
||||
/* Save the context of the current task. */
|
||||
portSAVE_CONTEXT
|
||||
portSAVE_CONTEXT
|
||||
|
||||
/* Switch to the highest priority task that is ready to run. */
|
||||
call #vTaskSwitchContext
|
||||
call #vTaskSwitchContext
|
||||
|
||||
/* Restore the context of the new task. */
|
||||
portRESTORE_CONTEXT
|
||||
|
@ -140,14 +140,14 @@ xPortStartScheduler:
|
|||
/* Restore the context of the first task that is going to run. */
|
||||
portRESTORE_CONTEXT
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
/* Install vTickISR as the timer A0 interrupt. */
|
||||
ASEG
|
||||
ORG 0xFFE0 + TIMERA0_VECTOR
|
||||
|
||||
|
||||
_vTickISR_: DC16 vTickISR
|
||||
|
||||
|
||||
|
||||
END
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue