Jelajahi Sumber

rename TUSB_OPT_DEVICE_ENABLED to CFG_TUD_ENABLED

TUSB_OPT_DEVICE_ENABLED still usable for backward compatible
hathach 4 tahun lalu
induk
melakukan
d10326cb4e
59 mengubah file dengan 70 tambahan dan 67 penghapusan
  1. 1 1
      hw/bsp/board.h
  2. 3 3
      hw/bsp/brtmm90x/family.c
  3. 1 1
      hw/bsp/d5035_01/d5035_01.c
  4. 1 1
      hw/bsp/da14695_dk_usb/da14695_dk_usb.c
  5. 2 2
      hw/bsp/da1469x_dk_pro/da1469x-dk-pro.c
  6. 1 1
      hw/bsp/frdm_kl25z/frdm_kl25z.c
  7. 1 1
      hw/bsp/lpcxpresso1769/lpcxpresso1769.c
  8. 1 1
      hw/bsp/mbed1768/mbed1768.c
  9. 2 2
      hw/bsp/msp432e4/family.c
  10. 1 1
      hw/bsp/nrf/family.c
  11. 1 1
      hw/bsp/rp2040/family.c
  12. 1 1
      hw/bsp/rx/boards/rx65n_target/rx65n_target.c
  13. 1 1
      hw/bsp/same54xplainedpro/same54xplainedpro.c
  14. 1 1
      hw/bsp/tm4c123/family.c
  15. 2 2
      src/class/audio/audio_device.c
  16. 1 1
      src/class/bth/bth_device.c
  17. 1 1
      src/class/cdc/cdc_device.c
  18. 1 1
      src/class/dfu/dfu_device.c
  19. 1 1
      src/class/dfu/dfu_rt_device.c
  20. 1 1
      src/class/hid/hid_device.c
  21. 1 1
      src/class/midi/midi_device.c
  22. 1 1
      src/class/msc/msc_device.c
  23. 1 1
      src/class/net/ecm_rndis_device.c
  24. 1 1
      src/class/net/ncm_device.c
  25. 1 1
      src/class/usbtmc/usbtmc_device.c
  26. 1 1
      src/class/vendor/vendor_device.c
  27. 1 1
      src/class/video/video_device.c
  28. 1 1
      src/device/usbd.c
  29. 1 1
      src/device/usbd_control.c
  30. 1 1
      src/portable/bridgetek/ft9xx/dcd_ft9xx.c
  31. 1 1
      src/portable/broadcom/synopsys/dcd_synopsys.c
  32. 1 1
      src/portable/chipidea/ci_hs/dcd_ci_hs.c
  33. 1 1
      src/portable/dialog/da146xx/dcd_da146xx.c
  34. 1 1
      src/portable/espressif/esp32sx/dcd_esp32sx.c
  35. 1 1
      src/portable/mentor/musb/dcd_musb.c
  36. 1 1
      src/portable/microchip/pic32mz/dcd_pic32mz.c
  37. 1 1
      src/portable/microchip/samd/dcd_samd.c
  38. 1 1
      src/portable/microchip/samx7x/dcd_samx7x.c
  39. 1 1
      src/portable/mindmotion/mm32/dcd_mm32f327x_otg.c
  40. 1 1
      src/portable/nordic/nrf5x/dcd_nrf5x.c
  41. 1 1
      src/portable/nuvoton/nuc120/dcd_nuc120.c
  42. 1 1
      src/portable/nuvoton/nuc121/dcd_nuc121.c
  43. 1 1
      src/portable/nuvoton/nuc505/dcd_nuc505.c
  44. 1 1
      src/portable/nxp/khci/dcd_khci.c
  45. 1 1
      src/portable/nxp/lpc17_40/dcd_lpc17_40.c
  46. 1 1
      src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
  47. 1 1
      src/portable/nxp/transdimension/dcd_transdimension.c
  48. 1 1
      src/portable/raspberrypi/rp2040/dcd_rp2040.c
  49. 1 1
      src/portable/renesas/usba/dcd_usba.c
  50. 1 1
      src/portable/sony/cxd56/dcd_cxd56.c
  51. 1 1
      src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
  52. 1 1
      src/portable/st/synopsys/dcd_synopsys.c
  53. 1 1
      src/portable/sunxi/dcd_sunxi_musb.c
  54. 1 1
      src/portable/synopsys/dwc2/dcd_dwc2.c
  55. 1 1
      src/portable/ti/msp430x5xx/dcd_msp430x5xx.c
  56. 1 1
      src/portable/valentyusb/eptri/dcd_eptri.c
  57. 4 4
      src/tusb.c
  58. 1 1
      src/tusb.h
  59. 4 1
      src/tusb_option.h

