File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ void TwoWire::onService(void)
220
220
if ( sercom->isSlaveWIRE () )
221
221
{
222
222
if (sercom->isStopDetectedWIRE () ||
223
- (sercom->isAddressMatch () && sercom->isRestartDetectedWIRE ())) // Stop or Restart detected
223
+ (sercom->isAddressMatch () && sercom->isRestartDetectedWIRE () && !sercom-> isMasterReadOperationWIRE () )) // Stop or Restart detected
224
224
{
225
225
sercom->prepareAckBitWIRE ();
226
226
sercom->prepareCommandBitsWire (0x03 );
@@ -240,6 +240,10 @@ void TwoWire::onService(void)
240
240
241
241
if (sercom->isMasterReadOperationWIRE ()) // Is a request ?
242
242
{
243
+ // wait for data ready flag,
244
+ // before calling request callback
245
+ while (!sercom->isDataReadyWIRE ());
246
+
243
247
// Calling onRequestCallback, if exists
244
248
if (onRequestCallback)
245
249
{
You can’t perform that action at this time.
0 commit comments