Signed-off-by: Jesse Vincent <jesse@keyboard.io>
pull/1105/head
Jesse Vincent 3 years ago
parent 54fbb04eb6
commit fbfede3566
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -35,7 +35,7 @@ EventHandlerResult FocusSerial::afterEachCycle() {
do {
command_[buf_cursor_++] = Runtime.serialPort().read();
} while ( command_[buf_cursor_ - 1] != SEPARATOR
} while (command_[buf_cursor_ - 1] != SEPARATOR
&& buf_cursor_ < sizeof(command_)
&& Runtime.serialPort().available()
&& (Runtime.serialPort().peek() != NEWLINE));
@ -48,7 +48,7 @@ EventHandlerResult FocusSerial::afterEachCycle() {
return EventHandlerResult::OK;
}
if ( (command_[buf_cursor_ - 1] != SEPARATOR) && (Runtime.serialPort().peek() != NEWLINE)
if ((command_[buf_cursor_ - 1] != SEPARATOR) && (Runtime.serialPort().peek() != NEWLINE)
&& buf_cursor_ < sizeof(command_)
) {
// We don't have enough command to work with yet.
@ -58,7 +58,7 @@ EventHandlerResult FocusSerial::afterEachCycle() {
// If this was a command with a space-delimited payload,
// strip the space delimiter off
if ( (command_[buf_cursor_ - 1] == SEPARATOR) ) {
if ((command_[buf_cursor_ - 1] == SEPARATOR)) {
command_[buf_cursor_ - 1] = '\0';
}

Loading…
Cancel
Save