Kaynağa Gözat

update config

hathach 6 yıl önce
ebeveyn
işleme
c2d0d2d4d8
1 değiştirilmiş dosya ile 5 ekleme ve 4 silme
  1. 5 4
      examples/device/cdc_msc_hid/src/tusb_config.h

+ 5 - 4
examples/device/cdc_msc_hid/src/tusb_config.h

@@ -75,12 +75,13 @@
 #define CFG_TUD_CDC              1
 #define CFG_TUD_MSC              1
 
-#if CFG_TUSB_MCU == OPT_MCU_STM32F4
-// STM32F4 does not have enough endpoints (4, including hardcoded control
+// Some STM32 MCUs does not have enough endpoints (4, including control
 // endpoint) to enable CDC, MSC, and HID simultaneously, so disable HID as a compromise.
-#define CFG_TUD_HID              0
+#if CFG_TUSB_MCU == OPT_MCU_STM32F4
+  #include "stm32f4xx.h"
+  #define CFG_TUD_HID            ((USB_OTG_FS_MAX_IN_ENDPOINTS > 4) ? 1 : 0)
 #else
-#define CFG_TUD_HID              1
+  #define CFG_TUD_HID            1
 #endif
 
 #define CFG_TUD_MIDI             0