summaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-08-23 11:01:40 +0700
committerhathach <[email protected]>2021-08-23 11:01:40 +0700
commit6a16f6ccddf77e1b0232aec0c89d2105e391b297 (patch)
treebca6923d530ac38e2546613515cdc524ee05b65d /src/host
parent800f85329ea21bdefc778c246c8098dea12fb402 (diff)
rename CFG_TUSB_HOST_DEVICE_MAX to CFG_TUH_DEVICE_MAX
Diffstat (limited to 'src/host')
-rw-r--r--src/host/hcd.h2
-rw-r--r--src/host/hub.c4
-rw-r--r--src/host/usbh.c14
-rw-r--r--src/host/usbh_hcd.h2
4 files changed, 11 insertions, 11 deletions
diff --git a/src/host/hcd.h b/src/host/hcd.h
index 7a9aadc73..62ff8b3f2 100644
--- a/src/host/hcd.h
+++ b/src/host/hcd.h
@@ -84,7 +84,7 @@ typedef struct
// Max number of endpoints per device
enum {
// TODO better computation
- HCD_MAX_ENDPOINT = CFG_TUSB_HOST_DEVICE_MAX*(CFG_TUH_HUB + CFG_TUH_HID*2 + CFG_TUH_MSC*2 + CFG_TUH_CDC*3),
+ HCD_MAX_ENDPOINT = CFG_TUH_DEVICE_MAX*(CFG_TUH_HUB + CFG_TUH_HID*2 + CFG_TUH_MSC*2 + CFG_TUH_CDC*3),
HCD_MAX_XFER = HCD_MAX_ENDPOINT*2,
};
diff --git a/src/host/hub.c b/src/host/hub.c
index 00dce4e65..d685c6529 100644
--- a/src/host/hub.c
+++ b/src/host/hub.c
@@ -45,7 +45,7 @@ typedef struct
hub_port_status_response_t port_status;
} hub_interface_t;
-CFG_TUSB_MEM_SECTION static hub_interface_t hub_data[CFG_TUSB_HOST_DEVICE_MAX];
+CFG_TUSB_MEM_SECTION static hub_interface_t hub_data[CFG_TUH_DEVICE_MAX];
TU_ATTR_ALIGNED(4) CFG_TUSB_MEM_SECTION static uint8_t _hub_buffer[sizeof(descriptor_hub_desc_t)];
#if CFG_TUSB_DEBUG
@@ -144,7 +144,7 @@ bool hub_port_get_status(uint8_t hub_addr, uint8_t hub_port, void* resp, tuh_con
//--------------------------------------------------------------------+
void hub_init(void)
{
- tu_memclr(hub_data, CFG_TUSB_HOST_DEVICE_MAX*sizeof(hub_interface_t));
+ tu_memclr(hub_data, CFG_TUH_DEVICE_MAX*sizeof(hub_interface_t));
}
bool hub_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *itf_desc, uint16_t max_len)
diff --git a/src/host/usbh.c b/src/host/usbh.c
index 40c23a69d..98132a8c0 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -129,7 +129,7 @@ enum { CONFIG_NUM = 1 }; // default to use configuration 1
static bool _usbh_initialized = false;
// including zero-address
-CFG_TUSB_MEM_SECTION usbh_device_t _usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1];
+CFG_TUSB_MEM_SECTION usbh_device_t _usbh_devices[CFG_TUH_DEVICE_MAX+1];
// Event queue
// role device/host is used by OS NONE for mutex (disable usb isr)
@@ -156,7 +156,7 @@ bool tuh_device_configured(uint8_t dev_addr)
tusb_speed_t tuh_device_get_speed (uint8_t const dev_addr)
{
- TU_ASSERT( dev_addr <= CFG_TUSB_HOST_DEVICE_MAX, TUSB_SPEED_INVALID);
+ TU_ASSERT( dev_addr <= CFG_TUH_DEVICE_MAX, TUSB_SPEED_INVALID);
return (tusb_speed_t) _usbh_devices[dev_addr].speed;
}
@@ -193,7 +193,7 @@ bool tuh_init(uint8_t rhport)
TU_ASSERT(_usbh_q != NULL);
//------------- Semaphore, Mutex for Control Pipe -------------//
- for(uint8_t i=0; i<CFG_TUSB_HOST_DEVICE_MAX+1; i++) // including address zero
+ for(uint8_t i=0; i<CFG_TUH_DEVICE_MAX+1; i++) // including address zero
{
usbh_device_t * const dev = &_usbh_devices[i];
@@ -387,7 +387,7 @@ void hcd_event_device_remove(uint8_t hostid, bool in_isr)
void process_device_unplugged(uint8_t rhport, uint8_t hub_addr, uint8_t hub_port)
{
//------------- find the all devices (star-network) under port that is unplugged -------------//
- for (uint8_t dev_addr = 0; dev_addr <= CFG_TUSB_HOST_DEVICE_MAX; dev_addr ++)
+ for (uint8_t dev_addr = 0; dev_addr <= CFG_TUH_DEVICE_MAX; dev_addr ++)
{
usbh_device_t* dev = &_usbh_devices[dev_addr];
@@ -422,11 +422,11 @@ void process_device_unplugged(uint8_t rhport, uint8_t hub_addr, uint8_t hub_port
//--------------------------------------------------------------------+
static uint8_t get_new_address(void)
{
- for (uint8_t addr=1; addr <= CFG_TUSB_HOST_DEVICE_MAX; addr++)
+ for (uint8_t addr=1; addr <= CFG_TUH_DEVICE_MAX; addr++)
{
if (_usbh_devices[addr].state == TUSB_DEVICE_STATE_UNPLUG) return addr;
}
- return CFG_TUSB_HOST_DEVICE_MAX+1;
+ return CFG_TUH_DEVICE_MAX+1;
}
void usbh_driver_set_config_complete(uint8_t dev_addr, uint8_t itf_num)
@@ -548,7 +548,7 @@ static bool enum_request_set_addr(void)
{
// Set Address
uint8_t const new_addr = get_new_address();
- TU_ASSERT(new_addr <= CFG_TUSB_HOST_DEVICE_MAX); // TODO notify application we reach max devices
+ TU_ASSERT(new_addr <= CFG_TUH_DEVICE_MAX); // TODO notify application we reach max devices
TU_LOG2("Set Address = %d\r\n", new_addr);
diff --git a/src/host/usbh_hcd.h b/src/host/usbh_hcd.h
index 450b3e447..9f8d3407d 100644
--- a/src/host/usbh_hcd.h
+++ b/src/host/usbh_hcd.h
@@ -95,7 +95,7 @@ typedef struct {
} usbh_device_t;
-extern usbh_device_t _usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1]; // including zero-address
+extern usbh_device_t _usbh_devices[CFG_TUH_DEVICE_MAX+1]; // including zero-address
#ifdef __cplusplus
}