Create headers for hardware memory accesses via structure member access#392
Conversation
|
Currently a snapshot of #377 before removing the structures from that PR. |
9fc4710 to
978b05f
Compare
978b05f to
824337d
Compare
824337d to
61b5afb
Compare
mstroh76
left a comment
There was a problem hiding this comment.
Just to clarify — are these headers intended for future use only, without modifying existing code? The phrase "Switch all" sounds a bit like a full replacement, which might be misleading.
Could you please remove all "Copyright" lines from the new headers/files? This was something Gordon used to include, but I believe it's unnecessary. I don't think it's appropriate to include copyright lines in GPL-licensed files. The GPL is a licensing framework, not a copyright declaration. Copyright attribution is already handled implicitly through Git history, which clearly shows who authored each part of the code. Mixing copyright statements with GPL headers can be misleading and unnecessary.
Currently, my plan is to do a more-or-less full replacement of all the accesses to GPIO and PWM memory in code (obviously with your approval), so the phrasing is correct. Currently, the only work I've done is to write the RP1 header; the BCM header still needs work, and none of the transitioning to the new structure access is done except for the pwmSetChannelRange() function we just merged. (The changes to pwmSetChannelRange are currently sitting on a local branch on my Pi 5). |
|
@mstroh76 What I'll probably do is create a separate PR for just the headers once both headers are complete. Then this PR will be the main PR for the full transition. |
|
The new header is a good idea, but I'm not happy with 'full replacement of all the accesses to GPIO and PWM'. Stability is very important, the risk is too high for me that mistakes will happen. Please PR only the headers, so we can use it for refactoring and new code. |
b094138 to
e94ede8
Compare
Creates new private headers with structures that mirror the south bridge memory registers on both the BCM2711 and RP1 chips entirely. This will allow for easier future expansion projects which take advantage of features on these chips which WiringPi currently does not make use of.