Skip to content

Commit

Permalink
nRF52: Stereo mode not set back to mono
Browse files Browse the repository at this point in the history
  • Loading branch information
TMRh20 committed Oct 23, 2024
1 parent 1cb6996 commit 69f18ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void setup() {
void loop() {

aaAudio.getADC(320); // Get 320 Samples from the ADC
for (int i = 0; i < 320; i++) { // Copy them into the DAC Buffer and change from signed to unsigned ( + 0x8000)
for (int i = 0; i < 320; i++) { // Copy them into the DAC Buffer
aaAudio.dacBuffer16[i] = (uint16_t)(aaAudio.adcBuffer16[i]);
}
aaAudio.feedDAC(0,320); // Feed the DAC with the ADC data
Expand Down
2 changes: 2 additions & 0 deletions src/NRF52840/AutoAnalogAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ void AutoAnalog::setSampleRate(uint32_t sampRate, bool stereo){

if(stereo){
NRF_I2S->CONFIG.CHANNELS = I2S_CONFIG_CHANNELS_CHANNELS_STEREO << I2S_CONFIG_CHANNELS_CHANNELS_Pos;
}else{
NRF_I2S->CONFIG.CHANNELS = I2S_CONFIG_CHANNELS_CHANNELS_LEFT << I2S_CONFIG_CHANNELS_CHANNELS_Pos;
}

if(sampRate <= 16000){
Expand Down

0 comments on commit 69f18ae

Please sign in to comment.