diff options
| author | Peter Teichman <peter@teichman.org> | 2011-12-04 13:43:24 -0500 |
|---|---|---|
| committer | Peter Teichman <peter@teichman.org> | 2011-12-04 17:18:27 -0500 |
| commit | 4eefaaaeff30fd2a9dcea6627364dfc52d8ac76f (patch) | |
| tree | eb4f689bb59112a2d2fd4b9350c4a5c7d25ec706 | |
| parent | 1c0d64f96e5d2bbdecf053e258459fe2f101ac22 (diff) | |
The Maple API returns an unsigned char from read(), making
the old check for -1 incorrect.
| -rw-r--r-- | Midi.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -225,13 +225,10 @@ void Midi::recvByte(int byte) // Try to read data at serial port & pass anything read to processing function void Midi::poll(void) { - int c; - - // Just keep sucking data from serial port until it runs out, processing // MIDI messages as we go - while((c = serial_.read()) != -1) { - recvByte(c); + while(serial_.available() > 0) { + recvByte(serial_.read()); } } |
