diff options
author | David A. Mellis <d.mellis@arduino.cc> | 2011-08-26 16:08:14 -0400 |
---|---|---|
committer | David A. Mellis <d.mellis@arduino.cc> | 2011-08-26 16:08:14 -0400 |
commit | 5130a1329462aa36d5f18e31851d3d9d5086e411 (patch) | |
tree | 373c33573e5e998d7febe50bc94526e63a61de57 /cores/arduino/HardwareSerial.cpp | |
parent | 0635790dd111e91e5c488acc599cc404dc707abd (diff) |
Moving write errors out of return value into separate API methods.
write(), print(), println() now return size_t (and don't use negative values to signal errors).
Print adds writeError() for checking for write errors, clearWriteError() to reset the flag to false, and a protected setWriteError() for signalling errors.
http://code.google.com/p/arduino/issues/detail?id=598
Diffstat (limited to 'cores/arduino/HardwareSerial.cpp')
-rw-r--r-- | cores/arduino/HardwareSerial.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index 641c973..d6be218 100644 --- a/cores/arduino/HardwareSerial.cpp +++ b/cores/arduino/HardwareSerial.cpp @@ -352,7 +352,7 @@ void HardwareSerial::flush() ; } -ssize_t HardwareSerial::write(uint8_t c) +size_t HardwareSerial::write(uint8_t c) { int i = (_tx_buffer->head + 1) % SERIAL_BUFFER_SIZE; |