51#define portFLOAT float
52#define portDOUBLE double
54#define portSHORT short
55#define portSTACK_TYPE uint32_t
56#define portBASE_TYPE long
62#if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
64 #define portMAX_DELAY ( TickType_t ) 0xffff
65#elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
67 #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
71 #define portTICK_TYPE_IS_ATOMIC 1
73 #error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
78#define portSTACK_GROWTH ( -1 )
79#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
80#define portBYTE_ALIGNMENT 8
81#define portDONT_DISCARD __attribute__( ( used ) )
88 portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; \
92 __asm volatile ( "dsb" ::: "memory" ); \
93 __asm volatile ( "isb" ); \
96#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
97#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
98#define portEND_SWITCHING_ISR( xSwitchRequired ) \
101 if( xSwitchRequired != pdFALSE ) \
103 traceISR_EXIT_TO_SCHEDULER(); \
111#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
117#define portSET_INTERRUPT_MASK_FROM_ISR() ulPortRaiseBASEPRI()
118#define portCLEAR_INTERRUPT_MASK_FROM_ISR( x ) vPortSetBASEPRI( x )
119#define portDISABLE_INTERRUPTS() vPortRaiseBASEPRI()
120#define portENABLE_INTERRUPTS() vPortSetBASEPRI( 0 )
121#define portENTER_CRITICAL() vPortEnterCritical()
122#define portEXIT_CRITICAL() vPortExitCritical()
129#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
130#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
134#ifndef portSUPPRESS_TICKS_AND_SLEEP
136 #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
141#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
142 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
145#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
148 __attribute__( ( always_inline ) )
static inline uint8_t ucPortCountLeadingZeros( uint32_t ulBitmap )
152 __asm
volatile (
"clz %0, %1" :
"=r" ( ucReturn ) :
"r" ( ulBitmap ) :
"memory" );
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 = ( 31UL - ( uint32_t ) ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )
175 void vPortValidateInterruptPriority(
void );
176 #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority()
182#define portINLINE __inline
184#ifndef portFORCE_INLINE
185 #define portFORCE_INLINE inline __attribute__( ( always_inline ) )
190 uint32_t ulCurrentInterrupt;
194 __asm
volatile (
"mrs %0, ipsr" :
"=r" ( ulCurrentInterrupt )::
"memory" );
196 if( ulCurrentInterrupt == 0 )
212 uint32_t ulNewBASEPRI;
218 " msr basepri, %0 \n" \
230 uint32_t ulOriginalBASEPRI, ulNewBASEPRI;
234 " mrs %0, basepri \n" \
237 " msr basepri, %1 \n" \
246 return ulOriginalBASEPRI;
254 " msr basepri, %0 " ::
"r" ( ulNewMaskValue ) :
"memory"
259#define portMEMORY_BARRIER() __asm volatile ( "" ::: "memory" )
#define portFORCE_INLINE
Definition atomic.h:95
#define configMAX_SYSCALL_INTERRUPT_PRIORITY
Definition FreeRTOSConfig.h:161
static portFORCE_INLINE uint32_t ulPortRaiseBASEPRI(void)
Definition portmacro.h:227
void vPortEnterCritical(void)
Definition port.c:464
long BaseType_t
Definition portmacro.h:59
unsigned long UBaseType_t
Definition portmacro.h:60
static portFORCE_INLINE BaseType_t xPortIsInsideInterrupt(void)
Definition portmacro.h:187
uint16_t TickType_t
Definition portmacro.h:63
portSTACK_TYPE StackType_t
Definition portmacro.h:58
static portFORCE_INLINE void vPortRaiseBASEPRI(void)
Definition portmacro.h:209
#define portSTACK_TYPE
Definition portmacro.h:55
static portFORCE_INLINE void vPortSetBASEPRI(uint32_t ulNewMaskValue)
Definition portmacro.h:249
void vPortExitCritical(void)
Definition port.c:481
void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime)
#define pdFALSE
Definition projdefs.h:52
#define pdTRUE
Definition projdefs.h:53