From 7c2ea617f9be9362771202584a3f30c3636c90be Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 1 May 2023 22:18:24 +0200 Subject: [PATCH] sim: mark header that need to be as C header --- sim/FreeRTOS.h | 12 ++++++------ sim/portmacro_cmsis.h | 8 ++++++++ sim/task.h | 8 ++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/sim/FreeRTOS.h b/sim/FreeRTOS.h index 27d9726..be40417 100644 --- a/sim/FreeRTOS.h +++ b/sim/FreeRTOS.h @@ -29,8 +29,13 @@ #ifndef INC_FREERTOS_H #define INC_FREERTOS_H +#ifdef __cplusplus +extern "C" { +#endif + #include "portmacro_cmsis.h" //#include "app_error.h" +#include // from nrf_error.h /** @defgroup NRF_ERRORS_BASE Error Codes Base number definitions @@ -78,21 +83,16 @@ const unsigned SCB_ICSR_VECTACTIVE_Msk = 0x01; // copied from nRF5_SDK_15.3.0_59ac345/components/toolchain/cmsis/include/core_cm4.h void NVIC_SystemReset(void); -#include #define configTOTAL_HEAP_SIZE (1024 * 40) size_t xPortGetFreeHeapSize(void); size_t xPortGetMinimumEverFreeHeapSize(void); -#ifdef __cplusplus -extern "C" { -#endif void *pvPortMalloc(size_t xWantedSize); void vPortFree(void *pv); + #ifdef __cplusplus } #endif - - #endif /* INC_FREERTOS_H */ diff --git a/sim/portmacro_cmsis.h b/sim/portmacro_cmsis.h index e8dd49e..774878c 100644 --- a/sim/portmacro_cmsis.h +++ b/sim/portmacro_cmsis.h @@ -29,6 +29,10 @@ #ifndef PORTMACRO_CMSIS_H #define PORTMACRO_CMSIS_H +#ifdef __cplusplus +extern "C" { +#endif + #include typedef uint32_t TickType_t; @@ -46,4 +50,8 @@ const NRF_RTC_Type portNRF_RTC_REG = 1; void portYIELD_FROM_ISR(BaseType_t); +#ifdef __cplusplus +} +#endif + #endif /* PORTMACRO_CMSIS_H */ diff --git a/sim/task.h b/sim/task.h index 45cfe44..6ee5f6e 100644 --- a/sim/task.h +++ b/sim/task.h @@ -30,6 +30,10 @@ #ifndef INC_TASK_H #define INC_TASK_H +#ifdef __cplusplus +extern "C" { +#endif + #include "portmacro_cmsis.h" #include @@ -324,4 +328,8 @@ TaskHandle_t xTaskGetCurrentTaskHandle(); */ BaseType_t xTaskGetSchedulerState(); +#ifdef __cplusplus +} +#endif + #endif /* INC_TASK_H */