From 867fb3f228dd61032ac154e368c5e9ce5d7f2db9 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Tue, 6 Jun 2023 20:20:15 +0100 Subject: [PATCH] Use XUA_I2S_N_BITS when deciding whether or not to delay falling edge of bit clock when CODEC_MASTER=1 --- lib_xua/src/core/ports/audioports.xc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_xua/src/core/ports/audioports.xc b/lib_xua/src/core/ports/audioports.xc index 10fd328f..fac58cbc 100644 --- a/lib_xua/src/core/ports/audioports.xc +++ b/lib_xua/src/core/ports/audioports.xc @@ -100,7 +100,7 @@ void ConfigAudioPorts( /* Do some clocking shifting to get data in the valid window */ /* E.g. Only shift when running at 88.2+ kHz TDM slave */ int bClkDelay_fall = 0; - if(curSamFreq * I2S_CHANS_PER_FRAME * 32 >= 20000000) + if(curSamFreq * I2S_CHANS_PER_FRAME * XUA_I2S_N_BITS >= 20000000) { /* 18 * 2ns = 36ns. This results in a -4ns (36 - 40) shift at 96KHz and -8ns (36 - 44) at 88.4KHz */ bClkDelay_fall = 18;