]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_MPU_LPC54018_MCUXpresso/NXP_Code/utilities/freertos_tasks_c_additions.h
Add MPU demo project for LPC54018 board.
[freertos] / FreeRTOS / Demo / CORTEX_MPU_LPC54018_MCUXpresso / NXP_Code / utilities / freertos_tasks_c_additions.h
1 /*\r
2  * Copyright 2017-2019 NXP\r
3  * All rights reserved.\r
4  *\r
5  *\r
6  * SPDX-License-Identifier: BSD-3-Clause\r
7  */\r
8 \r
9 /* freertos_tasks_c_additions.h Rev. 1.3 */\r
10 #ifndef FREERTOS_TASKS_C_ADDITIONS_H\r
11 #define FREERTOS_TASKS_C_ADDITIONS_H\r
12 \r
13 #include <stdint.h>\r
14 \r
15 #if (configUSE_TRACE_FACILITY == 0)\r
16 #error "configUSE_TRACE_FACILITY must be enabled"\r
17 #endif\r
18 \r
19 #define FREERTOS_DEBUG_CONFIG_MAJOR_VERSION 1\r
20 #define FREERTOS_DEBUG_CONFIG_MINOR_VERSION 3\r
21 \r
22 /* NOTE!!\r
23  * Default to a FreeRTOS version which didn't include these macros. FreeRTOS\r
24  * v7.5.3 is used here.\r
25  */\r
26 #ifndef tskKERNEL_VERSION_BUILD\r
27 #define tskKERNEL_VERSION_BUILD 3\r
28 #endif\r
29 #ifndef tskKERNEL_VERSION_MINOR\r
30 #define tskKERNEL_VERSION_MINOR 5\r
31 #endif\r
32 #ifndef tskKERNEL_VERSION_MAJOR\r
33 #define tskKERNEL_VERSION_MAJOR 7\r
34 #endif\r
35 \r
36 /* NOTE!!\r
37  * The configFRTOS_MEMORY_SCHEME macro describes the heap scheme using a value\r
38  * 1 - 5 which corresponds to the following schemes:\r
39  *\r
40  * heap_1 - the very simplest, does not permit memory to be freed\r
41  * heap_2 - permits memory to be freed, but not does coalescence adjacent free\r
42  *          blocks.\r
43  * heap_3 - simply wraps the standard malloc() and free() for thread safety\r
44  * heap_4 - coalesces adjacent free blocks to avoid fragmentation. Includes\r
45  *          absolute address placement option\r
46  * heap_5 - as per heap_4, with the ability to span the heap across\r
47  *          multiple nonOadjacent memory areas\r
48  */\r
49 #ifndef configFRTOS_MEMORY_SCHEME\r
50 #define configFRTOS_MEMORY_SCHEME 3 /* thread safe malloc */\r
51 #endif\r
52 \r
53 #if ((configFRTOS_MEMORY_SCHEME > 5) || (configFRTOS_MEMORY_SCHEME < 1))\r
54 #error "Invalid configFRTOS_MEMORY_SCHEME setting!"\r
55 #endif\r
56 \r
57 #ifdef __cplusplus\r
58 extern "C" {\r
59 #endif\r
60 \r
61 extern const uint8_t FreeRTOSDebugConfig[];\r
62 \r
63 /* NOTES!!\r
64  * IAR documentation is confusing. It suggests the data must be statically\r
65  * linked, and the #pragma placed immediately before the symbol definition.\r
66  * The IAR supplied examples violate both "rules", so this is a best guess.\r
67  */\r
68 \r
69 #if (tskKERNEL_VERSION_MAJOR >= 10) && (tskKERNEL_VERSION_MINOR >= 2)\r
70 #if defined(__GNUC__)\r
71 char *const portArch_Name __attribute__((section(".rodata"))) = portARCH_NAME;\r
72 #elif defined(__CC_ARM) || defined(__ARMCC_VERSION)\r
73 char *const portArch_Name __attribute__((used)) = portARCH_NAME;\r
74 #elif defined(__IAR_SYSTEMS_ICC__)\r
75 char *const portArch_Name = portARCH_NAME;\r
76 #pragma required=portArch_Name\r
77 #endif\r
78 #else\r
79 char *const portArch_Name = NULL;\r
80 #endif  // tskKERNEL_VERSION_MAJOR\r
81 \r
82 #if defined(__GNUC__)\r
83 const uint8_t FreeRTOSDebugConfig[] __attribute__((section(".rodata"))) =\r
84 #elif defined(__CC_ARM) || defined(__ARMCC_VERSION)\r
85 const uint8_t FreeRTOSDebugConfig[] __attribute__((used)) =\r
86 #elif defined(__IAR_SYSTEMS_ICC__)\r
87 #pragma required=FreeRTOSDebugConfig\r
88 const uint8_t FreeRTOSDebugConfig[] =\r
89 #endif\r
90 {\r
91     FREERTOS_DEBUG_CONFIG_MAJOR_VERSION,\r
92     FREERTOS_DEBUG_CONFIG_MINOR_VERSION,\r
93     tskKERNEL_VERSION_MAJOR,\r
94     tskKERNEL_VERSION_MINOR,\r
95     tskKERNEL_VERSION_BUILD,\r
96     configFRTOS_MEMORY_SCHEME,\r
97     offsetof(struct tskTaskControlBlock, pxTopOfStack),\r
98 #if (tskKERNEL_VERSION_MAJOR > 8)\r
99     offsetof(struct tskTaskControlBlock, xStateListItem),\r
100 #else\r
101     offsetof(struct tskTaskControlBlock, xGenericListItem),\r
102 #endif\r
103     offsetof(struct tskTaskControlBlock, xEventListItem),\r
104     offsetof(struct tskTaskControlBlock, pxStack),\r
105     offsetof(struct tskTaskControlBlock, pcTaskName),\r
106     offsetof(struct tskTaskControlBlock, uxTCBNumber),\r
107     offsetof(struct tskTaskControlBlock, uxTaskNumber),\r
108     configMAX_TASK_NAME_LEN,\r
109     configMAX_PRIORITIES,\r
110     configENABLE_MPU,\r
111     configENABLE_FPU,\r
112     configENABLE_TRUSTZONE,\r
113         configRUN_FREERTOS_SECURE_ONLY,\r
114         0,                      // 32-bit align\r
115         0, 0, 0, 0      // padding\r
116 };\r
117 \r
118 #ifdef __cplusplus\r
119 }\r
120 #endif\r
121 \r
122 #endif // FREERTOS_TASKS_C_ADDITIONS_H\r