diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2011-05-04 13:15:33 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2011-05-04 13:31:53 -0400 |
commit | f3bcdd18d8f0b64cd8f17410b480b49315791544 (patch) | |
tree | 9bdcdcbd5aa976c0a407d0cbcb1316d824ab40a3 /libmaple/usb/usb.c | |
parent | 9ad170c63ddac17301566e69fe6a0e7a8d0d4639 (diff) | |
download | librambutan-f3bcdd18d8f0b64cd8f17410b480b49315791544.tar.gz librambutan-f3bcdd18d8f0b64cd8f17410b480b49315791544.zip |
SerialUSB fixups.
Diffstat (limited to 'libmaple/usb/usb.c')
-rw-r--r-- | libmaple/usb/usb.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libmaple/usb/usb.c b/libmaple/usb/usb.c index 7b1dd4c..b34c4b6 100644 --- a/libmaple/usb/usb.c +++ b/libmaple/usb/usb.c @@ -343,23 +343,21 @@ void usbBlockingSendByte(char ch) { countTx = 1; while (countTx); } -uint32 usbSendBytes(uint8* sendBuf, uint32 len) { - /* any checks on connection (via dtr/rts) done upstream in wirish or - by user */ - /* last xmit hasnt finished, abort */ +uint32 usbSendBytes(const uint8* sendBuf, uint32 len) { + /* Last transmission hasn't finished, abort */ if (countTx) { return 0; } // We can only put VCOM_TX_EPSIZE bytes in the buffer - if(len > VCOM_TX_EPSIZE/2) { - len = VCOM_TX_EPSIZE/2; + if (len > VCOM_TX_EPSIZE / 2) { + len = VCOM_TX_EPSIZE / 2; } // Try to load some bytes if we can if (len) { - UserToPMABufferCopy(sendBuf,VCOM_TX_ADDR, len); + UserToPMABufferCopy(sendBuf, VCOM_TX_ADDR, len); _SetEPTxCount(VCOM_TX_ENDP, len); countTx += len; _SetEPTxValid(VCOM_TX_ENDP); |