From 4952c4d72fa8a24b51d6456e5a2844d545d8d160 Mon Sep 17 00:00:00 2001 From: andrethomas2 <43345003+andrethomas2@users.noreply.github.com> Date: Fri, 11 Jan 2019 13:12:08 +0200 Subject: [PATCH] Update support_rotary.ino --- sonoff/support_rotary.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sonoff/support_rotary.ino b/sonoff/support_rotary.ino index 2e1cf8f3d..6a186bae4 100644 --- a/sonoff/support_rotary.ino +++ b/sonoff/support_rotary.ino @@ -68,7 +68,7 @@ void update_rotary(void) { void RotaryInit(void) { rotaries_found = 0; - if (pin[GPIO_ROT_A] < 99 && pin[GPIO_ROT_B] < 99) { + if ((pin[GPIO_ROT_A] < 99) && (pin[GPIO_ROT_B] < 99)) { rotaries_found++; pinMode(pin[GPIO_ROT_A], INPUT_PULLUP); pinMode(pin[GPIO_ROT_B], INPUT_PULLUP); @@ -76,11 +76,11 @@ void RotaryInit(void) // GPIO6-GPIO11 are typically used to interface with the flash memory IC on // most esp8266 modules, so we should avoid adding interrupts to these pins. - if (pin[GPIO_ROT_A] < 6 || pin[GPIO_ROT_A] > 11) { + if ((pin[GPIO_ROT_A] < 6) || (pin[GPIO_ROT_A] > 11)) { attachInterrupt(digitalPinToInterrupt(pin[GPIO_ROT_A]), update_rotary, CHANGE); interrupts_in_use++; } - if (pin[GPIO_ROT_B] < 6 || pin[GPIO_ROT_B] > 11) { + if ((pin[GPIO_ROT_B] < 6) || (pin[GPIO_ROT_B] > 11)) { attachInterrupt(digitalPinToInterrupt(pin[GPIO_ROT_B]), update_rotary, CHANGE); interrupts_in_use++; }