Skip to content

Commit

Permalink
improved usages of delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Legion2 committed Nov 29, 2020
1 parent 72eaa99 commit 38067e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/SomfyRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ void SomfyRemote::sendCommand(Command command) {
sendFrame(frame, 2);
for (int i = 0; i < 4; i++) {
sendFrame(frame, 7);
yield();
}
}

Expand Down Expand Up @@ -77,8 +76,8 @@ void SomfyRemote::sendFrame(byte *frame, byte sync) {
if (sync == 2) { // Only with the first frame.
// Wake-up pulse & Silence
sendHigh(9415);
sendLow(89565);
// delay(80);
sendLow(9565);
delay(80);
}

// Hardware sync: two sync for the first frame, seven for the following ones.
Expand All @@ -103,8 +102,8 @@ void SomfyRemote::sendFrame(byte *frame, byte sync) {
}

// Inter-frame silence
sendLow(30415);
// delay(30);
sendLow(415);
delay(30);
}

void SomfyRemote::sendHigh(uint16_t durationInMicroseconds) {
Expand Down
2 changes: 1 addition & 1 deletion src/SomfyRemote.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ class SomfyRemote {
void sendCommand(Command command);
};

Command getSomfyCommand(const String& string);
Command getSomfyCommand(const String &string);

0 comments on commit 38067e1

Please sign in to comment.