HCD: Fix multiple bugs

This commit fixes the following bugs with the HCD and USB Host HAL

- Make the setting to periodic frame list and scheduling to occur after
  a reset command
- All port errors states should put the port into the HCD_PORT_STATE_RECOVERY
  state.
- Fixed incorrect return type of hcd_port_command() function
This commit is contained in:
Darian Leung
2021-06-09 23:04:19 +08:00
parent 038a4db41e
commit 5f9692ae97
3 changed files with 17 additions and 7 deletions

View File

@@ -438,7 +438,7 @@ static inline uint32_t *usbh_hal_port_get_frame_list(usbh_hal_context_t *hal)
*/
static inline void usbh_hal_port_periodic_enable(usbh_hal_context_t *hal)
{
assert(hal->periodic_frame_list != NULL && !hal->flags.periodic_sched_enabled);
assert(hal->periodic_frame_list != NULL);
usbh_ll_set_frame_list_base_addr(hal->dev, (uint32_t)hal->periodic_frame_list);
usbh_ll_hcfg_set_num_frame_list_entries(hal->dev, hal->frame_list_len);
usbh_ll_hcfg_en_perio_sched(hal->dev);