49 #define portFLOAT float 50 #define portDOUBLE double 52 #define portSHORT short 53 #define portSTACK_TYPE uint32_t 54 #define portBASE_TYPE long 60 #if( configUSE_16_BIT_TICKS == 1 ) 62 #define portMAX_DELAY ( TickType_t ) 0xffff 65 #define portMAX_DELAY ( TickType_t ) 0xffffffffUL 69 #define portTICK_TYPE_IS_ATOMIC 1 74 #define portSTACK_GROWTH ( -1 ) 75 #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) 76 #define portBYTE_ALIGNMENT 8 83 portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; \ 87 __asm volatile( "dsb" ::: "memory" ); \ 88 __asm volatile( "isb" ); \ 91 #define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) ) 92 #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) 93 #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) portYIELD() 94 #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) 100 #define portSET_INTERRUPT_MASK_FROM_ISR() ulPortRaiseBASEPRI() 101 #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortSetBASEPRI(x) 102 #define portDISABLE_INTERRUPTS() vPortRaiseBASEPRI() 103 #define portENABLE_INTERRUPTS() vPortSetBASEPRI(0) 104 #define portENTER_CRITICAL() vPortEnterCritical() 105 #define portEXIT_CRITICAL() vPortExitCritical() 112 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) 113 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) 117 #ifndef portSUPPRESS_TICKS_AND_SLEEP 119 #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) 124 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION 125 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 128 #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1 131 __attribute__( ( always_inline ) )
static inline uint8_t ucPortCountLeadingZeros( uint32_t ulBitmap )
135 __asm
volatile (
"clz %0, %1" :
"=r" ( ucReturn ) :
"r" ( ulBitmap ) :
"memory" );
140 #if( configMAX_PRIORITIES > 32 ) 141 #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. 145 #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) ) 146 #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) ) 150 #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) ucPortCountLeadingZeros( ( uxReadyPriorities ) ) ) 157 void vPortValidateInterruptPriority(
void );
158 #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority() 164 #define portINLINE __inline 166 #ifndef portFORCE_INLINE 167 #define portFORCE_INLINE inline __attribute__(( always_inline)) 172 uint32_t ulCurrentInterrupt;
176 __asm
volatile(
"mrs %0, ipsr" :
"=r"( ulCurrentInterrupt ) ::
"memory" );
178 if( ulCurrentInterrupt == 0 )
194 uint32_t ulNewBASEPRI;
200 " msr basepri, %0 \n" \
212 uint32_t ulOriginalBASEPRI, ulNewBASEPRI;
216 " mrs %0, basepri \n" \
219 " msr basepri, %1 \n" \
228 return ulOriginalBASEPRI;
236 " msr basepri, %0 " ::
"r" ( ulNewMaskValue ) :
"memory"
static portFORCE_INLINE void vPortRaiseBASEPRI(void)
static portFORCE_INLINE void vPortSetBASEPRI(uint32_t ulNewMaskValue)
void vPortExitCritical(void)
unsigned long UBaseType_t
void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
static portFORCE_INLINE uint32_t ulPortRaiseBASEPRI(void)
static portFORCE_INLINE BaseType_t xPortIsInsideInterrupt(void)
void vPortEnterCritical(void)
__attribute__((always_inline)) static inline uint8_t ucPortCountLeadingZeros(uint32_t ulBitmap)
#define configMAX_SYSCALL_INTERRUPT_PRIORITY
portSTACK_TYPE StackType_t