From 676165f3f6e5b62201c422ab6ca3c1d216a1c79e Mon Sep 17 00:00:00 2001 From: blakadder Date: Thu, 8 Jun 2023 20:39:02 +0200 Subject: [PATCH] better way to support LSBJ (#18827) --- tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio.ino | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio.ino b/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio.ino index 1b294ddfc..c2de4f629 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_42_0_i2s_audio.ino @@ -265,10 +265,6 @@ int32_t I2S_Init_0(void) { audio_i2s.out = new AudioOutputI2S(); #endif -#ifdef USE_I2S_LSB - audio_i2s.lsbJustified = true; -#endif // Allow supporting LSBJ chips, e.g. TM8211/PT8211 - audio_i2s.bclk = DAC_IIS_BCK; audio_i2s.ws = DAC_IIS_WS; audio_i2s.dout = DAC_IIS_DOUT; @@ -339,6 +335,11 @@ int32_t I2S_Init_0(void) { if (audio_i2s.mic_port != 0) { AddLog(LOG_LEVEL_INFO, PSTR("Init audio I2S mic: port=%d, bclk=%d, ws=%d, din=%d"), audio_i2s.mic_port, audio_i2s.mic_bclk, audio_i2s.mic_ws, audio_i2s.mic_din); } + +#ifdef USE_I2S_LSB + audio_i2s.out->SetLsbJustified(true); +#endif // Allow supporting LSBJ chips, e.g. TM8211/PT8211 + #else #ifdef USE_I2S_NO_DAC