Explorar o código

[fix]修复短按->长按按键误触发按下事件

Signed-off-by: jaffer <jaffer.work@foxmail.com>

涉及到PR/Issues:

https://github.com/0x1abin/MultiButton/pull/39
https://github.com/0x1abin/MultiButton/pull/36
https://github.com/0x1abin/MultiButton/issues/24

Signed-off-by: Meco Man <920369182@qq.com>
jaffer %!s(int64=3) %!d(string=hai) anos
pai
achega
235c9e602d
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      multi_button.c

+ 2 - 2
multi_button.c

@@ -169,9 +169,9 @@ static void button_handler(struct button* handle)
                 handle->state = 0;
             }
         }
-        else if(handle->ticks > SHORT_TICKS)
+        else if(handle->ticks > SHORT_TICKS) // SHORT_TICKS < press down hold time < LONG_TICKS
         {
-            handle->state = 0;
+            handle->state = 1;
         }
         break;