diff options
author | Federico Vanzati <f.vanzati@gmail.com> | 2012-04-06 17:36:09 +0200 |
---|---|---|
committer | Federico Vanzati <f.vanzati@gmail.com> | 2012-04-06 17:36:09 +0200 |
commit | 02c5849501294f2965051c41e1236899a55f7bfc (patch) | |
tree | c3f4c2119b2c2129d8948b872920a235286dbb40 /cores/arduino | |
parent | dd55096901b163b315948e0ddee3706464b3ec26 (diff) |
Revert "added a short delay and comment to boolean operator in CDC"
This reverts commit ade4893f585e3e94fa6cf683620e1d12afc88ecd.
Diffstat (limited to 'cores/arduino')
-rw-r--r-- | cores/arduino/CDC.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp index c1e646d..1275304 100644 --- a/cores/arduino/CDC.cpp +++ b/cores/arduino/CDC.cpp @@ -213,19 +213,10 @@ size_t Serial_::write(uint8_t c) return 0; } -// This operator is a convenient way for a sketch to check whether the -// port has actually been configured and opened by the host (as opposed -// to just being connected to the host). It can be used, for example, in -// setup() before printing to ensure that an application on the host is -// actually ready to receive and display the data. -// We add a short delay before returning to fix a bug observed by Federico -// where the port is configured (lineState != 0) but not quite opened. Serial_::operator bool() { - bool result = false; - if (_usbLineInfo.lineState > 0) - result = true; - delay(10); - return result; + if (_usbLineInfo.lineState > 0) + return true; + return false; } Serial_ Serial; |