From feb5ed4cb4f986c0a85bc02375aef309afd74379 Mon Sep 17 00:00:00 2001 From: "Man, Jianting (Meco)" <920369182@qq.com> Date: Sat, 4 Dec 2021 00:33:10 -0500 Subject: [PATCH] update for RT-Thread v4.1.0 --- port/fal/inc/fal_def.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/port/fal/inc/fal_def.h b/port/fal/inc/fal_def.h index bca071b..f432c26 100644 --- a/port/fal/inc/fal_def.h +++ b/port/fal/inc/fal_def.h @@ -30,6 +30,15 @@ #define FAL_SW_VERSION "0.5.0" +#ifdef __RTTHREAD__ /* for RT-Thread platform */ +#include +#define FAL_PRINTF rt_kprintf +#define FAL_MALLOC rt_malloc +#define FAL_CALLOC rt_calloc +#define FAL_REALLOC rt_realloc +#define FAL_FREE rt_free +#endif + #ifndef FAL_MALLOC #define FAL_MALLOC malloc #endif @@ -46,20 +55,14 @@ #define FAL_FREE free #endif +#ifndef FAL_PRINTF +#define FAL_PRINTF printf +#endif + #ifndef FAL_DEBUG #define FAL_DEBUG 0 #endif -#ifndef FAL_PRINTF -#ifdef RT_VER_NUM -/* for RT-Thread platform */ -extern void rt_kprintf(const char *fmt, ...); -#define FAL_PRINTF rt_kprintf -#else -#define FAL_PRINTF printf -#endif /* RT_VER_NUM */ -#endif /* FAL_PRINTF */ - #if FAL_DEBUG #ifdef assert #undef assert