|
17 | 17 | #include "esp_err.h" |
18 | 18 | #include "esp_log.h" |
19 | 19 |
|
20 | | -#include "soc/soc_caps.h" |
21 | 20 | #include "hal/usb_dwc_hal.h" |
22 | 21 | #include "hcd.h" |
23 | 22 | #include "usb_private.h" |
|
51 | 50 | #define CTRL_EP_MAX_MPS_LS 8 // Largest Maximum Packet Size for Low Speed control endpoints |
52 | 51 | #define CTRL_EP_MAX_MPS_HSFS 64 // Largest Maximum Packet Size for High & Full Speed control endpoints |
53 | 52 |
|
54 | | -#define NUM_PORTS SOC_USB_OTG_PERIPH_NUM // Each peripheral is a root port |
55 | | - |
56 | 53 | // ----------------------- Configs ------------------------- |
57 | 54 |
|
58 | 55 | #ifdef CONFIG_USB_HOST_DWC_DMA_CAP_MEMORY_IN_PSRAM // In esp32p4, the USB-DWC internal DMA can access external RAM |
@@ -269,7 +266,7 @@ struct port_obj { |
269 | 266 |
|
270 | 267 | // With s_port_inited[] we can check if a port has been initialized -> to provide singleton handle for each root port |
271 | 268 | // Each peripheral is a root port |
272 | | -static bool s_port_inited[NUM_PORTS] = {0}; |
| 269 | +static bool s_port_inited[HCD_NUM_PORTS] = {0}; |
273 | 270 |
|
274 | 271 | // ------------------------------------------------- Forward Declare --------------------------------------------------- |
275 | 272 |
|
@@ -1447,7 +1444,7 @@ static esp_err_t _port_cmd_disable(port_t *port) |
1447 | 1444 | esp_err_t hcd_port_init(int port_number, const hcd_port_config_t *port_config, hcd_port_handle_t *port_hdl) |
1448 | 1445 | { |
1449 | 1446 | HCD_CHECK(port_number >= 0 && port_config != NULL && port_hdl != NULL, ESP_ERR_INVALID_ARG); |
1450 | | - HCD_CHECK(port_number < NUM_PORTS, ESP_ERR_NOT_FOUND); |
| 1447 | + HCD_CHECK(port_number < HCD_NUM_PORTS, ESP_ERR_NOT_FOUND); |
1451 | 1448 |
|
1452 | 1449 | HCD_ENTER_CRITICAL(); |
1453 | 1450 | HCD_CHECK_FROM_CRIT(!s_port_inited[port_number], ESP_ERR_INVALID_STATE); |
|
0 commit comments