summaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-06-27 22:27:24 +0700
committerGitHub <[email protected]>2022-06-27 22:27:24 +0700
commit3ead682af05bee3a275125f3e0384dd9b2882546 (patch)
tree9f5f38d56a120446637c20f3bb749f1a40251f85 /src/host
parentbc0f5502e283938f8172e193eb604483640822ab (diff)
parent25580b4fe9acd1d9f9f12cbfdd29037669376a8d (diff)
Merge pull request #1534 from hathach/add-more-warnings
Add more warnings
Diffstat (limited to 'src/host')
-rw-r--r--src/host/hub.c1
-rw-r--r--src/host/usbh.c9
-rw-r--r--src/host/usbh.h6
3 files changed, 9 insertions, 7 deletions
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..b6a03b82e 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"
@@ -666,7 +665,7 @@ static bool usbh_control_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result
TU_LOG2_MEM(_ctrl_xfer.buffer, xferred_bytes, 2);
}
- _ctrl_xfer.actual_len = xferred_bytes;
+ _ctrl_xfer.actual_len = (uint16_t) xferred_bytes;
// ACK stage: toggle is always 1
_set_control_xfer_stage(CONTROL_STAGE_ACK);
@@ -697,7 +696,7 @@ bool tuh_edpt_xfer(tuh_xfer_t* xfer)
TU_VERIFY(usbh_edpt_claim(daddr, ep_addr));
- if ( !usbh_edpt_xfer_with_callback(daddr, ep_addr, xfer->buffer, xfer->buflen, xfer->complete_cb, xfer->user_data) )
+ if ( !usbh_edpt_xfer_with_callback(daddr, ep_addr, xfer->buffer, (uint16_t) xfer->buflen, xfer->complete_cb, xfer->user_data) )
{
usbh_edpt_release(daddr, ep_addr);
return false;
@@ -1526,7 +1525,7 @@ static bool _parse_configuration_descriptor(uint8_t dev_addr, tusb_desc_configur
}
#endif
- uint16_t const drv_len = tu_desc_get_interface_total_len(desc_itf, assoc_itf_count, desc_end-p_desc);
+ uint16_t const drv_len = tu_desc_get_interface_total_len(desc_itf, assoc_itf_count, (uint16_t) (desc_end-p_desc));
TU_ASSERT(drv_len >= sizeof(tusb_desc_interface_t));
// Find driver for this interface
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);