• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

micropython / micropython / 13890
98%

Build:
DEFAULT BRANCH: master
Ran 29 Jun 2020 07:38AM UTC
Jobs 1
Files 274
Run time 54s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
13890

push

travis-ci-com

dpgeorge
stm32/usbd_cdc_interface: Remove full==size-1 limitation on tx ringbuf.

Before this commit the USB VCP TX ring-buffer used the basic implementation
where it can only be filled to a maximum of buffer size-1.  For a 1024 size
buffer this means the largest packet that can be sent is 1023.  Once a
packet of this size is sent the next byte copied in goes to the final byte
in the buffer, so must be sent as a 1 byte packet before the read pointer
can be wrapped around to the beginning.  So in large streaming transfers,
watching the USB sniffer you basically get alternating 1023 byte packets
then 1 byte packets.

This commit changes the ring-buffer implementation to a scheme that doesn't
have the full-size limitation, and the USB VCP driver can now achieve a
constant stream of full-sized packets.  This scheme introduces a
restriction on the size of the buffer: it must be a power of 2, and the
maximum size is half of the size of the index (in this case the index is
16-bit, so the maximum size would be 32767 bytes rounded to 16384 for a
power-of-2).  But this is not a big limitation because the size of the
ring-buffer prior to this commit was restricted to powers of 2 because it
was using a mask-based method to wrap the indices.

For an explanation of the new scheme see
https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/

The RX buffer could likely do with a similar change, though as it's not
read from in chunks like the TX buffer it doesn't present the same issue,
all that's lost is one byte capacity of the buffer.

USB VCP TX throughput is improved by this change, potentially doubling the
speed in certain cases.

19470 of 19863 relevant lines covered (98.02%)

424094.8 hits per line

Jobs
ID Job ID Ran Files Coverage
5 13890.5 (MAKEOPTS="-j4") 29 Jun 2020 07:38AM UTC 0
98.02
Travis Job 13890.5
Source Files on build 13890
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #13890
  • e4fcd216 on github
  • Prev Build on master (#13861)
  • Next Build on master (#13892)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc