WS2812FX, MySensors and "Expansion of macro F"



  • Hello,
    I try to compile a sketch with ESP8266 MySensors Gateway and WS2812FX library. I can use WS2812FX separately and compile all the example sketches there are, but now when trying to combine these two worlds together I get a following error:

    Build options changed, rebuilding all
    In file included from C:\Omat\Own_projects\Arduino\omat\libraries\MySensors/MySensors.h:28:0,
    
                     from C:\Omat\Own_projects\Arduino\omat\MySensors\HomeNumber_IrRemote\HomeNumber_IrRemote.ino:39:
    
    C:\Users\userxxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/pgmspace.h:21:51: error: __c causes a section type conflict with __c
    
     #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
    
                                                       ^
    
    C:\Omat\Own_projects\Arduino\omat\libraries\MySensors/core/MySensorsCore.h:91:40: note: in definition of macro 'CORE_DEBUG'
    
     #define CORE_DEBUG(x,...) hwDebugPrint(x, ##__VA_ARGS__) //!< debug
    
                                            ^
    
    C:\Omat\Own_projects\Arduino\omat\libraries\MySensors/core/MySensorsCore.cpp:594:13: note: in expansion of macro 'PSTR'
    
      CORE_DEBUG(PSTR("MCO:SLP:WUP=%d\n"), result); // sleep wake-up
    
                 ^
    
    In file included from C:\Users\userxxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:243:0,
    
                     from sketch\HomeNumber_IrRemote.ino.cpp:1:
    
    C:\Users\userxxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/pgmspace.h:21:51: note: '__c' was declared here
    
     #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
    
                                                       ^
    
    C:\Users\userxxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:38:76: note: in definition of macro 'FPSTR'
    
     #define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
    
                                                                                ^
    
    C:\Users\userxxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/WString.h:39:34: note: in expansion of macro 'PSTR'
    
     #define F(string_literal) (FPSTR(PSTR(string_literal)))
    
                                      ^
    
    C:\Omat\Own_projects\Arduino\libraries\WS2812FX-master/WS2812FX.h:284:50: note: in expansion of macro 'F'
    
           _name[FX_MODE_CUSTOM]                    = F("Custom");
    
                                                      ^
    
    exit status 1
    Error compiling for board WeMos D1 R2 & mini.
    

    Not sure what this actually means, but I assume either MySensors or WS2812FX "overlaps" somehow.



  • @sushukka Here is discussion about this topic with WS2812FX author. Workaround found, maybe changes in the future. Nevertheless, this led library is really worth to try as it saves lots of time by having plenty of ready built animations for WS2812 addressable led strips + the library is very easy to use.


  • Mod

    @sushukka WS2812FX looks really neat indeed, thanks for posting about it.

    Did you intend to include a link in your latest post? If so, it seems it got lost.



  • @mfalkvidd Thanks mfalkvidd...the oldest mistake one can make and I'm still falling to it regularly. Here are the links:
    Link to the library: https://github.com/kitesurfer1404/WS2812FX/issues/83
    Link to the problem workaround: https://github.com/kitesurfer1404/WS2812FX


Log in to reply
 

Suggested Topics

45
Online

11.4k
Users

11.1k
Topics

112.6k
Posts