-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix: make available(pipe)
depend on available(void)
#1007
Conversation
I've been code golfing in rust again... By making `available(pipe)` call `available(void)`, we can get the same behavior without instantiating a dummy byte (`RF24_FETCH_NO_PIPE`) . This way `available(pipe)` also doesn't need to check the `pipe` parameter's value; it just mutates it because that is the overload's purpose. This should decrease the compile size for any app that doesn't actually call `available(pipe)`.
6fb1e5e
to
a11d593
Compare
Memory usage change @ a11d593
Click for full report table
Click for full report CSV
|
Odd, there's a 4 byte increase in flash on ATSAMD21 for the examples that use |
Examples tested fine in Linux. I have no reason to think this patch is a bad idea. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we kinda had it backwards
I've been code golfing in rust again (on rf24-rs)...
By making
available(pipe)
callavailable(void)
, we can get the same behavior without instantiating a dummy byte (RF24_FETCH_NO_PIPE
) . This wayavailable(pipe)
also doesn't need to check thepipe
parameter's value; it just mutates it because that is the overload's purpose.This should decrease the compile size in general, more for any app that doesn't actually call
available(pipe)
.