From 534f0810a6e267333fd219cb07015e957a859935 Mon Sep 17 00:00:00 2001 From: Pavel Melnikov Date: Mon, 9 Nov 2020 22:08:13 +0700 Subject: [PATCH] fix bitWrite macro (#4507) Fixes https://github.com/espressif/arduino-esp32/issues/4466 --- cores/esp32/Arduino.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index bc028e11..addcb206 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -88,7 +88,7 @@ #define bitRead(value, bit) (((value) >> (bit)) & 0x01) #define bitSet(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 #ifndef _NOP