2 * FreeRTOS Kernel <DEVELOPMENT BRANCH>
3 * license and copyright intentionally withheld to promote copying into user code.
9 /*-----------------------------------------------------------
10 * Port specific definitions.
12 * The settings in this file configure FreeRTOS correctly for the
13 * given hardware and compiler.
15 * These settings should not be altered.
16 *-----------------------------------------------------------
19 /* Type definitions. */
21 #define portFLOAT float
22 #define portDOUBLE double
25 #define portSTACK_TYPE uint8_t
26 #define portBASE_TYPE char
28 #define portSTACK_GROWTH ( -1 )
29 #define portBYTE_ALIGNMENT 4
30 #define portPOINTER_SIZE_TYPE size_t
31 typedef portSTACK_TYPE StackType_t;
32 typedef signed char BaseType_t;
33 typedef unsigned char UBaseType_t;
35 #if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
36 typedef uint16_t TickType_t;
37 #define portMAX_DELAY ( TickType_t ) 0xffff
38 #elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
39 typedef uint32_t TickType_t;
40 #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
42 #error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
45 /* Architecture specific optimisations. */
46 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
47 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
50 #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
52 /* Check the configuration. */
53 #if ( configMAX_PRIORITIES > 32 )
54 #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.
57 /* Store/clear the ready priorities in a bit map. */
58 #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
59 #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
61 /*-----------------------------------------------------------*/
63 #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) \
69 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
71 #define portDISABLE_INTERRUPTS() \
72 { /* Disable the interrupts */ \
74 #define portENABLE_INTERRUPTS() \
75 { /* Enable the interrupts */ \
78 #define portENTER_CRITICAL() \
79 { /* preserve current interrupt state and then disable interrupts */ \
81 #define portEXIT_CRITICAL() \
82 { /* restore previously preserved interrupt state */ \
85 extern void vPortYield( void );
86 #define portYIELD() vPortYield()
88 /* Task function macros as described on the FreeRTOS.org WEB site. */
89 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
90 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
92 #endif /* PORTMACRO_H */