Makuna / NeoPixelBus

An Arduino NeoPixel support library supporting a large variety of individually addressable LEDs. Please refer to the Wiki for more details. Please use the GitHub Discussions to ask questions as the GitHub Issues feature is used for bug tracking.
GNU Lesser General Public License v3.0
1.18k stars 265 forks source link

Debug "Serial" object use in the library can cause issues with small platforms that don't have it. #856

Open Makuna opened 1 month ago

Makuna commented 1 month ago

Describe the bug Some platforms don't expose a Serial object. This can cause compiler issues due to debug methods present in the library. An example is the method SerialDumpTables in \colors\NeoGammaDynamicTableMethod.h

To Reproduce

Expected behavior

Development environment (please complete the following information):

Additional context Either wrap in a debug define or change the method to a template method where the object and object type can be provided.

sparkplug23 commented 1 month ago

OS: Windows 11 Build Environment: Arduino IDE 2.3.2 Board target: ATTiny85. Library version: 2.9.1 CoreShader Branch

#if !(defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_MEGAAVR))
    static void SerialDumpTables()
    {
        // Function
    }
#endif

This enables the code to compile correctly for ATTiny85, have not yet tested other target boards.