Skip to content

Commit

Permalink
Use send_now to ensure faster communication via Serial (#13)
Browse files Browse the repository at this point in the history
* Use send_now to trigger faster communication through serial.

* Use python 3.9 in anticipation
  • Loading branch information
hmaarrfk authored Oct 11, 2022
1 parent a9904b8 commit febb48c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- '3.7'
- '3.9'
sudo: false
cache:
directories:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 0.0.18

* Use send_now to trigger a communication event once a command has been processed.

### 0.0.17

* Add the ability to do SPI byte reads
Expand Down
7 changes: 7 additions & 0 deletions src/commandrouting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,12 @@ int CommandRouter::processSerialStream() {
Serial.print(buffer);
}
Serial.print("\n");

// Call send_now on success to ensure that the response is immediate
// Otherwise, the serial buffer will wait for up to 5 ms
// for the buffer to get full (it never will) before sending any data
// https://www.pjrc.com/teensy/td_serial.html
Serial.send_now();

return result;
}

0 comments on commit febb48c

Please sign in to comment.