From 22fc6756c6039c8f6cf9cbefe374bdb5f0478151 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sun, 6 Aug 2017 14:24:25 -0700 Subject: [PATCH] Audio: Init codec after initializing I2S interface. --- firmware/application/audio.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/application/audio.cpp b/firmware/application/audio.cpp index c0c0eaf3..ffbac8b3 100644 --- a/firmware/application/audio.cpp +++ b/firmware/application/audio.cpp @@ -201,17 +201,18 @@ size_t reg_bits() { } /* namespace debug */ void init(audio::Codec* const codec) { - audio_codec = codec; - clock_manager.start_audio_pll(); - audio_codec->init(); + // Configure I2S before activating codec interface. i2s::i2s0::configure( i2s0_config_tx_master_base_clk, i2s0_config_rx_four_wire, i2s0_config_dma ); + audio_codec = codec; + audio_codec->init(); + // Set pin mode, since it's likely GPIO (as left after CPLD JTAG interactions). portapack::pin_i2s0_rx_sda.mode(3); }