update: add USB_ASSERT_MSG for common case
Signed-off-by: sakumisu <1203593632@qq.com>
This commit is contained in:
@@ -266,11 +266,7 @@ int usb_dc_init(uint8_t busid)
|
||||
offset = usbd_musb_fifo_config(&cfg[i], offset);
|
||||
}
|
||||
|
||||
if (offset > usb_get_musb_ram_size()) {
|
||||
USB_LOG_ERR("offset:%d is overflow, please check your table\r\n", offset);
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
USB_ASSERT_MSG(offset <= usb_get_musb_ram_size(), "Your fifo config is overflow, please check");
|
||||
|
||||
/* Enable USB interrupts */
|
||||
HWREGB(USB_BASE + MUSB_IE_OFFSET) = USB_IE_RESET | USB_IE_SUSPND | USB_IE_RESUME;
|
||||
|
||||
@@ -504,11 +504,7 @@ int usb_hc_init(struct usbh_bus *bus)
|
||||
offset = usbh_musb_fifo_config(bus, &cfg[i], offset);
|
||||
}
|
||||
|
||||
if (offset > usb_get_musb_ram_size()) {
|
||||
USB_LOG_ERR("offset:%d is overflow, please check your table\r\n", offset);
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
USB_ASSERT_MSG(offset <= usb_get_musb_ram_size(), "Your fifo config is overflow, please check");
|
||||
|
||||
/* Enable USB interrupts */
|
||||
regval = USB_IE_RESET | USB_IE_CONN | USB_IE_DISCON |
|
||||
|
||||
Reference in New Issue
Block a user