pref: 删除多余注释
This commit is contained in:
@@ -3,9 +3,7 @@
|
|||||||
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "ch32v30x.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{
|
typedef enum rotate_button_event{
|
||||||
rotate_button_press_short = 1,
|
rotate_button_press_short = 1,
|
||||||
rotate_button_press_long = 2,
|
rotate_button_press_long = 2,
|
||||||
|
|||||||
12
app/isr.c
12
app/isr.c
@@ -218,26 +218,24 @@ void EXTI15_10_IRQHandler(void)
|
|||||||
EXTI_ClearITPendingBit(EXTI_Line10);
|
EXTI_ClearITPendingBit(EXTI_Line10);
|
||||||
}
|
}
|
||||||
if (SET == EXTI_GetITStatus(EXTI_Line11)) {
|
if (SET == EXTI_GetITStatus(EXTI_Line11)) {
|
||||||
static uint64_t time_fly = 0;
|
static uint64_t time_via = 0;
|
||||||
|
|
||||||
if (RESET == gpio_get_level(E11)) {
|
if (RESET == gpio_get_level(E11)) {
|
||||||
system_delay_us(200);
|
system_delay_us(200);
|
||||||
if (RESET == gpio_get_level(E11)) {
|
if (RESET == gpio_get_level(E11)) {
|
||||||
time_fly = system_get_tick();
|
time_via = system_get_tick();
|
||||||
// rotate_button = rotate_button_press_short;
|
|
||||||
}
|
}
|
||||||
EXTI_ClearITPendingBit(EXTI_Line11);
|
EXTI_ClearITPendingBit(EXTI_Line11);
|
||||||
} else {
|
} else {
|
||||||
system_delay_us(200);
|
system_delay_us(200);
|
||||||
if (SET == gpio_get_level(E11)) {
|
if (SET == gpio_get_level(E11)) {
|
||||||
// rotate_button = rotate_button_press_short;
|
time_via = system_get_tick() - time_via;
|
||||||
time_fly = system_get_tick() - time_fly;
|
if (time_via > LONG_PRESS_THRESHOLD_TICK) {
|
||||||
if (time_fly > LONG_PRESS_THRESHOLD_TICK) {
|
|
||||||
rotate_button = rotate_button_press_long;
|
rotate_button = rotate_button_press_long;
|
||||||
} else {
|
} else {
|
||||||
rotate_button = rotate_button_press_short;
|
rotate_button = rotate_button_press_short;
|
||||||
}
|
}
|
||||||
time_fly = 0;
|
time_via = 0;
|
||||||
}
|
}
|
||||||
EXTI_ClearITPendingBit(EXTI_Line11);
|
EXTI_ClearITPendingBit(EXTI_Line11);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user