Enable Sound

This commit is contained in:
whowechina 2024-09-13 23:26:22 +08:00
parent 83d093a2b9
commit 5437d9bb51
2 changed files with 3 additions and 4 deletions

View File

@ -95,8 +95,8 @@ static void run_lights()
static void run_sound() static void run_sound()
{ {
//sound_set(0, wad_read_left()); sound_set(0, wad_read_left());
//sound_set(1, wad_read_right()); sound_set(1, wad_read_right());
} }
static mutex_t core1_io_lock; static mutex_t core1_io_lock;

View File

@ -55,6 +55,7 @@ void sound_init()
gpio_set_function(gpio, GPIO_FUNC_PWM); gpio_set_function(gpio, GPIO_FUNC_PWM);
slice_num[i] = pwm_gpio_to_slice_num(gpio); slice_num[i] = pwm_gpio_to_slice_num(gpio);
pwm_clear_irq(slice_num[i]); 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_exclusive_handler(PWM_IRQ_WRAP, pwm_interrupt_handler);
irq_set_enabled(PWM_IRQ_WRAP, true); irq_set_enabled(PWM_IRQ_WRAP, true);
@ -67,8 +68,6 @@ void sound_init()
pwm_init(slice_num[i], &cfg, true); pwm_init(slice_num[i], &cfg, true);
pwm_set_gpio_level(sound_gpio[i], 0); pwm_set_gpio_level(sound_gpio[i], 0);
} }
sound_toggle(false);
} }
void sound_toggle(bool on) void sound_toggle(bool on)