Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit142f272

Browse files
authored
Merge pull request#1061 from pennam/i2c-slave-fix-3
Wire: I2CSlave: move out slave->read from critical section
2 parents376aabf +e38653a commit142f272

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎libraries/Wire/Wire.cpp‎

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp