Skip to content

Commit

Permalink
Modulino: avoid calling read() and write() and address >= 0x7F
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Jun 10, 2024
1 parent b89cb1f commit 5295a5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Modulino.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Module : public Printable {
return Modulino._wire;
}
bool read(uint8_t* buf, int howmany) {
if (address == 0xFF) {
if (address >= 0x7F) {
return false;
}
Modulino._wire->requestFrom(address, howmany + 1);
Expand All @@ -72,7 +72,7 @@ class Module : public Printable {
return true;
}
bool write(uint8_t* buf, int howmany) {
if (address == 0xFF) {
if (address >= 0x7F) {
return false;
}
Modulino._wire->beginTransmission(address);
Expand Down

0 comments on commit 5295a5f

Please sign in to comment.