+ 1 - 1
hw/bsp/board.h

@@ -120,7 +120,7 @@ static inline void board_delay(uint32_t ms)
   uint32_t start_ms = board_millis();
   uint32_t start_ms = board_millis();
   while (board_millis() - start_ms < ms)
   while (board_millis() - start_ms < ms)
   {
   {
-    #if TUSB_OPT_DEVICE_ENABLED
+    #if CFG_TUD_ENABLED
     // take chance to run usb background
     // take chance to run usb background
     tud_task();
     tud_task();
     #endif
     #endif

+ 3 - 3
hw/bsp/brtmm90x/family.c

@@ -30,7 +30,7 @@
 #include <registers/ft900_registers.h>
 #include <registers/ft900_registers.h>
 #include <ft900.h>
 #include <ft900.h>
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
 int8_t board_ft90x_vbus(void); // Board specific implementation of VBUS detection for USB device.
 int8_t board_ft90x_vbus(void); // Board specific implementation of VBUS detection for USB device.
 extern void ft90x_usbd_pm_ISR(uint16_t pmcfg); // Interrupt handler for USB device power management
 extern void ft90x_usbd_pm_ISR(uint16_t pmcfg); // Interrupt handler for USB device power management
 #endif
 #endif
@@ -152,14 +152,14 @@ void board_pm_ISR(void)
               MASK_SYS_PMCFG_HOST_RESUME_DEV)
               MASK_SYS_PMCFG_HOST_RESUME_DEV)
     )
     )
     {
     {
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
         ft90x_usbd_pm_ISR(pmcfg);
         ft90x_usbd_pm_ISR(pmcfg);
 #endif
 #endif
     }
     }
 #endif
 #endif
 }
 }
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
 int8_t board_ft90x_vbus(void)
 int8_t board_ft90x_vbus(void)
 {
 {
 	return gpio_read(USBD_VBUS_DTC_PIN);
 	return gpio_read(USBD_VBUS_DTC_PIN);

+ 1 - 1
hw/bsp/d5035_01/d5035_01.c

@@ -270,7 +270,7 @@ void board_init(void)
 #endif
 #endif
 
 
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
 #if CFG_TUSB_DEBUG >= 2
 #if CFG_TUSB_DEBUG >= 2
 	uart_send_str(BOARD_NAME " USB device enabled\n");
 	uart_send_str(BOARD_NAME " USB device enabled\n");
 #endif
 #endif

+ 1 - 1
hw/bsp/da14695_dk_usb/da14695_dk_usb.c

@@ -73,7 +73,7 @@ void board_init(void)
   // 1ms tick timer
   // 1ms tick timer
   SysTick_Config(SystemCoreClock / 1000);
   SysTick_Config(SystemCoreClock / 1000);
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   // This board is USB powered there is no need to monitor
   // This board is USB powered there is no need to monitor
   // VBUS line.  Notify driver that VBUS is present.
   // VBUS line.  Notify driver that VBUS is present.
   tusb_vbus_changed(true);
   tusb_vbus_changed(true);

+ 2 - 2
hw/bsp/da1469x_dk_pro/da1469x-dk-pro.c

@@ -36,7 +36,7 @@ void USB_IRQHandler(void)
   tud_int_handler(0);
   tud_int_handler(0);
 }
 }
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
 // DA146xx driver function that must be called whenever VBUS changes
 // DA146xx driver function that must be called whenever VBUS changes
 extern void tusb_vbus_changed(bool present);
 extern void tusb_vbus_changed(bool present);
 
 
@@ -85,7 +85,7 @@ void board_init(void)
   // 1ms tick timer
   // 1ms tick timer
   SysTick_Config(SystemCoreClock / 1000);
   SysTick_Config(SystemCoreClock / 1000);
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   // Setup interrupt for both connect and disconnect
   // Setup interrupt for both connect and disconnect
   CRG_TOP->VBUS_IRQ_MASK_REG = CRG_TOP_VBUS_IRQ_MASK_REG_VBUS_IRQ_EN_FALL_Msk |
   CRG_TOP->VBUS_IRQ_MASK_REG = CRG_TOP_VBUS_IRQ_MASK_REG_VBUS_IRQ_EN_FALL_Msk |
                                CRG_TOP_VBUS_IRQ_MASK_REG_VBUS_IRQ_EN_RISE_Msk;
                                CRG_TOP_VBUS_IRQ_MASK_REG_VBUS_IRQ_EN_RISE_Msk;

