diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-24 12:23:03 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-24 12:23:03 +0000 |
commit | 2f8beb8d88ff98025b87e4a1aac350096d5ed6ac (patch) | |
tree | ea26902a37806b43c38e8d18698910053fb8cf8b | |
parent | a82d7ef29d80070323e1a2eec1451b6c6558ceb9 (diff) | |
download | micropython-2f8beb8d88ff98025b87e4a1aac350096d5ed6ac.tar.gz micropython-2f8beb8d88ff98025b87e4a1aac350096d5ed6ac.zip |
stmhal: Fix bug with USB CDC transmit buffer wrap around.
-rw-r--r-- | stmhal/usbd_cdc_interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stmhal/usbd_cdc_interface.c b/stmhal/usbd_cdc_interface.c index a62f8a801f..c441e9c61c 100644 --- a/stmhal/usbd_cdc_interface.c +++ b/stmhal/usbd_cdc_interface.c @@ -363,7 +363,7 @@ void USBD_CDC_SetInterrupt(int chr, void *data) { void USBD_CDC_Tx(const char *str, uint32_t len) { for (int i = 0; i < len; i++) { uint timeout = 200; - while (UserTxBufPtrIn + 1 == UserTxBufPtrOut) { + while (((UserTxBufPtrIn + 1) & (APP_TX_DATA_SIZE - 1)) == UserTxBufPtrOut) { if (timeout-- == 0) { break; } |