pref: 删除多余注释

This commit is contained in:
2024-01-05 16:00:06 +08:00
parent 535cb372df
commit a3bb280c7e
2 changed files with 6 additions and 10 deletions

View File

@@ -3,9 +3,7 @@
#include "stdio.h"
#include "ch32v30x.h"
// #define rotate_button_press_short 1
// #define rotate_button_forward 2
// #define rotate_button_backward 3
typedef enum rotate_button_event{
rotate_button_press_short = 1,
rotate_button_press_long = 2,

View File

@@ -218,26 +218,24 @@ void EXTI15_10_IRQHandler(void)
EXTI_ClearITPendingBit(EXTI_Line10);
}
if (SET == EXTI_GetITStatus(EXTI_Line11)) {
static uint64_t time_fly = 0;
static uint64_t time_via = 0;
if (RESET == gpio_get_level(E11)) {
system_delay_us(200);
if (RESET == gpio_get_level(E11)) {
time_fly = system_get_tick();
// rotate_button = rotate_button_press_short;
time_via = system_get_tick();
}
EXTI_ClearITPendingBit(EXTI_Line11);
} else {
system_delay_us(200);
if (SET == gpio_get_level(E11)) {
// rotate_button = rotate_button_press_short;
time_fly = system_get_tick() - time_fly;
if (time_fly > LONG_PRESS_THRESHOLD_TICK) {
time_via = system_get_tick() - time_via;
if (time_via > LONG_PRESS_THRESHOLD_TICK) {
rotate_button = rotate_button_press_long;
} else {
rotate_button = rotate_button_press_short;
}
time_fly = 0;
time_via = 0;
}
EXTI_ClearITPendingBit(EXTI_Line11);
}