diff --git a/Core/Src/ui.c b/Core/Src/ui.c index 21f3aec..8205f48 100644 --- a/Core/Src/ui.c +++ b/Core/Src/ui.c @@ -75,8 +75,8 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { last_state[idx_a] = state_a; last_state[idx_b] = state_b; - if (state_a == GPIO_PIN_RESET && state_b == GPIO_PIN_RESET) { - // Second falling edge, direction depends on which pin changed last + if (state_a == GPIO_PIN_SET && state_b == GPIO_PIN_SET) { + // Second rising edge, direction depends on which pin changed last if (a_changed && b_changed) { // This shouldn't happen. Ignore this event. last_change[idx_a] = now;