Audio: Init codec after initializing I2S interface.

This commit is contained in:
Jared Boone 2017-08-06 14:24:25 -07:00
parent fe7cc1e23f
commit 22fc6756c6

View File

@ -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);
}