hal: Update iocontrol to use getter/setter - #4338
Merged
Merged
Conversation
Contributor
|
This gives way to #4251 if I'm not mistaken? |
Contributor
Author
Only in part. Remember, the goal of the getter/setter change is to eliminate the 32-bit types and make everything 64-bit clean. Introducing #4251 now would again make that goal a lot more difficult because the code is currently not clean. Having the C++ wrapper hiding the types is making evaluating where we need to fix 64-bit compatibility a whole lot more difficult (see my comment in the PR description). Remember, we can't just replace 32-bit types with 64-bit types. Every use must be evaluated in context. We need to go through the cleanup steps first. |
Contributor
|
Fair, I will just rebase #4251 cleanup and push, I'll wait on your sign to come out of draft. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes the use of
hal.hhthat accesses HAL's internal structure, which no longer is allowed. The PR does not (yet) remove the hal.hh file, but adds a preprocessor warning when included.Taskclass/iocontrol was the only place where hal.hh was used and it is easily converted using standard methods and getter/setter(*).
(*) The C++ wrapper hid the type of the pin/param. It is not clear why hiding the HAL types in get/set operations would be an advantage. It only increases complexity in finding out what you are actually using and opens the door to a class of errors of mistaken identity. Or you'd need to start naming your variables to include the type, which then would question why you used the type hiding in the first place.