Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update hpmicro port files #274

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion demo/video_static_h264_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,5 @@ void video_test(uint8_t busid)
}
}
}
}
}
}
11 changes: 8 additions & 3 deletions port/ehci/usb_glue_hpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ static void usb_host_mode_init(USB_Type *ptr)
/* Set parallel transceiver width */
ptr->PORTSC1 &= ~USB_PORTSC1_PTW_MASK;

#ifdef CONFIG_USB_HOST_FORCE_FULL_SPEED
/* Set usb forced to full speed mode */
ptr->PORTSC1 |= USB_PORTSC1_PFSC_MASK;
#endif

/* Not use interrupt threshold. */
ptr->USBCMD &= ~USB_USBCMD_ITC_MASK;
}
Expand All @@ -53,7 +58,7 @@ void usb_hc_low_level_init(struct usbh_bus *bus)
#endif
}

usb_phy_init((USB_Type *)(bus->hcd.reg_base));
usb_phy_init((USB_Type *)(bus->hcd.reg_base), true);
intc_m_enable_irq(_hcd_irqnum[bus->hcd.hcd_id]);
}

Expand Down Expand Up @@ -86,18 +91,18 @@ uint8_t usbh_get_port_speed(struct usbh_bus *bus, const uint8_t port)

extern void USBH_IRQHandler(uint8_t busid);

SDK_DECLARE_EXT_ISR_M(IRQn_USB0, isr_usbh0)
void isr_usbh0(void)
{
USBH_IRQHandler(_hcd_busid[0]);
}
SDK_DECLARE_EXT_ISR_M(IRQn_USB0, isr_usbh0)

#ifdef HPM_USB1_BASE
SDK_DECLARE_EXT_ISR_M(IRQn_USB1, isr_usbh1)
void isr_usbh1(void)
{
USBH_IRQHandler(_hcd_busid[1]);
}
SDK_DECLARE_EXT_ISR_M(IRQn_USB1, isr_usbh1)
#endif

#endif
6 changes: 2 additions & 4 deletions port/hpm/usb_dc_hpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ int usbd_set_remote_wakeup(uint8_t busid)
}

usb_force_port_resume(ptr);
while (ptr->PORTSC1 & USB_PORTSC1_FPR_MASK) {
}

return 0;
}
Expand Down Expand Up @@ -362,18 +360,18 @@ void USBD_IRQHandler(uint8_t busid)

#if !defined(USBD_USE_CUSTOM_ISR) || !USBD_USE_CUSTOM_ISR

SDK_DECLARE_EXT_ISR_M(IRQn_USB0, isr_usbd0)
void isr_usbd0(void)
{
USBD_IRQHandler(_dcd_busid[0]);
}
SDK_DECLARE_EXT_ISR_M(IRQn_USB0, isr_usbd0)

#ifdef HPM_USB1_BASE
SDK_DECLARE_EXT_ISR_M(IRQn_USB1, isr_usbd1)
void isr_usbd1(void)
{
USBD_IRQHandler(_dcd_busid[1]);
}
SDK_DECLARE_EXT_ISR_M(IRQn_USB1, isr_usbd1)
#endif

#endif