diff options
author | Shriramana Sharma <samjnaa@gmail.com> | 2018-08-11 11:11:01 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-11 11:11:01 +0530 |
commit | 0c5aa78ff40d208a1341b3dae84166e837901070 (patch) | |
tree | 75acfb7c17db22e45a514f4b4f545adc8c3c89a9 /cores/arduino | |
parent | b7c607663fecc232e598f2c0acf419ceb0b7078c (diff) |
Add `bitToggle` macro to complement `bitSet` etc
Diffstat (limited to 'cores/arduino')
-rw-r--r-- | cores/arduino/Arduino.h | 1 |
1 files changed, 1 insertions, 0 deletions
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 |