pref: 修改buzzer接口
This commit is contained in:
@@ -54,3 +54,13 @@ void by_buzzer_add(uint16_t tone)
|
||||
{
|
||||
queue_add_element(tone);
|
||||
}
|
||||
|
||||
void by_buzzer_run(void)
|
||||
{
|
||||
if (queue_long != 0) {
|
||||
pwm_init(BUZZER_PIN, a[0], 5000);
|
||||
queue_pop_element();
|
||||
system_delay_ms(100);
|
||||
pwm_set_duty(BUZZER_PIN, 0);
|
||||
}
|
||||
}
|
||||
@@ -20,4 +20,5 @@ extern void queue_pop_element(void);
|
||||
extern void queue_pop_read(void);
|
||||
extern void by_buzzer_init(void);
|
||||
extern void by_buzzer_add(uint16_t tone);
|
||||
extern void by_buzzer_run(void);
|
||||
#endif
|
||||
22
app/main.c
22
app/main.c
@@ -47,27 +47,7 @@ int main(void)
|
||||
Page_Init();
|
||||
|
||||
while (1) {
|
||||
|
||||
// switch (by_get_rb_status()) {
|
||||
// case 3:
|
||||
// i++;
|
||||
// break;
|
||||
// case 4:
|
||||
// i--;
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
|
||||
// by_pwm_update_duty(500 + i * 50, 500 + i * 50);
|
||||
// by_pwm_power_duty(500 + i * 50, 500 + i * 50, 500 + i * 50, 500 + i * 50);
|
||||
// // ips200_show_uint(0, 0, 1000, 4);
|
||||
// ips200_draw_rect(0, 0, 50, 50, RGB565_YELLOW);
|
||||
// system_delay_ms(100);
|
||||
// ips200_draw_rect(0, 0, 50, 50, RGB565_BLACK);
|
||||
// system_delay_ms(10);
|
||||
|
||||
queue_pop_read();
|
||||
by_buzzer_run();
|
||||
Page_Run();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user