Skip to content

Commit

Permalink
Merge branch 'f/line_ending'
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbig committed Sep 28, 2016
2 parents 5e4d316 + 39a25be commit 4cff795
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tiveda.ino
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,15 @@ void serialEvent() {
char inChar = (char)Serial.read();
serialBuffer += inChar;

if (inChar == '\n') {
message = serialBuffer;
serialBuffer = "";
if (inChar == '\n' || inChar == '\r') {
if (serialBuffer.length() <= 1) {
serialBuffer = "";
} else {
message = serialBuffer;
serialBuffer = "";

eventManager.queueEvent(GPS_MESSAGE_RECEIVED, 1);
eventManager.queueEvent(GPS_MESSAGE_RECEIVED, 1);
}
}
}
}
Expand Down

0 comments on commit 4cff795

Please sign in to comment.