From 6faebdf3095887aec72e8657fd29e56db46ff3b7 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Tue, 20 Dec 2022 23:50:51 +0100 Subject: [PATCH] TUD options are declared on compile time depending on enabled interfaces. Signed-off-by: Pol Henarejos --- src/usb/tusb_config.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/usb/tusb_config.h b/src/usb/tusb_config.h index fab1001..8a292ae 100644 --- a/src/usb/tusb_config.h +++ b/src/usb/tusb_config.h @@ -26,6 +26,8 @@ #ifndef _TUSB_CONFIG_H_ #define _TUSB_CONFIG_H_ +#include "usb.h" + #ifdef __cplusplus extern "C" { #endif @@ -103,9 +105,17 @@ //------------- CLASS -------------// #define CFG_TUD_CDC 0 #define CFG_TUD_MSC 0 +#ifdef USB_ITF_HID #define CFG_TUD_HID 1 +#else +#define CFG_TUD_HID 0 +#endif #define CFG_TUD_MIDI 0 +#ifdef USB_ITF_CCID #define CFG_TUD_VENDOR 1 +#else +#define CFG_TUD_VENDOR 0 +#endif // HID buffer size Should be sufficient to hold ID (if any) + Data #define CFG_TUD_HID_EP_BUFSIZE 64