-
Notifications
You must be signed in to change notification settings - Fork 3
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
Arm debounce #66
Arm debounce #66
Conversation
src/comms/meb/mod.rs
Outdated
let arm_state = self.arm_state.clone(); | ||
let current_arm_state = *self.statuses.thruster_arm().read().await; | ||
|
||
let t1 = thread::spawn(move || { |
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.
Instead of handling this with a thread like so, it is probably more effective to do this in Statuses
(comms/meb/response.rs:97
).
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 moved the arm debounce logic into its own function in Statuses. I also moved the unit tests into the same file. I'm not entirely sure the thruster_is_armed()
and thruster_is__not_armed()
unit tests are necessary. Should I remove them or no?
use anyhow::Result; | ||
use itertools::Itertools; |
Check warning
Code scanning / clippy
unused import: itertools::Itertools Warning
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 don't know why cargo is saying this is unused. On line 168, the all_equal()
is a part of this import, and the build breaks when I remove the import. Does anyone know why or should we dismiss it?
Implemented arm switch debouncing to prevent false positivity when arming thrusters.