fix bitWrite macro (#4507)

Fixes https://github.com/espressif/arduino-esp32/issues/4466
This commit is contained in:
Pavel Melnikov 2020-11-09 22:08:13 +07:00 committed by GitHub
parent 28a8073069
commit 534f0810a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,7 +88,7 @@
#define bitRead(value, bit) (((value) >> (bit)) & 0x01) #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit))) #define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) #define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet(value, bit) : bitClear(value, bit))
// avr-libc defines _NOP() since 1.6.2 // avr-libc defines _NOP() since 1.6.2
#ifndef _NOP #ifndef _NOP