Skip to content

Conversation

@be-ska
Copy link
Contributor

@be-ska be-ska commented Apr 12, 2025

Sometimes it's very handy to set multiple bits with just one command, ie: setting ARMING_CHECK or LOG_BITMASK.
With this very simple PR user can provide more bit arguments, so

param bitmask toggle ARMING_CHECK 0 1 2 3 4 5 6 7 8 10 11 12 13 14 15 18 19

change ARMING_CHECK from ALL (=1) to ALL but CAMERA (=982526)

@peterbarker peterbarker requested a review from joshanne April 13, 2025 06:48
Copy link
Contributor

@joshanne joshanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, I love seeing that people are using this feature already!

I would like to test this and see how it behaves with a vehicle.


if bit_index is None:
print(f"Invalid bit index: {arg_bit_index}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prune the whitespace.

Copy link
Contributor

@joshanne joshanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peterbarker only comment I have is above regarding informing of errors.

The functionality appears to work as expected, and doesn't break any workflows with the single bit index.

I feel like there could be a more intuitive way to do the same thing - When i do this, I do each bit at a time, ensuring I don't make a mistake at each step. Not saying it's the perfect way, though.

@be-ska
Copy link
Contributor Author

be-ska commented Apr 14, 2025

I've added the suggested changes, I can squash the commits if you approve

@joshanne
Copy link
Contributor

joshanne commented Apr 14, 2025

@be-ska looks like it's all working fine, i'd be happy if you pruned the whitespace and squash the commits. Really only needs to be the one commit. This gets my thumbs up.

@peterbarker leaving you for final approval, but all seems fine to me. Curious if you've made use of the bitmask manipulation yourself?

@be-ska be-ska force-pushed the param-bitmask-list branch from da2fd8e to d836aa4 Compare April 14, 2025 05:13
@peterbarker
Copy link
Contributor

@peterbarker leaving you for final approval, but all seems fine to me. Curious if you've made use of the bitmask manipulation yourself?

Yep, I'll merge this once CI passes.

And yes, I do use the new command a bit - particularly when combined with the detailed-which-bits-are-set parameter view it's pretty damned handy!

@peterbarker peterbarker merged commit cc10ad7 into ArduPilot:master Apr 16, 2025
2 checks passed
@peterbarker
Copy link
Contributor

Merged, thanks!

@be-ska be-ska deleted the param-bitmask-list branch September 17, 2025 12:51
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.

3 participants