86 #define portFLOAT float
87 #define portDOUBLE double
89 #define portSHORT short
90 #define portSTACK_TYPE unsigned portLONG
91 #define portBASE_TYPE long
93 #if( configUSE_16_BIT_TICKS == 1 )
95 #define portMAX_DELAY ( portTickType ) 0xffff
98 #define portMAX_DELAY ( portTickType ) 0xffffffff
103 #define portSTACK_GROWTH ( -1 )
104 #define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
105 #define portBYTE_ALIGNMENT 8
111 #define portNVIC_INT_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000ed04 ) )
112 #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
113 #define portYIELD() vPortYield()
114 #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT
115 #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
123 #define portSET_INTERRUPT_MASK_FROM_ISR() ulPortSetInterruptMask()
124 #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask(x)
125 #define portDISABLE_INTERRUPTS() ulPortSetInterruptMask()
126 #define portENABLE_INTERRUPTS() vPortClearInterruptMask(0)
127 #define portENTER_CRITICAL() vPortEnterCritical()
128 #define portEXIT_CRITICAL() vPortExitCritical()
134 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
135 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
139 #ifndef portSUPPRESS_TICKS_AND_SLEEP
141 #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
146 #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
149 __attribute__( ( always_inline ) ) static inline
unsigned char ucPortCountLeadingZeros(
unsigned long ulBitmap )
151 unsigned char ucReturn;
153 __asm
volatile (
"clz %0, %1" :
"=r" ( ucReturn ) :
"r" ( ulBitmap ) );
158 #if( configMAX_PRIORITIES > 32 )
159 #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
163 #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
164 #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
168 #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )
175 void vPortValidateInterruptPriority(
void );
176 #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority()