Browse Source

Fix ENABLED/DISABLED for DUE

…and any other platforms where `false`/`true` are defined as `0x0`/`0x1`.

This fixes issue #10550.
pull/1/head
Scott Lahteine 6 years ago
parent
commit
d470a1234f
  1. 4
      Marlin/src/core/macros.h

4
Marlin/src/core/macros.h

@ -147,9 +147,11 @@
#define SWITCH_ENABLED_true 1 #define SWITCH_ENABLED_true 1
#define SWITCH_ENABLED_0 0 #define SWITCH_ENABLED_0 0
#define SWITCH_ENABLED_1 1 #define SWITCH_ENABLED_1 1
#define SWITCH_ENABLED_0x0 0
#define SWITCH_ENABLED_0x1 1
#define SWITCH_ENABLED_ 1 #define SWITCH_ENABLED_ 1
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b) #define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
#define DISABLED(b) (!_CAT(SWITCH_ENABLED_, b)) #define DISABLED(b) !ENABLED(b)
#define WITHIN(V,L,H) ((V) >= (L) && (V) <= (H)) #define WITHIN(V,L,H) ((V) >= (L) && (V) <= (H))
#define NUMERIC(a) WITHIN(a, '0', '9') #define NUMERIC(a) WITHIN(a, '0', '9')

Loading…
Cancel
Save