Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 142f272

Browse filesBrowse files
authored
Merge pull request #1061 from pennam/i2c-slave-fix-3
Wire: I2CSlave: move out slave->read from critical section
2 parents 376aabf + e38653a commit 142f272
Copy full SHA for 142f272

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎libraries/Wire/Wire.cpp

Copy file name to clipboardExpand all lines: libraries/Wire/Wire.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ void arduino::MbedI2C::receiveThd() {
170170
break;
171171
case mbed::I2CSlave::WriteGeneral:
172172
case mbed::I2CSlave::WriteAddressed:
173-
core_util_critical_section_enter();
174-
rxBuffer.clear();
175173
char buf[240];
176174
c = slave->read(buf, sizeof(buf));
175+
core_util_critical_section_enter();
176+
rxBuffer.clear();
177177
for (buf_idx = 0; buf_idx < c; buf_idx++) {
178178
if (rxBuffer.availableForStore()) {
179179
rxBuffer.store_char(uint8_t(buf[buf_idx]));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.