Creating a "configurable" firmware #464
-
Hi all. What would be the proper approach to make it possible to configure the strip type connected to a controller? Right now the color ordering of the LEDs (RGB/GRB/GRBW etc.) is incorporated into the type of the NeoPixelBus via templates. This makes it quite hard to allow changing this "on the fly" without recompiling the firmware of your controller. What is the suggested approach to tackle this problem? Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This library is not meant to solve that solution. It will be very difficult to support with lots of code bloat. You the sketch author have to wrap each feature/method combo with its own class that derives from a base "interface" (abstract virtual class) and provide a "factory" that instances each combo and returns that base "interface". If you have ever heard of COM (old Windows term, often mentioned in relation to OLE) then this is what you would be doing. Further, abstracting the whole RgbwColor and RgbColor is not going to be fun for you unless you accept comprises. Its all doable, but not the goal of this library. 99.99% of users never need that and it will cause a huge code bloat and won't be very platform independent. |
Beta Was this translation helpful? Give feedback.
This library is not meant to solve that solution. It will be very difficult to support with lots of code bloat.
You the sketch author have to wrap each feature/method combo with its own class that derives from a base "interface" (abstract virtual class) and provide a "factory" that instances each combo and returns that base "interface". If you have ever heard of COM (old Windows term, often mentioned in relation to OLE) then this is what you would be doing.
Further, abstracting the whole RgbwColor and RgbColor is not going to be fun for you unless you accept comprises.
Its all doable, but not the goal of this library. 99.99% of users never need that and it will cause a huge code bloat and…