Skip to content

Commit a1b7130

Browse files
committed
Update _instance value when onReceive is called from user Sketch
1 parent c4d43bb commit a1b7130

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/PDM/src/stm32/PDM.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ int PDMClass::read(void* buffer, size_t size)
105105
void PDMClass::onReceive(void(*function)(void))
106106
{
107107
_onReceive = function;
108+
if(_instance != this) {
109+
_instance = this;
110+
}
108111
}
109112

110113
void PDMClass::setGain(int gain)

0 commit comments

Comments
 (0)