Skip to content

Commit

Permalink
Add bitToggle macro
Browse files Browse the repository at this point in the history
  • Loading branch information
MCUdude committed Jan 19, 2023
1 parent 221900d commit e16f14c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,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
Expand Down

0 comments on commit e16f14c

Please sign in to comment.