From 19f7548b607c00439a0dba8c7a24f49ad90ebf5c Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Fri, 9 May 2025 18:21:47 +0800 Subject: [PATCH] update(cherryusb_config_template): update macro Signed-off-by: sakumisu <1203593632@qq.com> --- cherryusb_config_template.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cherryusb_config_template.h b/cherryusb_config_template.h index 9b7334b3..0e6334a2 100644 --- a/cherryusb_config_template.h +++ b/cherryusb_config_template.h @@ -8,7 +8,13 @@ /* ================ USB common Configuration ================ */ +#ifdef __RTTHREAD__ +#include + +#define CONFIG_USB_PRINTF(...) rt_kprintf(__VA_ARGS__) +#else #define CONFIG_USB_PRINTF(...) printf(__VA_ARGS__) +#endif #ifndef CONFIG_USB_DBG_LEVEL #define CONFIG_USB_DBG_LEVEL USB_DBG_INFO @@ -22,11 +28,16 @@ #define CONFIG_USB_ALIGN_SIZE 4 #endif -//#define CONFIG_USB_DCACHE_ENABLE +// #define CONFIG_USB_DCACHE_ENABLE /* attribute data into no cache ram */ #define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable"))) +/* use usb_memcpy default for high performance but cost more flash memory. + * And, arm libc has a bug that memcpy() may cause data misalignment when the size is not a multiple of 4. +*/ +// #define CONFIG_USB_MEMCPY_DISABLE + /* ================= USB Device Stack Configuration ================ */ /* Ep0 in and out transfer buffer */ @@ -114,6 +125,7 @@ #endif #define CONFIG_USBDEV_RNDIS_USING_LWIP +#define CONFIG_USBDEV_CDC_ECM_USING_LWIP /* ================ USB HOST Stack Configuration ================== */