From 86b85aabc53d14d93e8c4f0c87619c0add93f8b8 Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Sat, 10 Dec 2016 18:44:09 +0100 Subject: [PATCH] Disable rotary encoder rotation while pressed (will hopefully prevent some of the common unwanted edits when pressing, thanks 3djc for the idea) --- radio/src/targets/horus/keys_driver.cpp | 2 +- radio/src/targets/taranis/keys_driver.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/targets/horus/keys_driver.cpp b/radio/src/targets/horus/keys_driver.cpp index 7d9b8635d..f3db69659 100644 --- a/radio/src/targets/horus/keys_driver.cpp +++ b/radio/src/targets/horus/keys_driver.cpp @@ -94,7 +94,7 @@ uint8_t keyDown() void checkRotaryEncoder() { uint32_t newpos = ROTARY_ENCODER_POSITION(); - if (newpos != rotencPosition) { + if (newpos != rotencPosition && !keyState(KEY_ENTER)) { if ((rotencPosition & 0x01) ^ ((newpos & 0x02) >> 1)) { --rotencValue[0]; } diff --git a/radio/src/targets/taranis/keys_driver.cpp b/radio/src/targets/taranis/keys_driver.cpp index f4c1b47f4..aedbc844f 100644 --- a/radio/src/targets/taranis/keys_driver.cpp +++ b/radio/src/targets/taranis/keys_driver.cpp @@ -89,7 +89,7 @@ uint8_t keyDown() void checkRotaryEncoder() { uint32_t newpos = ROTARY_ENCODER_POSITION(); - if (newpos != rotencPosition) { + if (newpos != rotencPosition && !keyState(KEY_ENTER)) { if ((rotencPosition & 0x01) ^ ((newpos & 0x02) >> 1)) { --rotencValue[0]; }