Skip to content

Commit b04985d

Browse files
committed
Update _instance value when onReceive is called from user Sketch
1 parent 47aa898 commit b04985d

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
@@ -102,6 +102,9 @@ int PDMClass::read(void* buffer, size_t size)
102102
void PDMClass::onReceive(void(*function)(void))
103103
{
104104
_onReceive = function;
105+
if(_instance != this) {
106+
_instance = this;
107+
}
105108
}
106109

107110
void PDMClass::setGain(int gain)

0 commit comments

Comments
 (0)