Skip to content

Commit 741cb3c

Browse files
committed
rename hcd_devtree_info_t to tuh_bus_info_t, hcd_devtree_get_info to hcd_bus_info_get
streamline bus info to usbh_devies, also replace dev0 (renamed to dev0_bus)
1 parent b632686 commit 741cb3c

File tree

15 files changed

+152
-126
lines changed

15 files changed

+152
-126
lines changed

.idea/debugServers/esp32s2.xml

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/debugServers/rp2350.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/debugServers/stm32f769.xml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/debugServers/stm32h563.xml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/debugServers/stm32h743.xml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/host/cdc_msc_hid/src/msc_app.c

+4-8
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@
3030
//--------------------------------------------------------------------+
3131
static scsi_inquiry_resp_t inquiry_resp;
3232

33-
bool inquiry_complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const * cb_data)
34-
{
33+
static bool inquiry_complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const * cb_data) {
3534
msc_cbw_t const* cbw = cb_data->cbw;
3635
msc_csw_t const* csw = cb_data->csw;
3736

38-
if (csw->status != 0)
39-
{
37+
if (csw->status != 0) {
4038
printf("Inquiry failed\r\n");
4139
return false;
4240
}
@@ -55,16 +53,14 @@ bool inquiry_complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const * cb_da
5553
}
5654

5755
//------------- IMPLEMENTATION -------------//
58-
void tuh_msc_mount_cb(uint8_t dev_addr)
59-
{
56+
void tuh_msc_mount_cb(uint8_t dev_addr) {
6057
printf("A MassStorage device is mounted\r\n");
6158

6259
uint8_t const lun = 0;
6360
tuh_msc_inquiry(dev_addr, lun, &inquiry_resp, inquiry_complete_cb, 0);
6461
}
6562

66-
void tuh_msc_umount_cb(uint8_t dev_addr)
67-
{
63+
void tuh_msc_umount_cb(uint8_t dev_addr) {
6864
(void) dev_addr;
6965
printf("A MassStorage device is unmounted\r\n");
7066
}

src/host/hcd.h

+4-8
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ typedef struct {
9595
uint8_t hub_addr;
9696
uint8_t hub_port;
9797
uint8_t speed;
98-
} hcd_devtree_info_t;
98+
} tuh_bus_info_t;
9999

100100
//--------------------------------------------------------------------+
101101
// Memory API
@@ -186,12 +186,8 @@ bool hcd_edpt_clear_stall(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr);
186186
// USBH implemented API
187187
//--------------------------------------------------------------------+
188188

189-
// Get device tree information of a device
190-
// USB device tree can be complicated and manged by USBH, this help HCD to retrieve
191-
// needed topology info to carry out its work
192-
extern void hcd_devtree_get_info(uint8_t dev_addr, hcd_devtree_info_t* devtree_info);
193-
194-
//------------- Event API -------------//
189+
// Get device port information
190+
extern bool hcd_bus_info_get(uint8_t daddr, tuh_bus_info_t* bus_info);
195191

196192
// Called by HCD to notify stack
197193
extern void hcd_event_handler(hcd_event_t const* event, bool in_isr);
@@ -239,4 +235,4 @@ void hcd_event_xfer_complete(uint8_t dev_addr, uint8_t ep_addr, uint32_t xferred
239235
}
240236
#endif
241237

242-
#endif /* _TUSB_HCD_H_ */
238+
#endif

0 commit comments

Comments
 (0)