Skip to content

hostmot2: fix input bounds, divisors and PWM clamping - #4661

Open
sleepybishop wants to merge 11 commits into
LinuxCNC:masterfrom
sleepybishop:hostmot-fixes
Open

sleepybishop wants to merge 11 commits into
LinuxCNC:masterfrom
sleepybishop:hostmot-fixes

Conversation

@sleepybishop

@sleepybishop sleepybishop commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Split from #4488 as requested. Adds UART/BSPI input and LLIO checks, guards scan-rate and resolver divisors, bounds connector-name access, and fixes RPi3 SPI speed decoding and negative B/C PWM clamping. Existing successful API returns and UART/BSPI -1 errors are preserved.

Includes reproducible UART/BSPI mock tests. Local build, regression, sanitizer, static-analysis and man-page checks pass; hardware coverage remains incomplete. Keeping this draft for review.

Use integer ceiling when storing clamped scan rates so the following cycle cannot calculate an out-of-range divisor again. Keep the existing control flow and divisor limit.

Test startup and runtime clamps, unchanged valid rates, and repeated cycles across all scan widths with three clock frequencies.
@sleepybishop
sleepybishop marked this pull request as ready for review October 10, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant