aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/HardwareSerial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wirish/HardwareSerial.cpp')
-rw-r--r--wirish/HardwareSerial.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/wirish/HardwareSerial.cpp b/wirish/HardwareSerial.cpp
index e78156d..3036983 100644
--- a/wirish/HardwareSerial.cpp
+++ b/wirish/HardwareSerial.cpp
@@ -118,6 +118,9 @@ void HardwareSerial::end(void) {
*/
uint8 HardwareSerial::read(void) {
+ // Block until a byte becomes available, to save user confusion.
+ while (!this->available())
+ ;
return usart_getc(this->usart_device);
}