+ 1 - 1
hw/bsp/frdm_kl25z/frdm_kl25z.c

@@ -42,7 +42,7 @@ void USB0_IRQHandler(void)
 #if TUSB_OPT_HOST_ENABLED
 #if TUSB_OPT_HOST_ENABLED
   tuh_int_handler(0);
   tuh_int_handler(0);
 #endif
 #endif
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   tud_int_handler(0);
   tud_int_handler(0);
 #endif
 #endif
 }
 }

+ 1 - 1
hw/bsp/lpcxpresso1769/lpcxpresso1769.c

@@ -156,7 +156,7 @@ void board_init(void)
 //    0x1B // Host + Device + OTG + AHB
 //    0x1B // Host + Device + OTG + AHB
   };
   };
 
 
-  uint32_t const clk_en = TUSB_OPT_DEVICE_ENABLED ? USBCLK_DEVCIE : USBCLK_HOST;
+  uint32_t const clk_en = CFG_TUD_ENABLED ? USBCLK_DEVCIE : USBCLK_HOST;
 
 
   LPC_USB->OTGClkCtrl = clk_en;
   LPC_USB->OTGClkCtrl = clk_en;
   while ( (LPC_USB->OTGClkSt & clk_en) != clk_en );
   while ( (LPC_USB->OTGClkSt & clk_en) != clk_en );

+ 1 - 1
hw/bsp/mbed1768/mbed1768.c

@@ -130,7 +130,7 @@ void board_init(void)
 //    0x1B // Host + Device + OTG + AHB
 //    0x1B // Host + Device + OTG + AHB
   };
   };
 
 
-  uint32_t const clk_en = TUSB_OPT_DEVICE_ENABLED ? USBCLK_DEVCIE : USBCLK_HOST;
+  uint32_t const clk_en = CFG_TUD_ENABLED ? USBCLK_DEVCIE : USBCLK_HOST;
 
 
   LPC_USB->OTGClkCtrl = clk_en;
   LPC_USB->OTGClkCtrl = clk_en;
   while ( (LPC_USB->OTGClkSt & clk_en) != clk_en );
   while ( (LPC_USB->OTGClkSt & clk_en) != clk_en );

+ 2 - 2
hw/bsp/msp432e4/family.c

@@ -36,7 +36,7 @@ void USB0_IRQHandler(void)
 #if TUSB_OPT_HOST_ENABLED
 #if TUSB_OPT_HOST_ENABLED
   tuh_int_handler(0);
   tuh_int_handler(0);
 #endif
 #endif
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   tud_int_handler(0);
   tud_int_handler(0);
 #endif
 #endif
 }
 }
@@ -148,7 +148,7 @@ void board_init(void)
   USB0->GPCS = USB_GPCS_DEVMOD_OTG;
   USB0->GPCS = USB_GPCS_DEVMOD_OTG;
   USB0->EPC  = USB_EPC_EPENDE | USB_EPC_EPEN_HIGH;
   USB0->EPC  = USB_EPC_EPENDE | USB_EPC_EPEN_HIGH;
 #endif
 #endif
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   USB0->GPCS = USB_GPCS_DEVMOD_DEVVBUS;
   USB0->GPCS = USB_GPCS_DEVMOD_DEVVBUS;
 #endif
 #endif
 }
 }

+ 1 - 1
hw/bsp/nrf/family.c

@@ -100,7 +100,7 @@ void board_init(void)
   nrfx_uarte_init(&_uart_id, &uart_cfg, NULL); //uart_handler);
   nrfx_uarte_init(&_uart_id, &uart_cfg, NULL); //uart_handler);
 
 
   //------------- USB -------------//
   //------------- USB -------------//
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   // Priorities 0, 1, 4 (nRF52) are reserved for SoftDevice
   // Priorities 0, 1, 4 (nRF52) are reserved for SoftDevice
   // 2 is highest for application
   // 2 is highest for application
   NVIC_SetPriority(USBD_IRQn, 2);
   NVIC_SetPriority(USBD_IRQn, 2);

+ 1 - 1
hw/bsp/rp2040/family.c

@@ -138,7 +138,7 @@ void board_init(void)
 #endif
 #endif
 
 
   // todo probably set up device mode?
   // todo probably set up device mode?
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
 
 
 #endif
 #endif
 
 

+ 1 - 1
hw/bsp/rx/boards/rx65n_target/rx65n_target.c

