File tree 1 file changed +3
-12
lines changed
hardware/arduino/cores/arduino
1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -213,19 +213,10 @@ size_t Serial_::write(uint8_t c)
213
213
return 0 ;
214
214
}
215
215
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.
223
216
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 ;
229
220
}
230
221
231
222
Serial_ Serial;
You can’t perform that action at this time.
0 commit comments