Skip to content

Commit 370fb87

Browse files
committed
Check _instance when begin is called and return error if is not matching
1 parent d8b397b commit 370fb87

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/PDM/src/stm32/PDM.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ int PDMClass::begin(int channels, long sampleRate) {
6565
i2c.write(8 << 1, data, sizeof(data));
6666
}
6767

68+
if(_instance != this) {
69+
return 0;
70+
}
71+
6872
_channels = channels;
6973
_samplerate = sampleRate;
7074

0 commit comments

Comments
 (0)