@@ -179,7 +179,7 @@ void INT_Excep_USB0_USBI0(void)
 #if TUSB_OPT_HOST_ENABLED
 #if TUSB_OPT_HOST_ENABLED
   tuh_int_handler(0);
   tuh_int_handler(0);
 #endif
 #endif
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   tud_int_handler(0);
   tud_int_handler(0);
 #endif
 #endif
 }
 }

+ 1 - 1
hw/bsp/same54xplainedpro/same54xplainedpro.c

@@ -223,7 +223,7 @@ void board_init(void)
 #endif
 #endif
 
 
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
 #if CFG_TUSB_DEBUG >= 2
 #if CFG_TUSB_DEBUG >= 2
 	uart_send_str(BOARD_NAME " USB device enabled\n");
 	uart_send_str(BOARD_NAME " USB device enabled\n");
 #endif
 #endif

+ 1 - 1
hw/bsp/tm4c123/family.c

@@ -11,7 +11,7 @@ void USB0_Handler(void)
   tuh_int_handler(0);
   tuh_int_handler(0);
 #endif
 #endif
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   tud_int_handler(0);
   tud_int_handler(0);
 #endif
 #endif
 }
 }

+ 2 - 2
src/class/audio/audio_device.c

@@ -50,7 +50,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_AUDIO)
+#if (CFG_TUD_ENABLED && CFG_TUD_AUDIO)
 
 
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // INCLUDE
 // INCLUDE
@@ -2291,4 +2291,4 @@ uint8_t audiod_get_audio_fct_idx(audiod_function_t * audio)
   return 0;
   return 0;
 }
 }
 
 
-#endif //TUSB_OPT_DEVICE_ENABLED && CFG_TUD_AUDIO
+#endif //CFG_TUD_ENABLED && CFG_TUD_AUDIO

+ 1 - 1
src/class/bth/bth_device.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_BTH)
+#if (CFG_TUD_ENABLED && CFG_TUD_BTH)
 
 
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // INCLUDE
 // INCLUDE

+ 1 - 1
src/class/cdc/cdc_device.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_CDC)
+#if (CFG_TUD_ENABLED && CFG_TUD_CDC)
 
 
 #include "device/usbd.h"
 #include "device/usbd.h"
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"

+ 1 - 1
src/class/dfu/dfu_device.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_DFU)
+#if (CFG_TUD_ENABLED && CFG_TUD_DFU)
 
 
 #include "device/usbd.h"
 #include "device/usbd.h"
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"

+ 1 - 1
src/class/dfu/dfu_rt_device.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_DFU_RUNTIME)
+#if (CFG_TUD_ENABLED && CFG_TUD_DFU_RUNTIME)
 
 
 #include "device/usbd.h"
 #include "device/usbd.h"
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"

+ 1 - 1
src/class/hid/hid_device.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_HID)
+#if (CFG_TUD_ENABLED && CFG_TUD_HID)
 
 
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // INCLUDE
 // INCLUDE

+ 1 - 1
src/class/midi/midi_device.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_MIDI)
+#if (CFG_TUD_ENABLED && CFG_TUD_MIDI)
 
 
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // INCLUDE
 // INCLUDE

+ 1 - 1
src/class/msc/msc_device.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_MSC)
+#if (CFG_TUD_ENABLED && CFG_TUD_MSC)
 
 
 #include "device/usbd.h"
 #include "device/usbd.h"
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"

+ 1 - 1
src/class/net/ecm_rndis_device.c

@@ -27,7 +27,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if ( TUSB_OPT_DEVICE_ENABLED && CFG_TUD_ECM_RNDIS )
+#if ( CFG_TUD_ENABLED && CFG_TUD_ECM_RNDIS )
 
 
 #include "device/usbd.h"
 #include "device/usbd.h"
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"

+ 1 - 1
src/class/net/ncm_device.c

@@ -28,7 +28,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if ( TUSB_OPT_DEVICE_ENABLED && CFG_TUD_NCM )
+#if ( CFG_TUD_ENABLED && CFG_TUD_NCM )
 
 
 #include "device/usbd.h"
 #include "device/usbd.h"
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"

+ 1 - 1
src/class/usbtmc/usbtmc_device.c

@@ -68,7 +68,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_USBTMC)
+#if (CFG_TUD_ENABLED && CFG_TUD_USBTMC)
 
 
 #include "device/usbd.h"
 #include "device/usbd.h"
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"

