Skip to content
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

AP_HAL_SITL: allow disabling CAN interfaces #27539

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

tpwrules
Copy link
Contributor

@tpwrules tpwrules commented Jul 13, 2024

Also corrects an issue where setting an invalid type could result in undefined behavior.

Tested by running two peripherals on two different buses.

@peterbarker
Copy link
Contributor

"We"?

Did you consider just making 0 "None", shifting everything along one and making the default 1?

It's much more in keeping with what we normally do and the number of users of this could be counted on one hand of a clumsy carpenter.

@tpwrules
Copy link
Contributor Author

“We” is a grammar quirk I have, the idea was wholly my own :)

I did consider renumbering but was concerned it would change CAN behavior in people’s existing SITL instances. If updating the default is sufficient to avoid that, and/or the change is not a big problem, then yes I think renumbering is a lot better.

Also corrects an issue where setting an invalid type could result in
undefined behavior.
Also corrects an issue where setting an invalid type could result in
undefined behavior.
@tpwrules
Copy link
Contributor Author

I checked and updating the default is indeed sufficient, so I went with 0=None.

@tridge tridge merged commit 1c54dd9 into ArduPilot:master Jul 16, 2024
93 checks passed
@tpwrules tpwrules deleted the pr/sitl-disable-can branch July 16, 2024 00:15
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.

None yet

4 participants