From 0c5aa78ff40d208a1341b3dae84166e837901070 Mon Sep 17 00:00:00 2001 From: Shriramana Sharma Date: Sat, 11 Aug 2018 11:11:01 +0530 Subject: Add `bitToggle` macro to complement `bitSet` etc --- cores/arduino/Arduino.h | 1 + 1 file changed, 1 insertion(+) diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h index 09c1448..808ff19 100644 --- a/cores/arduino/Arduino.h +++ b/cores/arduino/Arduino.h @@ -111,6 +111,7 @@ void yield(void); #define bitRead(value, bit) (((value) >> (bit)) & 0x01) #define bitSet(value, bit) ((value) |= (1UL << (bit))) #define bitClear(value, bit) ((value) &= ~(1UL << (bit))) +#define bitToggle(value, bit) ((value) ^= (1UL << (bit))) #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) // avr-libc defines _NOP() since 1.6.2 -- cgit v1.2.3-18-g5258