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

Request: Expose #define for "BPD" in pigpio.h #620

Open
ahmogit opened this issue Oct 30, 2024 · 0 comments
Open

Request: Expose #define for "BPD" in pigpio.h #620

ahmogit opened this issue Oct 30, 2024 · 0 comments

Comments

@ahmogit
Copy link

ahmogit commented Oct 30, 2024

The numerical value of BPD (presently #defined at pigpio.c::790 in pigpio V79) is necessary to have available if one wishes to perform dynamic adjustments to wave segment lengths. However it is not presently available as a preprocessor symbol in pigpio.h, leading to inscrutable hardwired "magic number" usages like this

 `*g_slackA = (slack * 4);`

as appears in example program pps.c::189. Having BPD available in pigpio.h would avoid the magic number 4.

Regardless of whether one agrees or not that BPD ought to be exposed in pigpio.h, it would certainly be useful to add a trailing comment to the #define for BPD, stating its semantic. I guessed that it probably stands for "bytes per [something]", but not sure what [something] is.

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

No branches or pull requests

1 participant