+ 1 - 1
src/class/vendor/vendor_device.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_VENDOR)
+#if (CFG_TUD_ENABLED && CFG_TUD_VENDOR)
 
 
 #include "device/usbd.h"
 #include "device/usbd.h"
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"

+ 1 - 1
src/class/video/video_device.c

@@ -27,7 +27,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_VIDEO && CFG_TUD_VIDEO_STREAMING)
+#if (CFG_TUD_ENABLED && CFG_TUD_VIDEO && CFG_TUD_VIDEO_STREAMING)
 
 
 #include "device/usbd.h"
 #include "device/usbd.h"
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"

+ 1 - 1
src/device/usbd.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
 
 
 #include "tusb.h"
 #include "tusb.h"
 #include "device/usbd.h"
 #include "device/usbd.h"

+ 1 - 1
src/device/usbd_control.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
 
 
 #include "tusb.h"
 #include "tusb.h"
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"

+ 1 - 1
src/portable/bridgetek/ft9xx/dcd_ft9xx.c

@@ -31,7 +31,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && \
+#if CFG_TUD_ENABLED && \
   (CFG_TUSB_MCU == OPT_MCU_FT90X || CFG_TUSB_MCU == OPT_MCU_FT93X) 
   (CFG_TUSB_MCU == OPT_MCU_FT90X || CFG_TUSB_MCU == OPT_MCU_FT93X) 
 
 
 #include <stdint.h>
 #include <stdint.h>

+ 1 - 1
src/portable/broadcom/synopsys/dcd_synopsys.c

@@ -29,7 +29,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED &&         \
+#if CFG_TUD_ENABLED &&         \
     (CFG_TUSB_MCU == OPT_MCU_BCM2711 ) \
     (CFG_TUSB_MCU == OPT_MCU_BCM2711 ) \
 
 
 
 

+ 1 - 1
src/portable/chipidea/ci_hs/dcd_ci_hs.c

@@ -27,7 +27,7 @@
 #include "tusb_option.h"
 #include "tusb_option.h"
 #include "device/dcd_attr.h"
 #include "device/dcd_attr.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && defined(DCD_ATTR_CONTROLLER_CHIPIDEA_HS)
+#if CFG_TUD_ENABLED && defined(DCD_ATTR_CONTROLLER_CHIPIDEA_HS)
 
 
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // INCLUDE
 // INCLUDE

+ 1 - 1
src/portable/dialog/da146xx/dcd_da146xx.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_DA1469X
+#if CFG_TUD_ENABLED && CFG_TUSB_MCU == OPT_MCU_DA1469X
 
 
 #include "mcu/mcu.h"
 #include "mcu/mcu.h"
 
 

+ 1 - 1
src/portable/espressif/esp32sx/dcd_esp32sx.c

@@ -28,7 +28,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if (((CFG_TUSB_MCU == OPT_MCU_ESP32S2) ||  (CFG_TUSB_MCU == OPT_MCU_ESP32S3)) && TUSB_OPT_DEVICE_ENABLED)
+#if (((CFG_TUSB_MCU == OPT_MCU_ESP32S2) ||  (CFG_TUSB_MCU == OPT_MCU_ESP32S3)) && CFG_TUD_ENABLED)
 
 
 // Espressif
 // Espressif
 #include "freertos/xtensa_api.h"
 #include "freertos/xtensa_api.h"

+ 1 - 1
src/portable/mentor/musb/dcd_musb.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && \
+#if CFG_TUD_ENABLED && \
   TU_CHECK_MCU(OPT_MCU_MSP432E4, OPT_MCU_TM4C123, OPT_MCU_TM4C129)
   TU_CHECK_MCU(OPT_MCU_MSP432E4, OPT_MCU_TM4C123, OPT_MCU_TM4C129)
 
 
 #if __GNUC__ > 8 && defined(__ARM_FEATURE_UNALIGNED)
 #if __GNUC__ > 8 && defined(__ARM_FEATURE_UNALIGNED)

+ 1 - 1
src/portable/microchip/pic32mz/dcd_pic32mz.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_PIC32MZ
+#if CFG_TUD_ENABLED && CFG_TUSB_MCU == OPT_MCU_PIC32MZ
 
 
 #include <common/tusb_common.h>
 #include <common/tusb_common.h>
 #include <device/dcd.h>
 #include <device/dcd.h>

