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

kaidokert / rm32 / 25196902395
63%

Build:
DEFAULT BRANCH: main
Ran 01 May 2026 12:53AM UTC
Jobs 1
Files 34
Run time 1min
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

01 May 2026 12:52AM UTC coverage: 62.721% (+1.2%) from 61.522%
25196902395

push

github

web-flow
Make Pid and PidState fields private, extract tick methods (#23)

* Make Pid fields private, add set_gains() method

Pid struct fields were pub(crate) but only accessed directly from
main_state.rs for gain updates and integral reset. Replace with:
- set_gains(kp, ki, kd) — updates gains and resets accumulated state
- reset() — already existed, now used instead of direct integral = 0

Also make Commutation::intervals private — only accessed via
record_interval() method.

* Make PidState fields fully private, extract tick methods

Move stall/current-limit/speed PID logic from MainState::tick() into
PidState methods: tick_stall(), tick_current_limit(), tick_speed_control().
All PidState fields are now private — access only through methods.

MainState::tick() PID section shrinks from 30 lines to 15, calling
3 methods that each return a value to publish to SharedComm.

* Add unit tests for PidState tick methods, mirroring C test_tenkhz.cpp

10 tests covering stall, current limit, and speed control PID ticks:
- current_limit_pid_reduces_ceiling_when_over_target (mirrors C test)
- current_limit_pid_clamps_to_min_duty
- current_limit_pid_resets_when_inactive
- stall_pid_boosts_when_interval_above_target (mirrors C test)
- stall_pid_clamps_to_150
- stall_pid_clamps_to_zero
- speed_control_inactive_returns_none
- speed_control_not_running_returns_none
- speed_control_active_returns_override
- speed_control_works_during_startup

* Fix 3 review issues: clear_integral, zc snapshot, target_e_com_time setter

- Add Pid::clear_integral() that only zeros integral (matching C
  behavior). Speed control was using reset() which also cleared
  derivative state — behavioral change from C.
- Pass captured zc snapshot to tick_speed_control instead of reading
  shared.zero_crosses() directly, which could change mid-tick via
  desync reset.
- Add PidState::set_target_e_com_time() — field was private with no
  setter, leaving speed PID target stuck at 0.

146 of 161 new or added lines in 4 files covered. (90.68%)

2 existing lines in 1 file now uncovered.

3338 of 5322 relevant lines covered (62.72%)

642.91 hits per line

Uncovered Changes

Lines Coverage ∆ File
10
70.68
4.11% rm32/src/main_state.rs
3
98.35
-1.65% rm32/src/control/state.rs
2
0.0
0.0% rm32/src/bin/harness.rs

Coverage Regressions

Lines Coverage ∆ File
2
70.68
4.11% rm32/src/main_state.rs
Jobs
ID Job ID Ran Files Coverage
1 25196902395.1 01 May 2026 12:53AM UTC 34
62.72
GitHub Action Run
Source Files on build 25196902395
  • Tree
  • List 34
  • Changed 5
  • Source Changed 5
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25196902395
  • c072bc11 on github
  • Prev Build on main (#25194441370)
  • Next Build on main (#25197859786)
  • 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