Hello!

I am using CDC ACM as a debug logging interface, so sometimes there is a 
USB cable connected, and sometimes there isn't.

My send routine looks like this -

     int ret = 0;

     do
     {
         ret = usbd_ep_write_packet(usbd_dev, 0x82, data, size);
     }
     while (ret == 0);

However, if I call this function when either the USB cable isn't plugged 
in or serial monitor is not opened on the computer, usbd_ep_write_packet 
will just keep returning 0.

Is there a way around this? Is there a way to tell whether the function 
returned zero because there is no receiver, or if it returned zero 
because it's busy and we should retry? Detecting whether the cable is 
plugged in (or even whether the device is enumerated) is insufficient.

Thanks!
Matthew

------------------------------------------------------------------------------
Presto, an open source distributed SQL query engine for big data, initially
developed by Facebook, enables you to easily query your data on Hadoop in a 
more interactive manner. Teradata is also now providing full enterprise
support for Presto. Download a free open source copy now.
http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
_______________________________________________
libopencm3-devel mailing list
libopencm3-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel

Reply via email to