Modify the GCC/AVR port to make use of the xTaskIncrementTick return value.

Add pre-processor directives in the dsPIC and PIC24 port layers that allows both port files to be included in the same project.
This commit is contained in:
Richard Barry 2013-06-11 20:15:15 +00:00
parent 3aad6381e1
commit 2fd431e971
5 changed files with 33 additions and 20 deletions

View File

@ -104,6 +104,7 @@ extern "C" {
#define portSHORT int
#define portSTACK_TYPE unsigned portCHAR
#define portBASE_TYPE portCHAR
#define portPOINTER_SIZE_TYPE unsigned short
#if( configUSE_16_BIT_TICKS == 1 )
typedef unsigned portSHORT portTickType;

View File

@ -244,7 +244,10 @@ vPortYield:
vPortYieldFromTick:
portSAVE_CONTEXT ; Save the context of the current task.
call xTaskIncrementTick ; Call the timer tick function.
tst r16
breq SkipTaskSwitch
call vTaskSwitchContext ; Call the scheduler.
SkipTaskSwitch:
portRESTORE_CONTEXT ; Restore the context of whichever task the ...
ret ; ... scheduler decided should run.

View File

@ -157,7 +157,7 @@ unsigned portBASE_TYPE uxCriticalNesting = 0xef;
#endif /* __HAS_EDS__ */
#endif /* MPLAB_PIC24_PORT */
#if defined( __dsPIC30F__ ) || defined ( __dsPIC33E__ ) || defined( __dsPIC33F__ )
#if defined( __dsPIC30F__ ) || defined( __dsPIC33F__ )
#define portRESTORE_CONTEXT() \
asm volatile( "MOV _pxCurrentTCB, W0 \n" /* Restore the stack pointer for the task. */ \

View File

@ -72,6 +72,8 @@
mission critical applications that require provable dependability.
*/
#if defined( __PIC24E__ ) || defined ( __PIC24F__ ) || defined( __PIC24FK__ ) || defined( __PIC24H__ )
.global _vPortYield
.extern _vTaskSwitchContext
.extern uxCriticalNesting
@ -133,3 +135,5 @@ _vPortYield:
return
.end
#endif /* defined( __PIC24E__ ) || defined ( __PIC24F__ ) || defined( __PIC24FK__ ) || defined( __PIC24H__ ) */

View File

@ -72,6 +72,8 @@
mission critical applications that require provable dependability.
*/
#if defined( __dsPIC30F__ ) || defined( __dsPIC33F__ )
.global _vPortYield
.extern _vTaskSwitchContext
.extern uxCriticalNesting
@ -146,3 +148,6 @@ _vPortYield:
return
.end
#endif /* defined( __dsPIC30F__ ) || defined( __dsPIC33F__ ) */