From e38653a2cdbc5a69c1f264689f5661a1c9ee2bb3 Mon Sep 17 00:00:00 2001 From: pennam Date: Mon, 12 May 2025 15:00:25 +0200 Subject: [PATCH] Wire: I2CSlave: move out slave->read from critical section --- libraries/Wire/Wire.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp index 155ab4fc8..954f8c3af 100644 --- a/libraries/Wire/Wire.cpp +++ b/libraries/Wire/Wire.cpp @@ -170,10 +170,10 @@ void arduino::MbedI2C::receiveThd() { break; case mbed::I2CSlave::WriteGeneral: case mbed::I2CSlave::WriteAddressed: - core_util_critical_section_enter(); - rxBuffer.clear(); char buf[240]; c = slave->read(buf, sizeof(buf)); + core_util_critical_section_enter(); + rxBuffer.clear(); for (buf_idx = 0; buf_idx < c; buf_idx++) { if (rxBuffer.availableForStore()) { rxBuffer.store_char(uint8_t(buf[buf_idx])); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy