Skip to content

Navigation Menu

Sign in
Appearance settings

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 e38653a

Browse filesBrowse files
committed
Wire: I2CSlave: move out slave->read from critical section
1 parent 376aabf commit e38653a
Copy full SHA for e38653a

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.