准备换GD32 在调试USB时候
for (i = 0; i < num_channels; i++)
{
hcchar.d32 = USB_OTG_READ_REG32(&pdev->regs.HC_REGS[i]->HCCHAR);
hcchar.b.chen = 1;
hcchar.b.chdis = 1;
hcchar.b.epdir = 0;
USB_OTG_WRITE_REG32(&pdev->regs.HC_REGS[i]->HCCHAR, hcchar.d32);
do
{
USB_OTG_READ_REG32(&pdev->regs.GREGS->GRXSTSP);
hcchar.d32 = USB_OTG_READ_REG32(&pdev->regs.HC_REGS[i]->HCCHAR);
USB_OTG_BSP_uDelay (20);
}
while (hcchar.b.chen);
}
USB初始化就死在这个循环里了 |