From 5bc6885b844bbafaeec9d1818ad6fa91b0db3885 Mon Sep 17 00:00:00 2001 From: JasonTan Date: Sat, 9 Dec 2023 18:45:26 +0800 Subject: [PATCH] fix: rt-thread 5.0 compile error (#33) (cherry picked from commit 8c285b584b27f0970060443066ad5188cdee5b22) --- rt-thread/tusb_config.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rt-thread/tusb_config.h b/rt-thread/tusb_config.h index 1ead75e2c9..710a54e077 100644 --- a/rt-thread/tusb_config.h +++ b/rt-thread/tusb_config.h @@ -11,6 +11,7 @@ #ifndef _TUSB_CONFIG_H_ #define _TUSB_CONFIG_H_ +#include #include #ifdef __cplusplus @@ -84,12 +85,20 @@ extern "C" { * - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4))) */ #ifndef CFG_TUSB_MEM_SECTION +#ifdef rt_section +#define CFG_TUSB_MEM_SECTION rt_section(PKG_TINYUSB_MEM_SECTION) +#else #define CFG_TUSB_MEM_SECTION RT_SECTION(PKG_TINYUSB_MEM_SECTION) #endif +#endif #ifndef CFG_TUSB_MEM_ALIGN +#ifdef rt_align +#define CFG_TUSB_MEM_ALIGN rt_align(PKG_TINYUSB_MEM_ALIGN) +#else #define CFG_TUSB_MEM_ALIGN ALIGN(PKG_TINYUSB_MEM_ALIGN) #endif +#endif //-------------------------------------------------------------------- // DEVICE CONFIGURATION