USB_OTG_Status OTGD_FS_WritePacket(uint8_t *src, uint8_t ch_ep_num, uint16_t bytes)
{
USB_OTG_Status status = USB_OTG_OK;
uint32_t dword_count , i;
__IO uint32_t *fifo;
/* Find the DWORD length, padded by extra bytes as neccessary if MPS
* is not a multiple of DWORD */
dword_count = (bytes + 3) / 4;
fifo = core_regs.data_fifo[ch_ep_num];
for (i = 0; i < dword_count; i++, src += 4)
{
WRITE_REG32( fifo, *((__packed uint32_t *)src) );
}
return status;
执行以上函数,PC读取数据失败,会是什么原因造成的? |