summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-06-24 22:22:52 +0700
committerhathach <[email protected]>2022-06-24 22:52:11 +0700
commit0042eccb3b2ff0f980f3a927a271364a2089ada5 (patch)
treef1c970e2554ee084b17483921b6a8c9a5bbf0c7e /src
parent1d6918ce419b7df13def76759ba804c46ea8024c (diff)
fix redundant-decls warnings by usbd/usbh
Diffstat (limited to 'src')
-rw-r--r--src/class/msc/msc_device.c2
-rw-r--r--src/device/dcd.h7
-rw-r--r--src/device/usbd.c2
-rw-r--r--src/device/usbd.h5
-rw-r--r--src/device/usbd_control.c2
-rw-r--r--src/host/hub.c1
-rw-r--r--src/host/usbh.c3
-rw-r--r--src/host/usbh.h6
8 files changed, 13 insertions, 15 deletions
diff --git a/src/class/msc/msc_device.c b/src/class/msc/msc_device.c
index 33dd4ac37..00b0a1d06 100644
--- a/src/class/msc/msc_device.c
+++ b/src/class/msc/msc_device.c
@@ -28,9 +28,9 @@
#if (CFG_TUD_ENABLED && CFG_TUD_MSC)
+#include "device/dcd.h" // for faking dcd_event_xfer_complete
#include "device/usbd.h"
#include "device/usbd_pvt.h"
-#include "device/dcd.h" // for faking dcd_event_xfer_complete
#include "msc_device.h"
diff --git a/src/device/dcd.h b/src/device/dcd.h
index 6b99734fe..c1780f656 100644
--- a/src/device/dcd.h
+++ b/src/device/dcd.h
@@ -110,14 +110,7 @@ typedef struct TU_ATTR_ALIGNED(4)
void dcd_init (uint8_t rhport);
// Interrupt Handler
-#if __GNUC__ && !defined(__ARMCC_VERSION)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wredundant-decls"
-#endif
void dcd_int_handler(uint8_t rhport);
-#if __GNUC__ && !defined(__ARMCC_VERSION)
-#pragma GCC diagnostic pop
-#endif
// Enable device interrupt
void dcd_int_enable (uint8_t rhport);
diff --git a/src/device/usbd.c b/src/device/usbd.c
index fa894accc..b2053174e 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -28,12 +28,12 @@
#if CFG_TUD_ENABLED
+#include "device/dcd.h"
#include "tusb.h"
#include "common/tusb_private.h"
#include "device/usbd.h"
#include "device/usbd_pvt.h"
-#include "device/dcd.h"
//--------------------------------------------------------------------+
// USBD Configuration
diff --git a/src/device/usbd.h b/src/device/usbd.h
index 964cfb992..17b4d927b 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -58,8 +58,11 @@ void tud_task (void)
// Check if there is pending events need processing by tud_task()
bool tud_task_event_ready(void);
-// Interrupt handler, name alias to DCD
+#ifndef _TUSB_DCD_H_
extern void dcd_int_handler(uint8_t rhport);
+#endif
+
+// Interrupt handler, name alias to DCD
#define tud_int_handler dcd_int_handler
// Get current bus speed
diff --git a/src/device/usbd_control.c b/src/device/usbd_control.c
index 94a952df7..0995ef669 100644
--- a/src/device/usbd_control.c
+++ b/src/device/usbd_control.c
@@ -28,9 +28,9 @@
#if CFG_TUD_ENABLED
+#include "dcd.h"
#include "tusb.h"
#include "device/usbd_pvt.h"
-#include "dcd.h"
#if CFG_TUSB_DEBUG >= 2
extern void usbd_driver_print_control_complete_name(usbd_control_xfer_cb_t callback);
diff --git a/src/host/hub.c b/src/host/hub.c
index 5c0fd9166..3400b154a 100644
--- a/src/host/hub.c
+++ b/src/host/hub.c
@@ -28,6 +28,7 @@
#if (CFG_TUH_ENABLED && CFG_TUH_HUB)
+#include "hcd.h"
#include "usbh.h"
#include "usbh_classdriver.h"
#include "hub.h"
diff --git a/src/host/usbh.c b/src/host/usbh.c
index 4807d20b8..4c9b0b1ba 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -28,10 +28,9 @@
#if CFG_TUH_ENABLED
+#include "host/hcd.h"
#include "tusb.h"
#include "common/tusb_private.h"
-
-#include "host/usbh.h"
#include "host/usbh_classdriver.h"
#include "hub.h"
diff --git a/src/host/usbh.h b/src/host/usbh.h
index 347c75b8c..560a1ea23 100644
--- a/src/host/usbh.h
+++ b/src/host/usbh.h
@@ -32,7 +32,6 @@
#endif
#include "common/tusb_common.h"
-#include "hcd.h"
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
@@ -115,8 +114,11 @@ void tuh_task(void)
tuh_task_ext(UINT32_MAX, false);
}
-// Interrupt handler, name alias to HCD
+#ifndef _TUSB_HCD_H_
extern void hcd_int_handler(uint8_t rhport);
+#endif
+
+// Interrupt handler, name alias to HCD
#define tuh_int_handler hcd_int_handler
bool tuh_vid_pid_get(uint8_t daddr, uint16_t* vid, uint16_t* pid);