+ 1 - 1
src/portable/microchip/samd/dcd_samd.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && \
+#if CFG_TUD_ENABLED && \
     (CFG_TUSB_MCU == OPT_MCU_SAMD11 || CFG_TUSB_MCU == OPT_MCU_SAMD21 || \
     (CFG_TUSB_MCU == OPT_MCU_SAMD11 || CFG_TUSB_MCU == OPT_MCU_SAMD21 || \
      CFG_TUSB_MCU == OPT_MCU_SAMD51 || CFG_TUSB_MCU == OPT_MCU_SAME5X || \
      CFG_TUSB_MCU == OPT_MCU_SAMD51 || CFG_TUSB_MCU == OPT_MCU_SAME5X || \
      CFG_TUSB_MCU == OPT_MCU_SAML22 || CFG_TUSB_MCU == OPT_MCU_SAML21)
      CFG_TUSB_MCU == OPT_MCU_SAML22 || CFG_TUSB_MCU == OPT_MCU_SAML21)

+ 1 - 1
src/portable/microchip/samx7x/dcd_samx7x.c

@@ -27,7 +27,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_SAMX7X
+#if CFG_TUD_ENABLED && CFG_TUSB_MCU == OPT_MCU_SAMX7X
 
 
 #include "device/dcd.h"
 #include "device/dcd.h"
 #include "sam.h"
 #include "sam.h"

+ 1 - 1
src/portable/mindmotion/mm32/dcd_mm32f327x_otg.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_MM32F327X )
+#if CFG_TUD_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_MM32F327X )
 
 
 #include "reg_usb_otg_fs.h"
 #include "reg_usb_otg_fs.h"
 #include "mm32_device.h"
 #include "mm32_device.h"

+ 1 - 1
src/portable/nordic/nrf5x/dcd_nrf5x.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_NRF5X
+#if CFG_TUD_ENABLED && CFG_TUSB_MCU == OPT_MCU_NRF5X
 
 
 #include "nrf.h"
 #include "nrf.h"
 #include "nrf_clock.h"
 #include "nrf_clock.h"

+ 1 - 1
src/portable/nuvoton/nuc120/dcd_nuc120.c

@@ -35,7 +35,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_NUC120)
+#if CFG_TUD_ENABLED && (CFG_TUSB_MCU == OPT_MCU_NUC120)
 
 
 #include "device/dcd.h"
 #include "device/dcd.h"
 #include "NUC100Series.h"
 #include "NUC100Series.h"

+ 1 - 1
src/portable/nuvoton/nuc121/dcd_nuc121.c

@@ -35,7 +35,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && ( (CFG_TUSB_MCU == OPT_MCU_NUC121) || (CFG_TUSB_MCU == OPT_MCU_NUC126) )
+#if CFG_TUD_ENABLED && ( (CFG_TUSB_MCU == OPT_MCU_NUC121) || (CFG_TUSB_MCU == OPT_MCU_NUC126) )
 
 
 #include "device/dcd.h"
 #include "device/dcd.h"
 #include "NuMicro.h"
 #include "NuMicro.h"

+ 1 - 1
src/portable/nuvoton/nuc505/dcd_nuc505.c

@@ -35,7 +35,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_NUC505)
+#if CFG_TUD_ENABLED && (CFG_TUSB_MCU == OPT_MCU_NUC505)
 
 
 #include "device/dcd.h"
 #include "device/dcd.h"
 #include "NUC505Series.h"
 #include "NUC505Series.h"

+ 1 - 1
src/portable/nxp/khci/dcd_khci.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && ( \
+#if CFG_TUD_ENABLED && ( \
       ( CFG_TUSB_MCU == OPT_MCU_MKL25ZXX ) || ( CFG_TUSB_MCU == OPT_MCU_K32L2BXX ) \
       ( CFG_TUSB_MCU == OPT_MCU_MKL25ZXX ) || ( CFG_TUSB_MCU == OPT_MCU_K32L2BXX ) \
     )
     )
 
 

+ 1 - 1
src/portable/nxp/lpc17_40/dcd_lpc17_40.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && \
+#if CFG_TUD_ENABLED && \
     (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX)
     (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX)
 
 
 #include "device/dcd.h"
 #include "device/dcd.h"

+ 1 - 1
src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c

@@ -34,7 +34,7 @@
  * - LPC54114
  * - LPC54114
  * - LPC55s69
  * - LPC55s69
  */
  */
-#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_LPC11UXX || \
+#if CFG_TUD_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_LPC11UXX || \
                                  CFG_TUSB_MCU == OPT_MCU_LPC13XX  || \
                                  CFG_TUSB_MCU == OPT_MCU_LPC13XX  || \
                                  CFG_TUSB_MCU == OPT_MCU_LPC15XX  || \
                                  CFG_TUSB_MCU == OPT_MCU_LPC15XX  || \
                                  CFG_TUSB_MCU == OPT_MCU_LPC51UXX || \
                                  CFG_TUSB_MCU == OPT_MCU_LPC51UXX || \

