feat: 添加声音序列

This commit is contained in:
bmy
2024-01-08 22:08:43 +08:00
parent 6bb5b9eaad
commit bf76c25f41
5 changed files with 77 additions and 2 deletions

View File

@@ -36,6 +36,7 @@
#include "zf_common_headfile.h"
#include "by_rt_button.h"
#include "by_imu.h"
#include "by_buzzer.h"
void NMI_Handler(void) __attribute__((interrupt()));
void HardFault_Handler(void) __attribute__((interrupt()));
@@ -199,9 +200,10 @@ void EXTI9_5_IRQHandler(void)
if (SET == gpio_get_level(E10)) {
rotate_button = rotate_button_backward;
queue_add_element(BY_BACKWARD);
} else {
rotate_button = rotate_button_forward;
queue_add_element(BY_FORWARD);
}
EXTI_ClearITPendingBit(EXTI_Line9);
}
@@ -227,8 +229,11 @@ void EXTI15_10_IRQHandler(void)
time_via = system_get_tick() - time_via;
if (time_via > LONG_PRESS_THRESHOLD_TICK) {
rotate_button = rotate_button_press_long;
queue_add_element(BY_PRESS_LONG);
} else {
rotate_button = rotate_button_press_short;
queue_add_element(BY_PRESS_SHORT);
}
time_via = 0;
EXTI_ClearITPendingBit(EXTI_Line11);