Ver código fonte

Merge pull request #18 from wzd5230/master

[fix] 修复按键注册顺序与事件顺序不匹配的问题
Murphy 5 anos atrás
pai
commit
d9949397a6
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      flexible_button.c

+ 1 - 1
flexible_button.c

@@ -167,7 +167,7 @@ static uint8_t flex_button_process(void)
     uint8_t active_btn_cnt = 0;
     flex_button_t* target;
     
-    for (target = btn_head, i = 0; target != NULL; target = target->next, i ++)
+    for (target = btn_head, i = button_cnt - 1; target != NULL; target = target->next, i--)
     {
         if (target->status > FLEX_BTN_STAGE_DEFAULT)
         {