From 7548c239e625337e0db0a9f416ad7cc1d82f1579 Mon Sep 17 00:00:00 2001 From: Thomas Roell Date: Mon, 17 Sep 2018 21:39:12 -0600 Subject: [PATCH] Fix _tx_active handling for Wire Slave --- libraries/Wire/src/Wire.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp index 35b43d8c..b5fb7fa9 100644 --- a/libraries/Wire/src/Wire.cpp +++ b/libraries/Wire/src/Wire.cpp @@ -404,10 +404,13 @@ void TwoWire::EventCallback(uint32_t events) if (events & I2C_EVENT_TRANSMIT_REQUEST) { _tx_write = 0; + _tx_active = true; if(_requestCallback) { (*_requestCallback)(); } + + _tx_active = false; stm32l4_i2c_service(_i2c, &_tx_data[0], _tx_write); }