Skip to content
Snippets Groups Projects
Commit 9a7f2be3 authored by Sandeep Mistry's avatar Sandeep Mistry
Browse files

Wire slave sender working with stops and with repeated starts

parent ab2ed909
No related merge requests found
......@@ -220,7 +220,7 @@ void TwoWire::onService(void)
if ( sercom->isSlaveWIRE() )
{
if(sercom->isStopDetectedWIRE() ||
(sercom->isAddressMatch() && sercom->isRestartDetectedWIRE())) //Stop or Restart detected
(sercom->isAddressMatch() && sercom->isRestartDetectedWIRE() && !sercom->isMasterReadOperationWIRE())) //Stop or Restart detected
{
sercom->prepareAckBitWIRE();
sercom->prepareCommandBitsWire(0x03);
......@@ -240,6 +240,10 @@ void TwoWire::onService(void)
if(sercom->isMasterReadOperationWIRE()) //Is a request ?
{
// wait for data ready flag,
// before calling request callback
while(!sercom->isDataReadyWIRE());
//Calling onRequestCallback, if exists
if(onRequestCallback)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment