Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved I2C reply to request handler

A comment in the Wire.cpp file states that Wire.send() "must be called
in: slave tx event callback" (line 128-129) so the reply has been moved
to the request handler function (reqHandler).
  • Loading branch information...
commit d6f1efa65e40f3849532bcd016d904f9c4fdf232 1 parent ee09c3b
@dnet authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  hack2o.pde
View
2  hack2o.pde
@@ -68,6 +68,7 @@ void recHandler(int numBytes) {
}
void reqHandler() {
+ Wire.send(i2cmd);
letgo = 1;
}
@@ -102,7 +103,6 @@ void loop() {
if (letgo) {
Serial.print("Received request CMD = ");
Serial.println(i2cmd, DEC);
- Wire.send(i2cmd);
if (i2cmd != 0) flow();
letgo = 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.