summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Midi.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/Midi.cpp b/Midi.cpp
index 2b95eed..b5655de 100644
--- a/Midi.cpp
+++ b/Midi.cpp
@@ -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());
}
}