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

kaidokert / rm32 / 25204537662
63%

Build:
DEFAULT BRANCH: main
Ran 01 May 2026 06:06AM 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 06:05AM UTC coverage: 62.057% (+0.8%) from 61.268%
25204537662

push

github

web-flow
Make DutyState fields fully private, extract ISR logic into methods (#29)

* Make DutyState fields fully private, extract ISR logic into methods

Move duty cycle logic from isr_logic.rs into DutyState methods:
- compute_setpoint() — throttle-to-setpoint mapping with startup clamp
- ramp_limit() — ramp rate limiting (was standalone function)
- clamp_ceilings() — stall boost + duty/current limit ceilings
- start_motor() — set last duty to min_startup on motor start
- finalize() — end-of-tick sync, returns cycle for PWM output

All 13 DutyState fields now private. isr_logic.rs no longer imports
DutyState or crate::functions::map — duty concern is fully owned by
DutyState.

* Extract PWM compare calculations into DutyState methods

Move inline duty→PWM math from isr_logic.rs into DutyState:
- pwm_compare(tim1_arr) — duty cycle to timer compare value
- brake_compare(drag_brake_strength, tim1_arr) — proportional brake output

ISR PWM output section now reads as control flow only, with math
owned by DutyState.

* Fix ramp profile: use average_interval not duty.last for RPM threshold

Pre-existing bug: ramp_limit used self.last > 500 (duty cycle) to
select between low/high RPM ramp rates. C code uses average_interval
> 500 (timing-based RPM indicator). The duty-based check could select
the wrong ramp rate when duty and RPM diverge.

Compute average_interval from e_com_time in the ISR and pass it to
ramp_limit. Add 4 unit tests for ramp profile selection that would
have caught this bug. Also fix compute_setpoint docstring.

* Extract magic numbers into named constants, use .min() for ceilings

Add 8 named constants to constants.rs for ramp and brake logic:
RAMP_VOLTAGE_LOW_MV, RAMP_VOLTAGE_HIGH_MV, RAMP_VOLTAGE_CHANGE_MAX,
RAMP_VOLTAGE_CHANGE_MIN, RAMP_FAST_COMMUTATION_THRESHOLD,
RAMP_STARTUP_THRESHOLD, RAMP_LOW_RPM_INTERVAL, BRAKE_STRENGTH_SCALE.

Simplify clamp_ceilings using .min() chain instead of sequential
if/assign.

122 of 146 new or added lines in 2 files covered. (83.56%)

3487 of 5619 relevant lines covered (62.06%)

769.21 hits per line

Uncovered Changes

Lines Coverage ∆ File
20
82.08
3.44% rm32/src/control/state.rs
4
75.62
3.77% rm32/src/control/isr_logic.rs
Jobs
ID Job ID Ran Files Coverage
1 25204537662.1 01 May 2026 06:06AM UTC 34
62.06
GitHub Action Run
Source Files on build 25204537662
  • Tree
  • List 34
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25204537662
  • 0f943606 on github
  • Prev Build on main (#25203213512)
  • Next Build on main (#25206113199)
  • 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