Skip to content

Commit 6c7c974

Browse files
committed
Wire: I2C slave, exit critical section before calling onReceiveCb()
1 parent befeca3 commit 6c7c974

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: libraries/Wire/Wire.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,11 @@ void arduino::MbedI2C::receiveThd() {
180180
}
181181
}
182182
if (rxBuffer.available() > 0 && onReceiveCb != NULL) {
183+
core_util_critical_section_exit();
183184
onReceiveCb(rxBuffer.available());
185+
} else {
186+
core_util_critical_section_exit();
184187
}
185-
core_util_critical_section_exit();
186188
//slave->stop();
187189
break;
188190
case mbed::I2CSlave::NoData:

0 commit comments

Comments
 (0)