Skip to content

Create headers for hardware memory accesses via structure member access#392

Merged
mstroh76 merged 10 commits into
WiringPi:pwmSetRangeChannelfrom
Next-Door-Tech:hw-memory-structs
Aug 26, 2025
Merged

Create headers for hardware memory accesses via structure member access#392
mstroh76 merged 10 commits into
WiringPi:pwmSetRangeChannelfrom
Next-Door-Tech:hw-memory-structs

Conversation

@Next-Door-Tech
Copy link
Copy Markdown
Contributor

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.

@Next-Door-Tech
Copy link
Copy Markdown
Contributor Author

Currently a snapshot of #377 before removing the structures from that PR.

@Next-Door-Tech Next-Door-Tech marked this pull request as ready for review August 17, 2025 22:48
@Next-Door-Tech Next-Door-Tech marked this pull request as draft August 17, 2025 22:49
@Next-Door-Tech Next-Door-Tech changed the base branch from develop to pwmSetRangeChannel August 20, 2025 00:11
@mstroh76 mstroh76 self-requested a review August 21, 2025 18:01
Copy link
Copy Markdown
Member

@mstroh76 mstroh76 left a comment

Choose a reason for hiding this comment

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

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.

@Next-Door-Tech
Copy link
Copy Markdown
Contributor Author

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.

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).

@Next-Door-Tech
Copy link
Copy Markdown
Contributor Author

@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.

@mstroh76
Copy link
Copy Markdown
Member

mstroh76 commented Aug 24, 2025

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.

@Next-Door-Tech Next-Door-Tech changed the title Switch all hardware memory accesses from pointer resolution to structure member access Create headers for hardware memory accesses via structure member access Aug 24, 2025
@mstroh76 mstroh76 marked this pull request as ready for review August 26, 2025 15:21
@mstroh76 mstroh76 merged commit b309634 into WiringPi:pwmSetRangeChannel Aug 26, 2025
1 check passed
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.

2 participants