very time cost function in v-usb

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
dehghanimeh
Posts: 6
Joined: Mon Jan 12, 2009 11:04 am

very time cost function in v-usb

Post by dehghanimeh » Fri Oct 23, 2009 10:35 am

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

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Re: very time cost function in v-usb

Post by christian » Mon Oct 26, 2009 11:06 pm

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.

Post Reply