Skip to content

Commit 2b7bf53

Browse files
committed
clear DMA progress flag on end and make it volatile
1 parent 0a430af commit 2b7bf53

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

libraries/I2S/src/I2S.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,15 @@ void I2SClass::end()
116116
DMA.freeChannel(_dmaChannel);
117117
}
118118

119+
_dmaTransferInProgress = false;
120+
119121
i2sd.disableSerializer(_deviceIndex);
120122
i2sd.disableClockUnit(_deviceIndex);
121123

122124
pinMode(_sdPin, INPUT);
123125
pinMode(_fsPin, INPUT);
124126
pinMode(_sckPin, INPUT);
125127

126-
127128
disableClock();
128129

129130
_beginCount--;

libraries/I2S/src/I2S.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class I2SClass : public Stream
7373

7474
int _dmaChannel;
7575

76-
bool _dmaTransferInProgress;
76+
volatile bool _dmaTransferInProgress;
7777
I2SDoubleBuffer _doubleBuffer;
7878

7979
void (*_onTransmit)(void);

0 commit comments

Comments
 (0)