From 5437d9bb51d78ae888bd6219688dadf8d7b7f74b Mon Sep 17 00:00:00 2001 From: whowechina Date: Fri, 13 Sep 2024 23:26:22 +0800 Subject: [PATCH] Enable Sound --- firmware/src/main.c | 4 ++-- firmware/src/sound.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/firmware/src/main.c b/firmware/src/main.c index 7677d99..5d225b0 100644 --- a/firmware/src/main.c +++ b/firmware/src/main.c @@ -95,8 +95,8 @@ static void run_lights() static void run_sound() { - //sound_set(0, wad_read_left()); - //sound_set(1, wad_read_right()); + sound_set(0, wad_read_left()); + sound_set(1, wad_read_right()); } static mutex_t core1_io_lock; diff --git a/firmware/src/sound.c b/firmware/src/sound.c index f57ce1c..b8a2cf7 100644 --- a/firmware/src/sound.c +++ b/firmware/src/sound.c @@ -55,6 +55,7 @@ void sound_init() gpio_set_function(gpio, GPIO_FUNC_PWM); slice_num[i] = pwm_gpio_to_slice_num(gpio); pwm_clear_irq(slice_num[i]); + pwm_set_irq_enabled(slice_num[i], true); } irq_set_exclusive_handler(PWM_IRQ_WRAP, pwm_interrupt_handler); irq_set_enabled(PWM_IRQ_WRAP, true); @@ -67,8 +68,6 @@ void sound_init() pwm_init(slice_num[i], &cfg, true); pwm_set_gpio_level(sound_gpio[i], 0); } - - sound_toggle(false); } void sound_toggle(bool on)