diff options
author | Alexander Entinger <consulting@lxrobotics.com> | 2019-09-16 10:22:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-16 10:22:20 +0200 |
commit | 5ed329e1c9771ba45bca0f13938adccd5a36e719 (patch) | |
tree | 597ffcfd6407f4b7c55639ee54f5b517c25c9e79 /cores | |
parent | 742abcd9660d4b754fede51f098113fca918cb54 (diff) | |
parent | 366b1b814702ec0da8951f9e13af882352442940 (diff) |
Merge pull request #31 from jamadagni/patch-1
Add `bitToggle` macro to complement `bitSet` etc
Diffstat (limited to 'cores')
-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 e1a34ca..91eeb16 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 |