diff options
| author | hathach <[email protected]> | 2022-06-02 16:51:17 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2022-06-02 16:51:17 +0700 |
| commit | 8b9cf152a0dedda573fb3374d8c873dce4b883d1 (patch) | |
| tree | 1e6236685627b6fdd960e70da54e89aa37fe9fb1 /src/class/hid | |
| parent | 99c1585ed215cb5ee2e27a41c54310d144e0ee6c (diff) | |
rhport argument in usbd_ API() is not used (always use the initialized port)
remove the usage of TUD_OPT_RHPORT in class driver
Diffstat (limited to 'src/class/hid')
| -rw-r--r-- | src/class/hid/hid_device.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c index 562ca7f36..cdf155e1c 100644 --- a/src/class/hid/hid_device.c +++ b/src/class/hid/hid_device.c @@ -76,8 +76,9 @@ static inline uint8_t get_index_by_itfnum(uint8_t itf_num) //--------------------------------------------------------------------+ bool tud_hid_n_ready(uint8_t instance) { + uint8_t const rhport = 0; uint8_t const ep_in = _hidd_itf[instance].ep_in; - return tud_ready() && (ep_in != 0) && !usbd_edpt_busy(TUD_OPT_RHPORT, ep_in); + return tud_ready() && (ep_in != 0) && !usbd_edpt_busy(rhport, ep_in); } bool tud_hid_n_report(uint8_t instance, uint8_t report_id, void const* report, uint8_t len) @@ -103,7 +104,7 @@ bool tud_hid_n_report(uint8_t instance, uint8_t report_id, void const* report, u memcpy(p_hid->epin_buf, report, len); } - return usbd_edpt_xfer(TUD_OPT_RHPORT, p_hid->ep_in, p_hid->epin_buf, len); + return usbd_edpt_xfer(rhport, p_hid->ep_in, p_hid->epin_buf, len); } uint8_t tud_hid_n_interface_protocol(uint8_t instance) @@ -172,7 +173,7 @@ bool tud_hid_n_gamepad_report(uint8_t instance, uint8_t report_id, //--------------------------------------------------------------------+ void hidd_init(void) { - hidd_reset(TUD_OPT_RHPORT); + hidd_reset(0); } void hidd_reset(uint8_t rhport) |
