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

Remove pointless gpio attach_interrupt overrides #9243

Merged

Conversation

peterbarker
Copy link
Contributor

This might be contentious. But having all of these empty definitions - which returned true for some strange reason - was painful when I was playing with the attach-a-functor change.

@peterbarker
Copy link
Contributor Author

Just two questions:

  • are we good with having a base-class implementation rather than requiring all HALs to override
  • are we good with changing the behaviour on all of these so they stop pretending they successfully attached an interrupt?

@peterbarker
Copy link
Contributor Author

... amongst our questions are such diverse elements as "what's up with std::swap, anyway?"

@WickedShell
Copy link
Contributor

  • are we good with having a base-class implementation rather than requiring all HALs to override

Sounds reasonable to me, less reimplemented/cruft in the HAL's is a win as far as I can tell.

  • are we good with changing the behaviour on all of these so they stop pretending they successfully attached an interrupt?

Absolutely. That's a terrible behavior to just always return true their, defeats the API, and makes it hard for the caller to safely/sanely handle it.

@peterbarker
Copy link
Contributor Author

It was decided at the devcall that std::swap was OK so long as godbolt approves of it.

The HAL behaviour re: attaching interrupts currently sucks, so fix it.

pure-virtual isn't an attribute we need in the HAL interface, so kill the pointless overload.

@peterbarker
Copy link
Contributor Author

https://godbolt.org/z/Tk0tqS <- std::swap looks OK.

@peterbarker peterbarker force-pushed the remove-pointless-gpio-overrides branch from 67f9146 to 84ac9ab Compare August 28, 2018 04:39
@peterbarker peterbarker merged commit 822fab0 into ArduPilot:master Aug 30, 2018
@peterbarker peterbarker deleted the remove-pointless-gpio-overrides branch August 30, 2018 22:32
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

2 participants