+ 1 - 1
src/portable/nxp/transdimension/dcd_transdimension.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && \
+#if CFG_TUD_ENABLED && \
     (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX)
     (CFG_TUSB_MCU == OPT_MCU_LPC18XX || CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_MIMXRT10XX)
 
 
 #warning "transdimenion is renamed to chipidea (portable/chipidea/ci_hs) to match other opensource naming convention such as linux. This file will be removed in the future, please update your makefile accordingly"
 #warning "transdimenion is renamed to chipidea (portable/chipidea/ci_hs) to match other opensource naming convention such as linux. This file will be removed in the future, please update your makefile accordingly"

+ 1 - 1
src/portable/raspberrypi/rp2040/dcd_rp2040.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_RP2040
+#if CFG_TUD_ENABLED && CFG_TUSB_MCU == OPT_MCU_RP2040
 
 
 #include "pico.h"
 #include "pico.h"
 #include "rp2040_usb.h"
 #include "rp2040_usb.h"

+ 1 - 1
src/portable/renesas/usba/dcd_usba.c

@@ -31,7 +31,7 @@
 // We disable SOF for now until needed later on
 // We disable SOF for now until needed later on
 #define USE_SOF     0
 #define USE_SOF     0
 
 
-#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_RX63X || \
+#if CFG_TUD_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_RX63X || \
                                  CFG_TUSB_MCU == OPT_MCU_RX65X || \
                                  CFG_TUSB_MCU == OPT_MCU_RX65X || \
                                  CFG_TUSB_MCU == OPT_MCU_RX72N )
                                  CFG_TUSB_MCU == OPT_MCU_RX72N )
 #include "device/dcd.h"
 #include "device/dcd.h"

+ 1 - 1
src/portable/sony/cxd56/dcd_cxd56.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_CXD56
+#if CFG_TUD_ENABLED && CFG_TUSB_MCU == OPT_MCU_CXD56
 
 
 #include <errno.h>
 #include <errno.h>
 #include <nuttx/usb/usbdev.h>
 #include <nuttx/usb/usbdev.h>

+ 1 - 1
src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c

@@ -109,7 +109,7 @@
 #define STM32F1_FSDEV
 #define STM32F1_FSDEV
 #endif
 #endif
 
 
-#if TUSB_OPT_DEVICE_ENABLED && \
+#if CFG_TUD_ENABLED && \
       ( TU_CHECK_MCU(OPT_MCU_STM32F0, OPT_MCU_STM32F3, OPT_MCU_STM32L0, OPT_MCU_STM32L1, OPT_MCU_STM32G4) || \
       ( TU_CHECK_MCU(OPT_MCU_STM32F0, OPT_MCU_STM32F3, OPT_MCU_STM32L0, OPT_MCU_STM32L1, OPT_MCU_STM32G4) || \
         (TU_CHECK_MCU(OPT_MCU_STM32F1) && defined(STM32F1_FSDEV)) \
         (TU_CHECK_MCU(OPT_MCU_STM32F1) && defined(STM32F1_FSDEV)) \
       )
       )

+ 1 - 1
src/portable/st/synopsys/dcd_synopsys.c

@@ -45,7 +45,7 @@
 #define STM32L4_SYNOPSYS
 #define STM32L4_SYNOPSYS
 #endif
 #endif
 
 
