??? 01/26/06 15:56 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#108377 - SEND_REQUESTED_DESCRIPTOR Responding to: ???'s previous message |
Hi Mehdi,
SEND_REQUESTED_DESCRIPTOR must be called after SetUp packet detection and validation, and before Control-IN interrupt. Until SEND_REQUESTED_DESCRIPTOR fills the Control-IN buffer with the first part of the device descriptor, Control-IN interrupt doesn't occur. Call it in the mainloop. Modify your code as follows - Make two flags, FLAG_USB_TRANSMIT and FLAG_CTRL_IN - Clear these flags in initialization In the ISR, - Set both flags after the validation in CONTROL_OUT_INTERRUPT - Set FLAG_CTRL_IN in CONTROL_IN_INTERRUPT - Delete "CALL SEND_REQUESTED_DESCRIPTOR" in CONTROL_IN_INTERRUPT. It is moved to the mainloop. In the mainloop, - If both of FLAG_USB_TRANSMIT and FLAG_CTRL_IN are set, call SEND_REQUESTED_DESCRIPTOR - Clear FLAG_CTRL_IN after calling SEND_REQUESTED_DESCRIPTOR In SEND_REQUESTED_DESCRIPTOR routine, - Clear FLAG_USB_TRANSMIT when the last packet is written to the Control-IN buffer. Tsuneo |