Skip to content

Commit 200eefb

Browse files
committed
Revert "added a short delay and comment to boolean operator in CDC"
This reverts commit ade4893.
1 parent 383ac95 commit 200eefb

File tree

1 file changed

+3
-12
lines changed
  • hardware/arduino/cores/arduino

1 file changed

+3
-12
lines changed

hardware/arduino/cores/arduino/CDC.cpp

+3-12
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,10 @@ size_t Serial_::write(uint8_t c)
213213
return 0;
214214
}
215215

216-
// This operator is a convenient way for a sketch to check whether the
217-
// port has actually been configured and opened by the host (as opposed
218-
// to just being connected to the host). It can be used, for example, in
219-
// setup() before printing to ensure that an application on the host is
220-
// actually ready to receive and display the data.
221-
// We add a short delay before returning to fix a bug observed by Federico
222-
// where the port is configured (lineState != 0) but not quite opened.
223216
Serial_::operator bool() {
224-
bool result = false;
225-
if (_usbLineInfo.lineState > 0)
226-
result = true;
227-
delay(10);
228-
return result;
217+
if (_usbLineInfo.lineState > 0)
218+
return true;
219+
return false;
229220
}
230221

231222
Serial_ Serial;

0 commit comments

Comments
 (0)