-#if TUSB_OPT_DEVICE_ENABLED &&                                          \
+#if CFG_TUD_ENABLED &&                                          \
     ( (CFG_TUSB_MCU == OPT_MCU_STM32F1 && defined(STM32F1_SYNOPSYS)) || \
     ( (CFG_TUSB_MCU == OPT_MCU_STM32F1 && defined(STM32F1_SYNOPSYS)) || \
        CFG_TUSB_MCU == OPT_MCU_STM32F2                               || \
        CFG_TUSB_MCU == OPT_MCU_STM32F2                               || \
        CFG_TUSB_MCU == OPT_MCU_STM32F4                               || \
        CFG_TUSB_MCU == OPT_MCU_STM32F4                               || \

+ 1 - 1
src/portable/sunxi/dcd_sunxi_musb.c

@@ -29,7 +29,7 @@
 #include <stdint.h>
 #include <stdint.h>
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && CFG_TUSB_MCU == OPT_MCU_F1C100S
+#if CFG_TUD_ENABLED && CFG_TUSB_MCU == OPT_MCU_F1C100S
 
 
 #include "osal/osal.h"
 #include "osal/osal.h"
 #include <f1c100s-irq.h>
 #include <f1c100s-irq.h>

+ 1 - 1
src/portable/synopsys/dwc2/dcd_dwc2.c

@@ -30,7 +30,7 @@
 #include "tusb_option.h"
 #include "tusb_option.h"
 #include "device/dcd_attr.h"
 #include "device/dcd_attr.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && \
+#if CFG_TUD_ENABLED && \
     ( defined(DCD_ATTR_DWC2_STM32) || \
     ( defined(DCD_ATTR_DWC2_STM32) || \
       TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3, OPT_MCU_GD32VF103) || \
       TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3, OPT_MCU_GD32VF103) || \
       TU_CHECK_MCU(OPT_MCU_EFM32GG, OPT_MCU_BCM2711, OPT_MCU_BCM2835) || \
       TU_CHECK_MCU(OPT_MCU_EFM32GG, OPT_MCU_BCM2711, OPT_MCU_BCM2835) || \

+ 1 - 1
src/portable/ti/msp430x5xx/dcd_msp430x5xx.c

@@ -27,7 +27,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_MSP430x5xx )
+#if CFG_TUD_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_MSP430x5xx )
 
 
 #include "msp430.h"
 #include "msp430.h"
 #include "device/dcd.h"
 #include "device/dcd.h"

+ 1 - 1
src/portable/valentyusb/eptri/dcd_eptri.c

@@ -26,7 +26,7 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_DEVICE_ENABLED && (CFG_TUSB_MCU == OPT_MCU_VALENTYUSB_EPTRI)
+#if CFG_TUD_ENABLED && (CFG_TUSB_MCU == OPT_MCU_VALENTYUSB_EPTRI)
 
 
 #ifndef DEBUG
 #ifndef DEBUG
 #define DEBUG 0
 #define DEBUG 0

+ 4 - 4
src/tusb.c

@@ -26,18 +26,18 @@
 
 
 #include "tusb_option.h"
 #include "tusb_option.h"
 
 
-#if TUSB_OPT_HOST_ENABLED || TUSB_OPT_DEVICE_ENABLED
+#if TUSB_OPT_HOST_ENABLED || CFG_TUD_ENABLED
 
 
 #include "tusb.h"
 #include "tusb.h"
 
 
 // TODO clean up
 // TODO clean up
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
 #include "device/usbd_pvt.h"
 #include "device/usbd_pvt.h"
 #endif
 #endif
 
 
 bool tusb_init(void)
 bool tusb_init(void)
 {
 {
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   TU_ASSERT ( tud_init(TUD_OPT_RHPORT) ); // init device stack
   TU_ASSERT ( tud_init(TUD_OPT_RHPORT) ); // init device stack
 #endif
 #endif
 
 
@@ -52,7 +52,7 @@ bool tusb_inited(void)
 {
 {
   bool ret = false;
   bool ret = false;
 
 
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   ret = ret || tud_inited();
   ret = ret || tud_inited();
 #endif
 #endif
 
 

+ 1 - 1
src/tusb.h

@@ -61,7 +61,7 @@
 #endif
 #endif
 
 
 //------------- DEVICE -------------//
 //------------- DEVICE -------------//
-#if TUSB_OPT_DEVICE_ENABLED
+#if CFG_TUD_ENABLED
   #include "device/usbd.h"
   #include "device/usbd.h"
 
 
   #if CFG_TUD_HID
   #if CFG_TUD_HID

+ 4 - 1
src/tusb_option.h

@@ -215,7 +215,10 @@
 #define TUD_OPT_HIGH_SPEED      ( (CFG_TUSB_RHPORT1_MODE) & OPT_MODE_HIGH_SPEED )
 #define TUD_OPT_HIGH_SPEED      ( (CFG_TUSB_RHPORT1_MODE) & OPT_MODE_HIGH_SPEED )
 #endif
 #endif
 
 
-#define TUSB_OPT_DEVICE_ENABLED ( TUD_OPT_RHPORT >= 0 )
+#define CFG_TUD_ENABLED ( TUD_OPT_RHPORT >= 0 )
+
+// For backward compatible
+#define TUSB_OPT_DEVICE_ENABLED CFG_TUD_ENABLED
 
 
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // COMMON OPTIONS
 // COMMON OPTIONS