90 #define portFLOAT float 91 #define portDOUBLE double 93 #define portSHORT short 94 #define portSTACK_TYPE uint32_t 95 #define portBASE_TYPE long 101 #if( configUSE_16_BIT_TICKS == 1 ) 103 #define portMAX_DELAY ( TickType_t ) 0xffff 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 121 #define portYIELD() \ 124 portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; \ 128 __asm volatile( "dsb" ); \ 129 __asm volatile( "isb" ); \ 132 #define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) ) 133 #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) 134 #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) portYIELD() 135 #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) 141 #define portSET_INTERRUPT_MASK_FROM_ISR() ulPortRaiseBASEPRI() 142 #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortSetBASEPRI(x) 143 #define portDISABLE_INTERRUPTS() vPortRaiseBASEPRI() 144 #define portENABLE_INTERRUPTS() vPortSetBASEPRI(0) 145 #define portENTER_CRITICAL() vPortEnterCritical() 146 #define portEXIT_CRITICAL() vPortExitCritical() 153 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) 154 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) 158 #ifndef portSUPPRESS_TICKS_AND_SLEEP 160 #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) 165 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION 166 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 169 #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1 172 __attribute__( ( always_inline ) ) static inline uint8_t ucPortCountLeadingZeros( uint32_t ulBitmap )
176 __asm
volatile (
"clz %0, %1" :
"=r" ( ucReturn ) :
"r" ( ulBitmap ) );
181 #if( configMAX_PRIORITIES > 32 ) 182 #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. 186 #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) ) 187 #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) ) 191 #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - ucPortCountLeadingZeros( ( uxReadyPriorities ) ) ) 198 void vPortValidateInterruptPriority(
void );
199 #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority() 205 #ifndef portFORCE_INLINE 206 #define portFORCE_INLINE inline __attribute__(( always_inline)) 213 uint32_t ulNewBASEPRI;
219 " msr basepri, %0 \n" \
231 uint32_t ulOriginalBASEPRI, ulNewBASEPRI;
235 " mrs %0, basepri \n" \
238 " msr basepri, %1 \n" \
247 return ulOriginalBASEPRI;
255 " msr basepri, %0 " ::
"r" ( ulNewMaskValue )
void vPortExitCritical(void)
unsigned long UBaseType_t
void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
void vPortEnterCritical(void)
#define configMAX_SYSCALL_INTERRUPT_PRIORITY
__attribute__((always_inline)) static inline uint8_t ucPortCountLeadingZeros(uint32_t ulBitmap)
portSTACK_TYPE StackType_t