From c8f76bb8aa37f35438543deb32d8e3869397fb7a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 28 Feb 2016 23:29:53 -0800 Subject: [PATCH] Create BITSET/BITCLR macros --- Marlin/macros.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Marlin/macros.h b/Marlin/macros.h index 09b6f1933..4e974a56c 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -2,9 +2,10 @@ #define MACROS_H // Macros for bit masks -#define BIT(b) (1<<(b)) -#define TEST(n,b) (((n)&BIT(b))!=0) -#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (BIT(b)) +#define TEST(n,b) (((n)&_BV(b))!=0) +#define SBI(n,b) (n |= _BV(b)) +#define CBI(n,b) (n &= ~_BV(b)) +#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (_BV(b)) // Macros for maths shortcuts #define RADIANS(d) ((d)*M_PI/180.0)