2222
2323#include <string.h>
2424
25- #include "RTE_Components.h" // Component selection
26-
2725#include "cmsis_os2.h" // ::CMSIS:RTOS2
28- #include "cmsis_compiler.h"
29- #include "os_tick.h"
26+ #include "cmsis_compiler.h" // Compiler agnostic definitions
27+ #include "os_tick.h" // OS Tick API
3028
3129#include "FreeRTOS.h" // ARM.FreeRTOS::RTOS:Core
3230#include "task.h" // ARM.FreeRTOS::RTOS:Core
3331#include "event_groups.h" // ARM.FreeRTOS::RTOS:Event Groups
3432#include "semphr.h" // ARM.FreeRTOS::RTOS:Core
3533
36- #include "freertos_mpool.h"
34+ #include "freertos_mpool.h" // osMemoryPool definitions
35+ #include "freertos_os2.h" // Configuration check and setup
3736
3837/*---------------------------------------------------------------------------*/
3938#ifndef __ARM_ARCH_6M__
@@ -112,7 +111,7 @@ static osKernelState_t KernelState = osKernelInactive;
112111 definition configHEAP_5_REGIONS as parameter. Overriding configHEAP_5_REGIONS
113112 is possible by defining it globally or in FreeRTOSConfig.h.
114113*/
115- #if defined(RTE_RTOS_FreeRTOS_HEAP_5 )
114+ #if defined(USE_FreeRTOS_HEAP_5 )
116115#if (configAPPLICATION_ALLOCATED_HEAP == 0 )
117116 /*
118117 FreeRTOS heap is not defined by the application.
@@ -142,7 +141,7 @@ static osKernelState_t KernelState = osKernelInactive;
142141 */
143142 #define HEAP_5_REGION_SETUP 0
144143#endif /* configAPPLICATION_ALLOCATED_HEAP */
145- #endif /* RTE_RTOS_FreeRTOS_HEAP_5 */
144+ #endif /* USE_FreeRTOS_HEAP_5 */
146145
147146#if defined(SysTick )
148147#undef SysTick_Handler
@@ -195,10 +194,10 @@ osStatus_t osKernelInitialize (void) {
195194 }
196195 else {
197196 if (KernelState == osKernelInactive ) {
198- #if defined(RTE_Compiler_EventRecorder )
197+ #if defined(USE_TRACE_EVENT_RECORDER )
199198 EvrFreeRTOSSetup (0U );
200199 #endif
201- #if defined(RTE_RTOS_FreeRTOS_HEAP_5 ) && (HEAP_5_REGION_SETUP == 1 )
200+ #if defined(USE_FreeRTOS_HEAP_5 ) && (HEAP_5_REGION_SETUP == 1 )
202201 vPortDefineHeapRegions (configHEAP_5_REGIONS );
203202 #endif
204203 KernelState = osKernelReady ;
@@ -618,7 +617,7 @@ osStatus_t osThreadResume (osThreadId_t thread_id) {
618617}
619618
620619__NO_RETURN void osThreadExit (void ) {
621- #ifndef RTE_RTOS_FreeRTOS_HEAP_1
620+ #ifndef USE_FreeRTOS_HEAP_1
622621 vTaskDelete (NULL );
623622#endif
624623 for (;;);
@@ -627,7 +626,7 @@ __NO_RETURN void osThreadExit (void) {
627626osStatus_t osThreadTerminate (osThreadId_t thread_id ) {
628627 TaskHandle_t hTask = (TaskHandle_t )thread_id ;
629628 osStatus_t stat ;
630- #ifndef RTE_RTOS_FreeRTOS_HEAP_1
629+ #ifndef USE_FreeRTOS_HEAP_1
631630 eTaskState tstate ;
632631
633632 if (IS_IRQ ()) {
@@ -1035,7 +1034,7 @@ uint32_t osTimerIsRunning (osTimerId_t timer_id) {
10351034osStatus_t osTimerDelete (osTimerId_t timer_id ) {
10361035 TimerHandle_t hTimer = (TimerHandle_t )timer_id ;
10371036 osStatus_t stat ;
1038- #ifndef RTE_RTOS_FreeRTOS_HEAP_1
1037+ #ifndef USE_FreeRTOS_HEAP_1
10391038 TimerCallback_t * callb ;
10401039
10411040 if (IS_IRQ ()) {
@@ -1216,7 +1215,7 @@ osStatus_t osEventFlagsDelete (osEventFlagsId_t ef_id) {
12161215 EventGroupHandle_t hEventGroup = (EventGroupHandle_t )ef_id ;
12171216 osStatus_t stat ;
12181217
1219- #ifndef RTE_RTOS_FreeRTOS_HEAP_1
1218+ #ifndef USE_FreeRTOS_HEAP_1
12201219 if (IS_IRQ ()) {
12211220 stat = osErrorISR ;
12221221 }
@@ -1406,7 +1405,7 @@ osThreadId_t osMutexGetOwner (osMutexId_t mutex_id) {
14061405
14071406osStatus_t osMutexDelete (osMutexId_t mutex_id ) {
14081407 osStatus_t stat ;
1409- #ifndef RTE_RTOS_FreeRTOS_HEAP_1
1408+ #ifndef USE_FreeRTOS_HEAP_1
14101409 SemaphoreHandle_t hMutex ;
14111410
14121411 hMutex = (SemaphoreHandle_t )((uint32_t )mutex_id & ~1U );
@@ -1585,7 +1584,7 @@ osStatus_t osSemaphoreDelete (osSemaphoreId_t semaphore_id) {
15851584 SemaphoreHandle_t hSemaphore = (SemaphoreHandle_t )semaphore_id ;
15861585 osStatus_t stat ;
15871586
1588- #ifndef RTE_RTOS_FreeRTOS_HEAP_1
1587+ #ifndef USE_FreeRTOS_HEAP_1
15891588 if (IS_IRQ ()) {
15901589 stat = osErrorISR ;
15911590 }
@@ -1834,7 +1833,7 @@ osStatus_t osMessageQueueDelete (osMessageQueueId_t mq_id) {
18341833 QueueHandle_t hQueue = (QueueHandle_t )mq_id ;
18351834 osStatus_t stat ;
18361835
1837- #ifndef RTE_RTOS_FreeRTOS_HEAP_1
1836+ #ifndef USE_FreeRTOS_HEAP_1
18381837 if (IS_IRQ ()) {
18391838 stat = osErrorISR ;
18401839 }
0 commit comments