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 @@ -205,28 +205,14 @@ void Serial_::flush(void)
205205
206206size_t Serial_::write (const uint8_t *buffer, size_t size)
207207{
208- /* only try to send bytes if the high-level CDC connection itself
209- is open (not just the pipe) - the OS should set lineState when the port
210- is opened and clear lineState when the port is closed.
211- bytes sent before the user opens the connection or after
212- the connection is closed are lost - just like with a UART. */
213-
214- // TODO - ZE - check behavior on different OSes and test what happens if an
215- // open connection isn't broken cleanly (cable is yanked out, host dies
216- // or locks up, or host virtual serial port hangs)
217- if (_usbLineInfo.lineState > 0 ) // Problem with Windows(R)
218- {
219- uint32_t r = usb.send (CDC_ENDPOINT_IN, buffer, size);
208+ uint32_t r = usb.send (CDC_ENDPOINT_IN, buffer, size);
220209
221- if (r > 0 ) {
222- return r;
223- } else {
224- setWriteError ();
225- return 0 ;
226- }
210+ if (r > 0 ) {
211+ return r;
212+ } else {
213+ setWriteError ();
214+ return 0 ;
227215 }
228- setWriteError ();
229- return 0 ;
230216}
231217
232218size_t Serial_::write (uint8_t c) {
You can’t perform that action at this time.
0 commit comments