Skip to content

Commit

Permalink
revert usbd driver name change to be backward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Apr 8, 2024
1 parent 4bc6a5f commit be25a3f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/device/usbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ tu_static usbd_device_t _usbd_dev;
// Class Driver
//--------------------------------------------------------------------+
#if CFG_TUSB_DEBUG >= CFG_TUD_LOG_LEVEL
#define DRIVER_NAME(_name) _name
#define DRIVER_NAME(_name) .name = _name,
#else
#define DRIVER_NAME(_name) NULL
#define DRIVER_NAME(_name)
#endif

// Built-in class drivers
tu_static usbd_class_driver_t const _usbd_driver[] = {
#if CFG_TUD_CDC
{
.name = DRIVER_NAME("CDC"),
DRIVER_NAME("CDC")
.init = cdcd_init,
.deinit = cdcd_deinit,
.reset = cdcd_reset,
Expand All @@ -112,7 +112,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_MSC
{
.name = DRIVER_NAME("MSC"),
DRIVER_NAME("MSC")
.init = mscd_init,
.deinit = NULL,
.reset = mscd_reset,
Expand All @@ -125,7 +125,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_HID
{
.name = DRIVER_NAME("HID"),
DRIVER_NAME("HID")
.init = hidd_init,
.deinit = hidd_deinit,
.reset = hidd_reset,
Expand All @@ -138,7 +138,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_AUDIO
{
.name = DRIVER_NAME("AUDIO"),
DRIVER_NAME("AUDIO")
.init = audiod_init,
.deinit = audiod_deinit,
.reset = audiod_reset,
Expand All @@ -151,7 +151,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_VIDEO
{
.name = DRIVER_NAME("VIDEO"),
DRIVER_NAME("VIDEO")
.init = videod_init,
.deinit = videod_deinit,
.reset = videod_reset,
Expand All @@ -164,7 +164,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_MIDI
{
.name = DRIVER_NAME("MIDI"),
DRIVER_NAME("MIDI")
.init = midid_init,
.deinit = midid_deinit,
.open = midid_open,
Expand All @@ -177,7 +177,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_VENDOR
{
.name = DRIVER_NAME("VENDOR"),
DRIVER_NAME("VENDOR")
.init = vendord_init,
.deinit = vendord_deinit,
.reset = vendord_reset,
Expand All @@ -190,7 +190,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_USBTMC
{
.name = DRIVER_NAME("TMC"),
DRIVER_NAME("TMC")
.init = usbtmcd_init_cb,
.deinit = usbtmcd_deinit,
.reset = usbtmcd_reset_cb,
Expand All @@ -203,7 +203,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_DFU_RUNTIME
{
.name = DRIVER_NAME("DFU-RUNTIME"),
DRIVER_NAME("DFU-RUNTIME")
.init = dfu_rtd_init,
.deinit = dfu_rtd_deinit,
.reset = dfu_rtd_reset,
Expand All @@ -216,7 +216,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_DFU
{
.name = DRIVER_NAME("DFU"),
DRIVER_NAME("DFU")
.init = dfu_moded_init,
.deinit = dfu_moded_deinit,
.reset = dfu_moded_reset,
Expand All @@ -229,7 +229,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_ECM_RNDIS || CFG_TUD_NCM
{
.name = DRIVER_NAME("NET"),
DRIVER_NAME("NET")
.init = netd_init,
.deinit = netd_deinit,
.reset = netd_reset,
Expand All @@ -242,7 +242,7 @@ tu_static usbd_class_driver_t const _usbd_driver[] = {

#if CFG_TUD_BTH
{
.name = DRIVER_NAME("BTH"),
DRIVER_NAME("BTH")
.init = btd_init,
.deinit = btd_deinit,
.reset = btd_reset,
Expand Down
3 changes: 3 additions & 0 deletions src/device/usbd_pvt.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
//--------------------------------------------------------------------+

typedef struct {
#if CFG_TUSB_DEBUG >= CFG_TUD_LOG_LEVEL
char const* name;
#endif

void (* init ) (void);
bool (* deinit ) (void);
void (* reset ) (uint8_t rhport);
Expand Down

0 comments on commit be25a3f

Please sign in to comment.