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

micropython / micropython / 13890 / 5
98%
master: 98%

Build:
DEFAULT BRANCH: master
Ran 29 Jun 2020 07:38AM UTC
Files 274
Run time 45s
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

29 Jun 2020 07:21AM UTC coverage: 98.021%. Remained the same
MAKEOPTS="-j4"

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

Source Files on job 13890.5 (MAKEOPTS="-j4")
  • Tree
  • List 0
  • Changed 53
  • Source Changed 0
  • Coverage Changed 53
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 13461
  • Travis Job 13890.5
  • e4fcd216 on github
  • Prev Job for MAKEOPTS="-j4" on master (#13861.5)
  • Next Job for MAKEOPTS="-j4" on master (#13892.5)
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