File tree Expand file tree Collapse file tree 1 file changed +6
-20
lines changed Expand file tree Collapse file tree 1 file changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -256,28 +256,14 @@ void Serial_::flush(void)
256256
257257size_t Serial_::write (const uint8_t *buffer, size_t size)
258258{
259- /* only try to send bytes if the high-level CDC connection itself
260- is open (not just the pipe) - the OS should set lineState when the port
261- is opened and clear lineState when the port is closed.
262- bytes sent before the user opens the connection or after
263- the connection is closed are lost - just like with a UART. */
264-
265- // TODO - ZE - check behavior on different OSes and test what happens if an
266- // open connection isn't broken cleanly (cable is yanked out, host dies
267- // or locks up, or host virtual serial port hangs)
268- if (_usbLineInfo.lineState > 0 ) // Problem with Windows(R)
269- {
270- uint32_t r = usb.send (CDC_ENDPOINT_IN, buffer, size);
259+ uint32_t r = usb.send (CDC_ENDPOINT_IN, buffer, size);
271260
272- if (r > 0 ) {
273- return r;
274- } else {
275- setWriteError ();
276- return 0 ;
277- }
261+ if (r > 0 ) {
262+ return r;
263+ } else {
264+ setWriteError ();
265+ return 0 ;
278266 }
279- setWriteError ();
280- return 0 ;
281267}
282268
283269size_t Serial_::write (uint8_t c) {
You can’t perform that action at this time.
0 commit comments