soc: nxp_s32: cmsis rtos v2 adaptation

There are symbols are both defined by the NXP S32 HAL and
the CMSIS RTOS V2 wrapper, to avoid interference between
them, redefine the symbols under an enum.

Also this is may a common issue for all NXP S32 platforms,
move to common place to be reused

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
This commit is contained in:
Dat Nguyen Duy 2023-11-22 17:11:29 +07:00 committed by Carles Cufí
parent 1961adfb96
commit 513ba04168
3 changed files with 24 additions and 6 deletions

View File

@ -0,0 +1,19 @@
/*
* Copyright 2023 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_SOC_ARM_NXP_S32_COMMON_CMSIS_RTOS_V2_ADAPT_H_
#define ZEPHYR_SOC_ARM_NXP_S32_COMMON_CMSIS_RTOS_V2_ADAPT_H_
/*
* The HAL is defining these symbols already. To avoid interference
* between HAL and the CMSIS RTOS wrapper, redefine them under an enum.
*/
#undef TRUE
#undef FALSE
enum { FALSE, TRUE};
#endif /* ZEPHYR_SOC_ARM_NXP_S32_COMMON_CMSIS_RTOS_V2_ADAPT_H_ */

View File

@ -10,12 +10,7 @@
#include <S32K344.h>
#if defined(CONFIG_CMSIS_RTOS_V2)
/*
* The HAL is defining these symbols already. To avoid redefinitions,
* let CMSIS RTOS wrapper define them.
*/
#undef TRUE
#undef FALSE
#include <cmsis_rtos_v2_adapt.h>
#endif
/* Aliases for peripheral base addresses */

View File

@ -16,6 +16,10 @@
#error "SoC not supported"
#endif
#if defined(CONFIG_CMSIS_RTOS_V2)
#include <cmsis_rtos_v2_adapt.h>
#endif
/* Aliases for peripheral base addresses */
/* SIUL2 */