Page 1 of 1

very time cost function in v-usb

Posted: Fri Oct 23, 2009 10:35 am
by dehghanimeh
when i using a very time cost function(2s to 12s) in usbFunctionWrite or usbFunctionRead (hid-data sample)the usb device disconnected.
i use usbPoll function in my function and upgrate my crystal to 20mhz .but stay my problem
how can i solve this problem?
thank you

Re: very time cost function in v-usb

Posted: Mon Oct 26, 2009 11:06 pm
by christian
You must not perform any long lasting actions in these functions. And you must not call usbPoll() from within usbFunction*().

If you have to do long lasting processing, collect the data in a buffer and perform the processing in the main loop. You can easily call usbPoll() from there.