From b7da3ed6db59e8baa85ff1921a4641cdbc7cd259 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 4 Aug 2021 16:41:32 +0200 Subject: [PATCH] Fix panic on Mi Desk rotary use --- tasmota/support_rotary.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasmota/support_rotary.ino b/tasmota/support_rotary.ino index 1860fdf48..7af6b458a 100644 --- a/tasmota/support_rotary.ino +++ b/tasmota/support_rotary.ino @@ -47,7 +47,6 @@ #endif const uint8_t rotary_offset = 128; -const int8_t rotary_state_pos[16] = { 0, 1, -1, 2, -1, 0, -2, 1, 1, -2, 0, -1, 2, -1, 1, 0 }; struct ROTARY { uint8_t no_pullup_mask_a = 0; // Rotary A pull-up bitmask flags @@ -105,6 +104,8 @@ bool RotaryButtonPressed(uint32_t button_index) { } void IRAM_ATTR RotaryIsrArgMiDesk(void *arg) { + const int8_t rotary_state_pos[16] = { 0, 1, -1, 2, -1, 0, -2, 1, 1, -2, 0, -1, 2, -1, 1, 0 }; + tEncoder* encoder = static_cast(arg); // https://github.com/PaulStoffregen/Encoder/blob/master/Encoder.h