Endless loop. usbInterruptIsReady3() usbSetInterrupt3()

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()

Post by ulao » Wed Jun 26, 2013 4:54 pm

you switched you examples above. You put the 2 end points under your 1 example ;) anyways I got what I needed to see. This is the correct way of dong so, now your issue is the same right, endless loop?

mega_mozg_13
Posts: 12
Joined: Tue Dec 11, 2012 4:33 pm

Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()

Post by mega_mozg_13 » Wed Jun 26, 2013 7:32 pm

ulao wrote:now your issue is the same right, endless loop?

yes... same as my first message in topic.

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()

Post by ulao » Thu Jun 27, 2013 4:17 am

Well I gave it a try here with better success. I was able to added the 3rd and use the write with no loop. Though I didnt try the composite device just a normal device.

Here is what I used and it works great. With one issue.

Code: Select all


uchar my_usbDescriptorConfiguration[] = {    /* USB configuration descriptor */
     9,          /* sizeof(usbDescriptorConfiguration): length of descriptor in bytes */
    USBDESCR_CONFIG,    /* descriptor type */
    18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT3 + 7 + 9, 0,
                /* total length of data returned (including inlined descriptors) */
    1,          /* number of interfaces in this configuration */
    1,          /* index of this configuration */
    0,          /* configuration name string index */
    USB_CFG_IS_SELF_POWERED,  /* attributes */

    USB_CFG_MAX_BUS_POWER/2,            /* max USB current in 2mA units */
/* interface descriptor follows inline: */
    9,          /* sizeof(usbDescrInterface): length of descriptor in bytes */
    USBDESCR_INTERFACE, /* descriptor type */
    0,          /* index of this interface */
    0,          /* alternate setting for this interface */
    USB_CFG_HAVE_INTRIN_ENDPOINT + USB_CFG_HAVE_INTRIN_ENDPOINT3,   /* endpoints excl 0: number of endpoint descriptors to follow */
    USB_CFG_INTERFACE_CLASS,
    USB_CFG_INTERFACE_SUBCLASS,
    USB_CFG_INTERFACE_PROTOCOL,
    0,          /* string index for interface */

    9,          /* sizeof(usbDescrHID): length of descriptor in bytes */
    USBDESCR_HID,   /* descriptor type: HID */
    0x10, 0x01, /* BCD representation of HID version */
    0x00,       /* target country code */
    0x01,       /* number of HID Report (or other HID class) Descriptor infos to follow */
    0x22,       /* descriptor type: report */
    USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0,  /* total length of report descriptor *///
//#endif


#if USB_CFG_HAVE_INTRIN_ENDPOINT    /* endpoint descriptor for endpoint 1 */
    7,          /* sizeof(usbDescrEndpoint) */
    USBDESCR_ENDPOINT,  /* descriptor type = endpoint */
   0x81,       // bulk IN endpoint number 1
    0x03,       /* attrib: Interrupt endpoint */
    8, 0,       /* maximum packet size */
    0x04, /* in ms*/
#endif   

#if USB_CFG_HAVE_INTRIN_ENDPOINT3
   7,          // sizeof(usbDescrEndpoint)
   5,  // descriptor type = endpoint
   (char)(0x80 | USB_CFG_EP3_NUMBER),       // bulk IN endpoint number 1
   0x03,       // attrib: Interrupt endpoint
   8, 0,       // maximum packet size
   0x04,
#endif

   //the output.
   7,          // sizeof(usbDescrEndpoint)
   5,  // descriptor type = endpoint
   0x02,      // out endpoint number 2
   0x03,       // attrib: Interrupt endpoint
   8, 0,       // maximum packet size
   USB_CFG_INTR_POLL_INTERVAL, // in ms
};


my issue is
while (!usbInterruptIsReady()){usbPoll(); } usbSetInterrupt( reportBuffer, 8); works
while (!usbInterruptIsReady3()){usbPoll(); } usbSetInterrupt3( reportBuffer, 8); didnt not.

Again no loop, but I just could not receive from my pipe. Its more then likely an over site ill keep o nit for a bit tonight.

Post Reply