diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-03-05 23:04:18 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-03-05 23:04:18 +0000 |
commit | 94dc3e48cdeb2d27bcf3300c9dbe63c9f3735b4e (patch) | |
tree | 75fe261fa95dfe5ac82d52201c289d34a510bdc1 /nuttx/arch | |
parent | eb43744cfe8bedafb50361a869479a5574ea38fe (diff) | |
download | px4-firmware-94dc3e48cdeb2d27bcf3300c9dbe63c9f3735b4e.tar.gz px4-firmware-94dc3e48cdeb2d27bcf3300c9dbe63c9f3735b4e.tar.bz2 px4-firmware-94dc3e48cdeb2d27bcf3300c9dbe63c9f3735b4e.zip |
Minor update to PIC32 USB device driver
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4455 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch')
-rw-r--r-- | nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c b/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c index ac6d7d056..4bd1188f7 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c @@ -265,7 +265,11 @@ #endif /* 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 # undef CONFIG_PIC32MX_USBDEV_BDTDEBUG @@ -287,6 +291,8 @@ #endif +/* CONFIG_PIC32MX_USBDEV_BDTDEBUG dumps most BDT settings */ + #ifdef CONFIG_PIC32MX_USBDEV_BDTDEBUG # 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; /* 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 * progress. @@ -1064,12 +1070,14 @@ static int pic32mx_rdcomplete(struct pic32mx_usbdev_s *priv, 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; - /* If the receive buffer is full or this is a partial packet, - * then we are finished with the transfer + /* If the receive buffer is full or this is a partial packet, then we are + * finished with the transfer. */ privreq->req.xfrd += readlen; |