File tree Expand file tree Collapse file tree
ports/nrf/common-hal/audiobusio Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -250,6 +250,10 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self,
250250 NRF_I2S -> CONFIG .SWIDTH = self -> bytes_per_sample == 1
251251 ? I2S_CONFIG_SWIDTH_SWIDTH_8Bit
252252 : I2S_CONFIG_SWIDTH_SWIDTH_16Bit ;
253+ NRF_I2S -> CONFIG .CHANNELS = self -> channel_count == 1
254+ ? I2S_CONFIG_CHANNELS_CHANNELS_Left
255+ : I2S_CONFIG_CHANNELS_CHANNELS_Stereo ;
256+
253257 choose_i2s_clocking (self , sample_rate );
254258 /* Allocate buffers based on a maximum duration
255259 * This duration was chosen empirically based on what would
@@ -273,9 +277,6 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self,
273277 self -> stopping = false;
274278 i2s_buffer_fill (self );
275279
276- NRF_I2S -> CONFIG .CHANNELS = self -> channel_count == 1 ? I2S_CONFIG_CHANNELS_CHANNELS_Left : I2S_CONFIG_CHANNELS_CHANNELS_Stereo ;
277-
278-
279280 NRF_I2S -> RXTXD .MAXCNT = self -> buffer_length / 4 ;
280281 NRF_I2S -> ENABLE = I2S_ENABLE_ENABLE_Enabled ;
281282
You can’t perform that action at this time.
0 commit comments