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

kaidokert / rm32-private / 25646879046 / 1
65%
tmps: 63%

Build:
Build:
LAST BUILD BRANCH: bisect_init_changes
DEFAULT BRANCH: tmps
Ran 11 May 2026 02:19AM UTC
Files 34
Run time 1s
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

11 May 2026 02:18AM UTC coverage: 65.632% (+0.09%) from 65.538%
25646879046.1

push

github

kaidokert
Fix DShot detection regression: wrap, stale buf[0], premature PSC switch

After merging private/priv_bringup (which added "protocol re-confirmation"
requiring 2 consecutive matching detections in transfer.rs and an unarmed
signal_timeout that resets input_set after 2s without input), DShot300
detection broke entirely on real hardware — `proto=none` forever, motor
stuck Disarmed.

Three independent bugs masked the breakage from unit tests:

1. signal::detect_input — u32-width subtraction across TIM wrap
   TIM15 is a 16-bit counter; subtracting consecutive samples at u32
   width when the timer wraps from 65535→0 produced a billion-sized
   delta, poisoning average_pulse so both DShot300 (`< 100`) and
   DShot600 (`< 60`) average checks always failed. The fix subtracts at
   u16 width so the wrap yields the actual elapsed ticks.

2. signal::detect_input — stale buf[0] from TIM/DMA circular buffer
   On L431, buf[0] lingers as the last edge of the previous burst
   (observed value ~11385 across frames), so the buf[0]→buf[1] delta
   is an inter-frame gap, not a bit pulse. Including it in the average
   blew it past the threshold every time. Skip the first slot.

3. transfer::process — premature prescaler switch
   The detection block returned the post-detection fast CaptureConfig
   (DSHOT300_DETECTED with PSC=1) on a *single* tentative detection,
   before the 2-in-a-row confirmation gate ran. PSC dropped to 1, the
   next frame's deltas were 47/87 ticks (way past the heuristic's
   `smallest 1-8` range), detection failed permanently. Added
   CaptureConfig::dshot_detection(cpu_mhz) (PSC=cpu_mhz/6, slow enough
   that DShot300 "0" pulse = ~7 ticks) and now use it whenever
   detection is unconfirmed.

New regression tests in signal::tests:
- detect_dshot300_across_timer_wrap / detect_dshot600_across_timer_wrap
  cover bug #1 (16-bit wrap)
- detect_dshot300_with_stale_buf0 uses the EXACT failing buffer values
  captured from the bench log (`buf[0]=11385... (continued)

3955 of 6026 relevant lines covered (65.63%)

802.3 hits per line

Source Files on job 25646879046.1
  • Tree
  • List 34
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 25646879046
  • f3dc44c7 on github
  • Prev Job for on priv_bringup (#25641458905.1)
  • Next Job for on priv_bringup (#25647031895.1)
  • Delete
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