anilgkts / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

USB CDC (Serial) write on Leonardo is blocking. #948

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
From Mike King on the developers list:

"Serial_::write uses the function USB_Send to send data.  USB_Send is a
blocking function.  Is there away to make the virtual serial
connection non-blocking like it was on the Uno?  I need to read from
the ADC a 1000 times per second and send the result to a computer for
processing.  I measured the virtual serial bandwidth to be between 40
and 45 kBps on the Leonardo.  I like to measure the voltage once per
1ms with the smallest "jitter."  If I use a blocking write function
then I won't be sampling the ADC a 1000 times per second."

Original issue reported on code.google.com by dmel...@gmail.com on 6 Jun 2012 at 1:34