Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Arduino Core for SAMD21 CPU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
josc941e
Arduino Core for SAMD21 CPU
Commits
ab2ed909
Commit
ab2ed909
authored
9 years ago
by
Sandeep Mistry
Browse files
Options
Downloads
Patches
Plain Diff
Wire slave receiver with repeated starts working
parent
4efe39eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/Wire/Wire.cpp
+16
-16
16 additions, 16 deletions
libraries/Wire/Wire.cpp
with
16 additions
and
16 deletions
libraries/Wire/Wire.cpp
+
16
−
16
View file @
ab2ed909
...
...
@@ -219,13 +219,26 @@ void TwoWire::onService(void)
{
if
(
sercom
->
isSlaveWIRE
()
)
{
if
(
sercom
->
isAddressMatch
())
//Address Match
if
(
sercom
->
isStopDetectedWIRE
()
||
(
sercom
->
isAddressMatch
()
&&
sercom
->
isRestartDetectedWIRE
()))
//Stop or Restart detected
{
sercom
->
prepareAckBitWIRE
();
sercom
->
prepareCommandBitsWire
(
0x03
);
//Is a request ?
if
(
sercom
->
isMasterReadOperationWIRE
())
//Calling onReceiveCallback, if exists
if
(
onReceiveCallback
)
{
onReceiveCallback
(
available
());
}
rxBuffer
.
clear
();
}
else
if
(
sercom
->
isAddressMatch
())
//Address Match
{
sercom
->
prepareAckBitWIRE
();
sercom
->
prepareCommandBitsWire
(
0x03
);
if
(
sercom
->
isMasterReadOperationWIRE
())
//Is a request ?
{
//Calling onRequestCallback, if exists
if
(
onRequestCallback
)
...
...
@@ -247,19 +260,6 @@ void TwoWire::onService(void)
sercom
->
prepareCommandBitsWire
(
0x03
);
}
else
if
(
sercom
->
isStopDetectedWIRE
()
||
sercom
->
isRestartDetectedWIRE
())
//Stop or Restart detected
{
sercom
->
prepareAckBitWIRE
();
sercom
->
prepareCommandBitsWire
(
0x03
);
//Calling onReceiveCallback, if exists
if
(
onReceiveCallback
)
{
onReceiveCallback
(
available
());
}
rxBuffer
.
clear
();
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment