-
Notifications
You must be signed in to change notification settings - Fork 148
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
Change some variables in tinyNeoPixel from private to protected #1103
Comments
…ed so inheriting classes have access to important variables.
Can you explain what the reasoning is behind:
|
I have to go back to 2017 to find a version of the Adafruit_Neopixel lib that has those variables declared as private. When Adafruit released v1.1.2 of that lib on Jun 28, 2017, they changed the designation from private to protected. No real mention of it in the release, they just kind of snuck it in there. The three access specifiers in C++ are: So protected is almost the same as private, but a little less restrictive for classes that inherit from a base class. I help maintain the LED effects lib WS2812FX, which inherits from the Adafruit_Neopixel lib and makes use of the variables that are declared protected. Alternatively, to inherit from your tinyNeoPixel lib for ATtiny devices, I need the variables declared protected as well. Hope that makes things a little clearer. |
So you're saying we missed a correction in adafruits version that should be applied here too? |
Yes, that's what it looks like to me. Did you notice the pull request I created? |
Hi, I'm using a NeoPixel library that inherits from the Adafruit_NeoPixel class and would like to modify the library to instead inherit from your tinyNeoPixel class. Adafruit_NeoPixel exposes some of the nitty gritty details of its inner workings by declaring some critical variables as "protected", making them available to classes that inherit from Adafruit_Neopixel.
Unfortunately, those variables are declared private in tinyNeoPixel, so are not reachable. Would you be willing to change the declaration to protected?
Thanks for sharing all your ATtiny hard work.
The text was updated successfully, but these errors were encountered: