90 #define portFLOAT float 91 #define portDOUBLE double 93 #define portSHORT short 94 #define portSTACK_TYPE uint32_t 95 #define portBASE_TYPE long 97 typedef portSTACK_TYPE StackType_t;
98 typedef long BaseType_t;
99 typedef unsigned long UBaseType_t;
101 #if( configUSE_16_BIT_TICKS == 1 ) 102 typedef uint16_t TickType_t;
103 #define portMAX_DELAY ( TickType_t ) 0xffff 105 typedef uint32_t TickType_t;
106 #define portMAX_DELAY ( TickType_t ) 0xffffffffUL 110 #define portTICK_TYPE_IS_ATOMIC 1 115 #define portSTACK_GROWTH ( -1 ) 116 #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) 117 #define portBYTE_ALIGNMENT 8 122 extern void vPortYield(
void );
123 #define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) ) 124 #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) 125 #define portYIELD() vPortYield() 126 #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT 127 #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) 131 extern void vPortEnterCritical(
void );
132 extern void vPortExitCritical(
void );
133 extern uint32_t ulPortSetInterruptMask(
void );
134 extern void vPortClearInterruptMask( uint32_t ulNewMaskValue );
135 #define portSET_INTERRUPT_MASK_FROM_ISR() ulPortSetInterruptMask() 136 #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask(x) 137 #define portDISABLE_INTERRUPTS() ulPortSetInterruptMask() 138 #define portENABLE_INTERRUPTS() vPortClearInterruptMask(0) 139 #define portENTER_CRITICAL() vPortEnterCritical() 140 #define portEXIT_CRITICAL() vPortExitCritical() 146 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) 147 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) 151 #ifndef portSUPPRESS_TICKS_AND_SLEEP 152 extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime );
153 #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) 158 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION 159 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 162 #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1 165 __attribute__( ( always_inline ) ) static inline uint8_t ucPortCountLeadingZeros( uint32_t ulBitmap )
169 __asm
volatile (
"clz %0, %1" :
"=r" ( ucReturn ) :
"r" ( ulBitmap ) );
174 #if( configMAX_PRIORITIES > 32 ) 175 #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. 179 #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) ) 180 #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) ) 184 #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - ucPortCountLeadingZeros( ( uxReadyPriorities ) ) ) 191 void vPortValidateInterruptPriority(
void );
192 #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority() struct emac_rx_descriptor __attribute__((packed, aligned(8))) emac_rx_descriptor_t