Skip to content

Commit

Permalink
When stopping a message midstream with setMessage(String()), make sur…
Browse files Browse the repository at this point in the history
…e not to leave a sender on (stop cleanly).
  • Loading branch information
markfickett committed Feb 21, 2011
1 parent c2dc61f commit 58c52f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions morse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ void MorseSender::setMessage(const String newMessage)

// Force startSending() before continueSending().
messageIndex = message.length();

// If a different message was in progress, make sure it stops cleanly.
if (timingIndex % 2 == 0) {
setOff();
}
}

void MorseSender::sendBlocking()
Expand Down

0 comments on commit 58c52f5

Please sign in to comment.