Added serial buffer flush option

This commit is contained in:
David Madison 2017-06-08 16:28:17 -04:00
parent ed8eab001b
commit c559b3949f
1 changed files with 10 additions and 0 deletions

View File

@ -40,6 +40,7 @@ static const uint16_t
// --- Optional Settings (uncomment to add)
//#define CLEAR_ON_START // LEDs are cleared on reset
//#define SERIAL_FLUSH // Serial buffer cleared on LED latch
//#define GROUND_PIN 10 // additional grounding pin (optional)
//#define CALIBRATE // sets all LEDs to the color of the first
@ -214,6 +215,9 @@ void dataMode(){
FastLED.show();
D_FPS;
D_LED(OFF);
#ifdef SERIAL_FLUSH
serialFlush();
#endif
}
}
@ -245,3 +249,9 @@ void timeouts(){
}
}
}
void serialFlush(){
while(Serial.available() > 0) {
byte r = Serial.read();
}
}