mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
Minor update to PIC32 USB device driver
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4455 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -265,6 +265,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Debug ********************************************************************/
|
/* Debug ********************************************************************/
|
||||||
|
/* CONFIG_PIC32MX_USBDEV_REGDEBUG enables dumping of all low-level register
|
||||||
|
* access and BDT accesses. Normally, this generates so much debug output
|
||||||
|
* that USB may not even be functional.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_PIC32MX_USBDEV_REGDEBUG
|
#ifdef CONFIG_PIC32MX_USBDEV_REGDEBUG
|
||||||
|
|
||||||
@@ -287,6 +291,8 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* CONFIG_PIC32MX_USBDEV_BDTDEBUG dumps most BDT settings */
|
||||||
|
|
||||||
#ifdef CONFIG_PIC32MX_USBDEV_BDTDEBUG
|
#ifdef CONFIG_PIC32MX_USBDEV_BDTDEBUG
|
||||||
|
|
||||||
# define bdtdbg lldbg
|
# define bdtdbg lldbg
|
||||||
@@ -1003,13 +1009,13 @@ static int pic32mx_wrrequest(struct pic32mx_usbdev_s *priv, struct pic32mx_ep_s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send the packet (might be a null packet nbytes == 0) */
|
/* Send the packet (might be a null packet with nbytes == 0) */
|
||||||
|
|
||||||
buf = privreq->req.buf + privreq->req.xfrd;
|
buf = privreq->req.buf + privreq->req.xfrd;
|
||||||
|
|
||||||
/* Setup the writes to the endpoints */
|
/* Setup the writes to the endpoints */
|
||||||
|
|
||||||
pic32mx_epwrite(privep, privep->bdtin, buf, nbytes);
|
pic32mx_epwrite(privep, bdt, buf, nbytes);
|
||||||
|
|
||||||
/* Special case endpoint 0 state information. The write request is in
|
/* Special case endpoint 0 state information. The write request is in
|
||||||
* progress.
|
* progress.
|
||||||
@@ -1064,12 +1070,14 @@ static int pic32mx_rdcomplete(struct pic32mx_usbdev_s *priv,
|
|||||||
|
|
||||||
DEBUGASSERT((bdtout->status & USB_BDT_UOWN) == USB_BDT_COWN);
|
DEBUGASSERT((bdtout->status & USB_BDT_UOWN) == USB_BDT_COWN);
|
||||||
|
|
||||||
/* Get the length of the data received from the BDT */
|
/* Get the length of the data received from the BDT. Add that to the
|
||||||
|
* total number of bytes transferred.
|
||||||
|
*/
|
||||||
|
|
||||||
readlen = (bdtout->status & USB_BDT_BYTECOUNT_MASK) >> USB_BDT_BYTECOUNT_SHIFT;
|
readlen = (bdtout->status & USB_BDT_BYTECOUNT_MASK) >> USB_BDT_BYTECOUNT_SHIFT;
|
||||||
|
|
||||||
/* If the receive buffer is full or this is a partial packet,
|
/* If the receive buffer is full or this is a partial packet, then we are
|
||||||
* then we are finished with the transfer
|
* finished with the transfer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
privreq->req.xfrd += readlen;
|
privreq->req.xfrd += readlen;
|
||||||
|
|||||||
Reference in New Issue
Block a user