From afcb0326a1e6a0e9c44ad11d0fe97af04645d6a4 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Mon, 12 Jun 2017 18:03:09 +0200 Subject: [PATCH] rotary handling works better with only one interrupt and shorter debouncing time --- my_src/switches.c | 2 +- my_src/switches.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/my_src/switches.c b/my_src/switches.c index 7bfda1d..45df396 100644 --- a/my_src/switches.c +++ b/my_src/switches.c @@ -112,7 +112,7 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { rotary_a_interrupt(); } if (GPIO_Pin == GPIO_PIN_4) { - rotary_b_interrupt(); + // rotary_b_interrupt(); } } diff --git a/my_src/switches.h b/my_src/switches.h index 6327027..e8defaa 100644 --- a/my_src/switches.h +++ b/my_src/switches.h @@ -8,8 +8,8 @@ #ifndef SWITCHES_H_ #define SWITCHES_H_ -const uint32_t DEBOUNCING_DEAD_TIME = 100; -const uint32_t DEBOUNCING_REPEAT = 20; +const uint32_t DEBOUNCING_DEAD_TIME = 25; +const uint32_t DEBOUNCING_REPEAT = 2; const uint32_t LONG_BUTTON_TIME = 1000; void buttonShort();