HAL layer defines clash with enums in user code (photon)

my application code uses classes and enums:

class RRSignal {
public:
    enum Stick     { NONE, FLEET = 1, ER = 2, FLEET_ER = 3 };

unfortunately, …/hal/src/core-v2/pinmap_impl.h (included as a side effect of application.h…) creates a clashing #define:

In file included from ../hal/src/core-v2/platform_headers.h:17:0,
                 from ./inc/application.h:59,
                 from ControlPoint.cpp:8:
../hal/src/core-v2/pinmap_impl.h:55:14: error: expected identifier before '(' token
 #define NONE ((uint8_t)0xFF)
              ^

May I suggest using a private naming scheme for these internal defines (PARTICLE_HAL_NONE) or using your own scoped enums…

Workaround (with potential side effects that I haven’t run into yet :wink: …)
At the top of my “.h” file, place

#undef NONE
1 Like

I put in a github issue for this just now.

1 Like

thanks!