-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/self tests #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
src/chassis_fans.rs
Outdated
// If 5 fans (the count mounted on the chassis) spun up to a nominal high speed RPM, 5-6 | ||
// fans were at a nominal low RPM, and 6 fans were not spinning when powered down, fans are | ||
// operating nominally. | ||
(fans_spun_high == 5) && (fans_spun_low >= 6) && (fans_powered_down == 6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading the comment:
(fans_spun_high == 5) && (fans_spun_low >= 6) && (fans_powered_down == 6) | |
(fans_spun_high == 5) && (fans_spun_low >= 5) && (fans_powered_down == 6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated it such that low spinup requires a non-zero RPM and have slightly reworked this logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO verifying that the 1.0 duty cycle having high RPM and then going back to 0.1 duty (and later with feedback) would be enough.
src/chassis_fans.rs
Outdated
let fans_powered_down = | ||
dead_rpms | ||
.iter() | ||
.fold(0, |count, rpms| if *rpms == 0 { count + 1 } else { count }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that just:
.fold(0, |count, rpms| if *rpms == 0 { count + 1 } else { count }); | |
.filter(|rpms| *rpms == 0).count(); |
For the two others below as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew there had to be a better way. Thanks for pointing to filter(). I'm still getting used to rust iterators.
Agreed on the boot delay. If this becomes annoying during development just bypass it for now. |
This PR adds in a number of self-tests to booster's I2C devices that run at startup.
Tests include:
@jordens The downside of testing fan RPMs on boot is that we need a pretty significant settling time on the fans, which results in a longer boot time. We could likely simplify the fan tests to speed it up if desired.
This closes #38