<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/8450" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2013-06-27T04:17:51+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/8450</id>

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2013-06-27T04:17:51+02:00</updated>

		<published>2013-06-27T04:17:51+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25512#p25512</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25512#p25512"/>
		<title type="html"><![CDATA[Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25512#p25512"><![CDATA[
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. <br /><br />Here is what I used and it works great. With one issue. <br /><div class="codebox"><p>Code: </p><pre><code><br />uchar my_usbDescriptorConfiguration&#91;&#93; = {    /* USB configuration descriptor */<br />     9,          /* sizeof(usbDescriptorConfiguration): length of descriptor in bytes */<br />    USBDESCR_CONFIG,    /* descriptor type */<br />    18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT3 + 7 + 9, 0,<br />                /* total length of data returned (including inlined descriptors) */<br />    1,          /* number of interfaces in this configuration */<br />    1,          /* index of this configuration */<br />    0,          /* configuration name string index */<br />    USB_CFG_IS_SELF_POWERED,  /* attributes */<br /><br />    USB_CFG_MAX_BUS_POWER/2,            /* max USB current in 2mA units */<br />/* interface descriptor follows inline: */<br />    9,          /* sizeof(usbDescrInterface): length of descriptor in bytes */<br />    USBDESCR_INTERFACE, /* descriptor type */<br />    0,          /* index of this interface */<br />    0,          /* alternate setting for this interface */<br />    USB_CFG_HAVE_INTRIN_ENDPOINT + USB_CFG_HAVE_INTRIN_ENDPOINT3,   /* endpoints excl 0: number of endpoint descriptors to follow */<br />    USB_CFG_INTERFACE_CLASS,<br />    USB_CFG_INTERFACE_SUBCLASS,<br />    USB_CFG_INTERFACE_PROTOCOL,<br />    0,          /* string index for interface */<br /><br />    9,          /* sizeof(usbDescrHID): length of descriptor in bytes */<br />    USBDESCR_HID,   /* descriptor type: HID */<br />    0x10, 0x01, /* BCD representation of HID version */<br />    0x00,       /* target country code */<br />    0x01,       /* number of HID Report (or other HID class) Descriptor infos to follow */<br />    0x22,       /* descriptor type: report */<br />    USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0,  /* total length of report descriptor *///<br />//#endif<br /><br /><br />#if USB_CFG_HAVE_INTRIN_ENDPOINT    /* endpoint descriptor for endpoint 1 */<br />    7,          /* sizeof(usbDescrEndpoint) */ <br />    USBDESCR_ENDPOINT,  /* descriptor type = endpoint */<br />   0x81,       // bulk IN endpoint number 1 <br />    0x03,       /* attrib: Interrupt endpoint */<br />    8, 0,       /* maximum packet size */ <br />    0x04, /* in ms*/<br />#endif   <br /><br />#if USB_CFG_HAVE_INTRIN_ENDPOINT3<br />   7,          // sizeof(usbDescrEndpoint)<br />   5,  // descriptor type = endpoint<br />   (char)(0x80 | USB_CFG_EP3_NUMBER),       // bulk IN endpoint number 1<br />   0x03,       // attrib: Interrupt endpoint<br />   8, 0,       // maximum packet size<br />   0x04,<br />#endif<br /><br />   //the output.<br />   7,          // sizeof(usbDescrEndpoint)<br />   5,  // descriptor type = endpoint<br />   0x02,      // out endpoint number 2 <br />   0x03,       // attrib: Interrupt endpoint <br />   8, 0,       // maximum packet size <br />   USB_CFG_INTR_POLL_INTERVAL, // in ms <br />};</code></pre></div><br /><br />my issue is <br />while (!usbInterruptIsReady()){usbPoll(); } usbSetInterrupt( reportBuffer, <img class="smilies" src="./../../../images/smilies/icon_cool.gif" alt="8)" title="Cool" />;  works<br />while (!usbInterruptIsReady3()){usbPoll(); } usbSetInterrupt3( reportBuffer, <img class="smilies" src="./../../../images/smilies/icon_cool.gif" alt="8)" title="Cool" />;  didnt not.<br /><br />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.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Thu Jun 27, 2013 4:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mega_mozg_13]]></name></author>
		<updated>2013-06-26T19:32:28+02:00</updated>

		<published>2013-06-26T19:32:28+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25510#p25510</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25510#p25510"/>
		<title type="html"><![CDATA[Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25510#p25510"><![CDATA[
<blockquote><div><cite>ulao wrote:</cite>now your issue is the same right, endless loop?</div></blockquote><br />yes... same as my first message in topic.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=11426">mega_mozg_13</a> — Wed Jun 26, 2013 7:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2013-06-26T16:54:42+02:00</updated>

		<published>2013-06-26T16:54:42+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25509#p25509</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25509#p25509"/>
		<title type="html"><![CDATA[Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25509#p25509"><![CDATA[
you switched you examples above. You put the 2 end points under your 1 example <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=";)" title="Wink" /> 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?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Wed Jun 26, 2013 4:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mega_mozg_13]]></name></author>
		<updated>2013-06-26T15:58:35+02:00</updated>

		<published>2013-06-26T15:58:35+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25508#p25508</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25508#p25508"/>
		<title type="html"><![CDATA[Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25508#p25508"><![CDATA[
<blockquote><div><cite>ulao wrote:</cite>Remember usbSetInterrupt3() is for  the 3rd, (default + 1 in + 2 in)</div></blockquote><br />1st - Endpoint is default builtin &quot;endpoint 0&quot;<br />2nd - Endpoint 81<br />3rd - Endpoint 82<br /><br />Try One interface<br /><div class="codebox"><p>Code: </p><pre><code>//Массив Дискриптор USB Configuration<br />static char dynamical_usbDescriptorConfiguration&#91;&#93; = {<br /><br />/*9 USB configuration descriptor */<br />    9,                                    //баит 0          /* sizeof(usbDescriptorConfiguration): length of descriptor in bytes */<br />    USBDESCR_CONFIG,                        //баит 1    /* descriptor type */<br />    9 + (9 + 9 + 7 + 7),<br />    0,<br />    1,                                    //баит4    /* number of interfaces in this configuration */<br />    1,                                    //баит5          /* index of this configuration */<br />    0,                                    //баит6          /* configuration name string index */<br />    USBATTR_BUSPOWER,   /* attributes */         //баит7<br />    USB_CFG_MAX_BUS_POWER/2,                     //баит8      /* max USB current in 2mA units */<br />   <br />/*9 interface 0 descriptor follows inline: */<br />    9,                                    //байт9          /* sizeof(usbDescrInterface): length of descriptor in bytes */<br />    USBDESCR_INTERFACE,                      //байт10/* descriptor type */<br />    0,                                    //байт11          /* index of this interface */<br />    0,                                    //байт12          /* alternate setting for this interface */<br />    2,                                      //байт13 /* endpoints excl 0: number of endpoint descriptors to follow */<br />    USB_CFG_INTERFACE_CLASS,                  //байт14<br />    USB_CFG_INTERFACE_SUBCLASS,                  //байт15<br />    USB_CFG_INTERFACE_PROTOCOL,                  //байт16   <br />    0,                                    //байт17          /* string index for interface */<br />   <br />/*9 interface 0 HID descriptor */<br />    9,                                    //байт18    /* sizeof(usbDescrHID): length of descriptor in bytes */<br />    USBDESCR_HID,                           //байт19   /* descriptor type: HID */<br />    0x01, 0x01,                            //байт20,21   /* BCD representation of HID version */<br />    0x00,                                  //байт22   /* target country code */<br />    0x01,                                 //байт23   /* number of HID Report (or other HID class) Descriptor infos to follow */<br />    0x22,                                  //байт24   /* descriptor type: report */<br />    USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0,        //байт25,26   /* total length of report descriptor */<br /><br /><br />/*7 interface 0 endpoint descriptor for endpoint 81 */<br />    7,                                     //байт27   /* sizeof(usbDescrEndpoint) */<br />    USBDESCR_ENDPOINT,                       //байт28   /* descriptor type = endpoint */<br />    0x81,                                  //байт29   /* IN endpoint number 81 */<br />    0x03,                                  //байт30   /* attrib: Interrupt endpoint */<br />    8, 0,                                  //байт31,32   /* maximum packet size */<br />    10,                                  //байт33   /* in ms */<br />   <br />/*7 interface 0 endpoint descriptor for endpoint 82 */<br />    7,                                     //байт27   /* sizeof(usbDescrEndpoint) */<br />    USBDESCR_ENDPOINT,                       //байт28   /* descriptor type = endpoint */<br />    0x82,                                  //байт29   /* IN endpoint number 81 */<br />    0x03,                                  //байт30   /* attrib: Interrupt endpoint */<br />    8, 0,                                  //байт31,32   /* maximum packet size */<br />    10,                                  //байт33   /* in ms */<br />   <br />   <br />};</code></pre></div><br />USBlyzer log <a href="http://mmjoy.googlecode.com/svn/wiki/trash/V_USB_EP81_EP82_interface1.ulz" class="postlink">http://mmjoy.googlecode.com/svn/wiki/trash/V_USB_EP81_EP82_interface1.ulz</a><br /><br /><br />I make &quot;my usbDescriptorConfiguration&quot; and try setup Two Interfaces:<br /><br /><div class="codebox"><p>Code: </p><pre><code>//Массив Дискриптор USB Configuration<br />static char dynamical_usbDescriptorConfiguration&#91;&#93; = {<br /><br />/*9 USB configuration descriptor */<br />    9,                                    //баит 0          /* sizeof(usbDescriptorConfiguration): length of descriptor in bytes */<br />    USBDESCR_CONFIG,                        //баит 1    /* descriptor type */<br />    9 + (9 + 9 + 7) + (9 + 9 + 7) ,<br />    0,<br />    2,                                    //баит4    /* number of interfaces in this configuration */<br />    1,                                    //баит5          /* index of this configuration */<br />    0,                                    //баит6          /* configuration name string index */<br />    USBATTR_BUSPOWER,   /* attributes */         //баит7<br />    USB_CFG_MAX_BUS_POWER/2,                     //баит8      /* max USB current in 2mA units */<br />   <br />/*9 interface 0 descriptor follows inline: */<br />    9,                                    //байт9          /* sizeof(usbDescrInterface): length of descriptor in bytes */<br />    USBDESCR_INTERFACE,                      //байт10/* descriptor type */<br />    0,                                    //байт11          /* index of this interface */<br />    0,                                    //байт12          /* alternate setting for this interface */<br />    USB_CFG_HAVE_INTRIN_ENDPOINT,                 //байт13 /* endpoints excl 0: number of endpoint descriptors to follow */<br />    USB_CFG_INTERFACE_CLASS,                  //байт14<br />    USB_CFG_INTERFACE_SUBCLASS,                  //байт15<br />    USB_CFG_INTERFACE_PROTOCOL,                  //байт16   <br />    0,                                    //байт17          /* string index for interface */<br />   <br />/*9 interface 0 HID descriptor */<br />    9,                                    //байт18    /* sizeof(usbDescrHID): length of descriptor in bytes */<br />    USBDESCR_HID,                           //байт19   /* descriptor type: HID */<br />    0x01, 0x01,                            //байт20,21   /* BCD representation of HID version */<br />    0x00,                                  //байт22   /* target country code */<br />    0x01,                                 //байт23   /* number of HID Report (or other HID class) Descriptor infos to follow */<br />    0x22,                                  //байт24   /* descriptor type: report */<br />    USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0,        //байт25,26   /* total length of report descriptor */<br /><br /><br />/*7 interface 0 endpoint descriptor for endpoint 81 */<br />    7,                                     //байт27   /* sizeof(usbDescrEndpoint) */<br />    USBDESCR_ENDPOINT,                       //байт28   /* descriptor type = endpoint */<br />    0x81,                                  //байт29   /* IN endpoint number 81 */<br />    0x03,                                  //байт30   /* attrib: Interrupt endpoint */<br />    8, 0,                                  //байт31,32   /* maximum packet size */<br />    10,                                  //байт33   /* in ms */<br />   <br />/*9 interface 1 descriptor follows inline: */<br />    9,                                    //байт34          /* sizeof(usbDescrInterface): length of descriptor in bytes */<br />    USBDESCR_INTERFACE,                      //байт35/* descriptor type */<br />    1,                                    //байт36          /* index of this interface */<br />    0,                                    //байт37          /* alternate setting for this interface */<br />    USB_CFG_HAVE_INTRIN_ENDPOINT3,                //байт38 /* endpoints excl 0: number of endpoint descriptors to follow */<br />    USB_CFG_INTERFACE_CLASS,                  //байт39<br />    USB_CFG_INTERFACE_SUBCLASS,                  //байт40<br />    USB_CFG_INTERFACE_PROTOCOL,                  //байт41   <br />    0,                                    //байт42          /* string index for interface */<br />   <br />/*9 interface 1 HID descriptor */<br />    9,                                    //байт43    /* sizeof(usbDescrHID): length of descriptor in bytes */<br />    USBDESCR_HID,                           //байт44   /* descriptor type: HID */<br />    0x01, 0x01,                            //байт45,46   /* BCD representation of HID version */<br />    0x00,                                  //байт47   /* target country code */<br />    0x01,                                 //байт48   /* number of HID Report (or other HID class) Descriptor infos to follow */<br />    0x22,                                  //байт49   /* descriptor type: report */<br />    USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0,        //байт50,51   /* total length of report descriptor */<br /><br /><br />/*7 interface 1 endpoint descriptor for endpoint 82 */<br />    7,                                     //байт52   /* sizeof(usbDescrEndpoint) */<br />    USBDESCR_ENDPOINT,                       //байт53   /* descriptor type = endpoint */<br />    0x82,                                  //байт54   /* IN endpoint number 82 */<br />    0x03,                                  //байт55   /* attrib: Interrupt endpoint */<br />    8, 0,                                  //байт56,57   /* maximum packet size */<br />    10,                                  //байт58   /* in ms */<br />   <br />   <br />};</code></pre></div><br /><br />and make usbFunctionDescriptor<br /><div class="codebox"><p>Code: </p><pre><code>//Функция Обработчик ответов дискрипторов<br />usbMsgLen_t   usbFunctionDescriptor(struct usbRequest *rq)<br />{<br />   if ((rq-&gt;bmRequestType &amp; USBRQ_TYPE_MASK) != USBRQ_TYPE_STANDARD) return 0;<br /><br />   if (rq-&gt;bRequest == USBRQ_GET_DESCRIPTOR)<br />   {<br />      switch (rq-&gt;wValue.bytes&#91;1&#93;)<br />      {<br />        case USBDESCR_HID_REPORT: { usbMsgPtr = (uchar *)config.usb_disc_hid_rep;                return ( config.usb_disc_hid_len );}<br />        case USBDESCR_DEVICE:     { usbMsgPtr = (uchar *)dynamical_usbDescriptorDevice;             return ( sizeof(dynamical_usbDescriptorDevice) );}         <br />        case USBDESCR_CONFIG:     { usbMsgPtr = (uchar *)dynamical_usbDescriptorConfiguration;      return ( sizeof(dynamical_usbDescriptorConfiguration));}         <br />          case USBDESCR_HID :      { usbMsgPtr = (uchar *)dynamical_usbDescriptorConfiguration + 18 ;   return (9);}                   <br />          case USBDESCR_STRING:    { if (rq-&gt;wValue.bytes&#91;0&#93;==2) { usbMsgPtr = (uchar *)usbDescriptorStringDevice; return (22);}}  <br />      };<br />   };<br />   return 0;<br />}<br /></code></pre></div><br />But windows still cannot setup device.<br />Screen <img src="http://mmjoy.googlecode.com/svn/wiki/trash/V_USB_EP81_EP82_interface2.png" class="postimage" alt="Image" /><br />USBlyzer log <a href="http://mmjoy.googlecode.com/svn/wiki/trash/V_USB_EP81_EP82_interface2.ulz" class="postlink">http://mmjoy.googlecode.com/svn/wiki/trash/V_USB_EP81_EP82_interface2.ulz</a><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=11426">mega_mozg_13</a> — Wed Jun 26, 2013 3:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2013-06-26T15:41:17+02:00</updated>

		<published>2013-06-26T15:41:17+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25507#p25507</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25507#p25507"/>
		<title type="html"><![CDATA[Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25507#p25507"><![CDATA[
Ok its clear to me what you want now but I still can not see how you can do that without defining your pipes in the usb Descriptor Config. Your screen shots above only shows the default and another end in point not 3. So either a) configure it like I showed you or b) prove to me with your usb sniffing/analyzing software that 3 endpoints are there. Remember usbSetInterrupt3() is for  the 3rd, (default + 1 in + 2 in).<br /><br />Again for me its easier to control everything myself so maybe I'm not following here but you should have<br />pipe0  default<br />pipe1  81<br />pipe2  82<br /><br />not <br /><br />pipe0  81<br />pipe1  82<br /><br />can you show the device config from the analyzer software.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Wed Jun 26, 2013 3:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mega_mozg_13]]></name></author>
		<updated>2013-06-26T13:42:20+02:00</updated>

		<published>2013-06-26T13:42:20+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25506#p25506</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25506#p25506"/>
		<title type="html"><![CDATA[Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25506#p25506"><![CDATA[
<blockquote><div><cite>ulao wrote:</cite>let us go back to the need of the 3rd pipe here? You said &quot;Yes. I want more reports per second, with legal tricks.&quot; Can you try to explain that in more detail.<br /></div></blockquote><br />If I'm use standart 8 ms poll, and one endpoint - I'm have total 120 packets per second (report 1, report 2, report 1, report 2...) <br />60 packets  &quot;report 1&quot; and 60 packets  &quot;report 2&quot;.<br />I want open two pipes and send pipe 1 = 120 packets &quot;report 1&quot; and pipe 2 = 120 packets &quot;report 2&quot;.<br /><br /><blockquote><div><cite>ulao wrote:</cite>Also what OS are you targeting here. Because I too would like to be faster then 8ms but I can not find a way to do that myself. <br /></div></blockquote><br />Windows. Also I know hack solutions like &quot;500Hz mouse usb&quot;, but I want legal solution without hack tricks.<br /><br /><blockquote><div><cite>ulao wrote:</cite>Does your project work without using the usbSetInterrupt3()and just send them both on usbSetInterrupt()?<br /></div></blockquote><br />Yes. Project working - one pipe send total 120 packets per second (report 1, report 2, report 1, report 2...)<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=11426">mega_mozg_13</a> — Wed Jun 26, 2013 1:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2013-06-26T13:28:58+02:00</updated>

		<published>2013-06-26T13:28:58+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25505#p25505</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25505#p25505"/>
		<title type="html"><![CDATA[Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25505#p25505"><![CDATA[
no I get that, didnt you see my &quot;edit&quot; note in bold?<br /><br />let us go back to the need of the 3rd pipe here? You said &quot;Yes. I want more reports per second, with legal tricks.&quot; Can you try to explain that in more detail. Also what OS are you targeting here. Because I too would like to be faster then 8ms but I can not find a way to do that myself. Does your project work without using the usbSetInterrupt3()and just send them both on usbSetInterrupt()?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Wed Jun 26, 2013 1:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mega_mozg_13]]></name></author>
		<updated>2013-06-26T08:29:15+02:00</updated>

		<published>2013-06-26T08:29:15+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25503#p25503</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25503#p25503"/>
		<title type="html"><![CDATA[Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25503#p25503"><![CDATA[
<strong class="text-strong">ulao</strong><br />maybe you mistake.<br />I have two virtual devices &quot;Virtual_Joystick#1&quot; and &quot;Virtual_Joystick#2&quot;<br /><br />each virtual joystick have report:<br />&quot;Virtual_Joystick#1&quot;<br />report buffer <strong class="text-strong">gamepad_report_1</strong><br /><div class="codebox"><p>Code: </p><pre><code>gamepad_report_1.report_id=1;</code></pre></div><br />HID <strong class="text-strong">0x85, 0x01,                    //     REPORT_ID (1)</strong><br /><br />&quot;Virtual_Joystick#2&quot;<br />report buffer <strong class="text-strong">gamepad_report_2</strong><br />HID <strong class="text-strong">0x85, 0x02,                    //     REPORT_ID (2)</strong><br /><div class="codebox"><p>Code: </p><pre><code>gamepad_report_2.report_id=2;</code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=11426">mega_mozg_13</a> — Wed Jun 26, 2013 8:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2013-06-25T16:53:03+02:00</updated>

		<published>2013-06-25T16:53:03+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25500#p25500</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25500#p25500"/>
		<title type="html"><![CDATA[Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25500#p25500"><![CDATA[
ok well this is how I would do it but yes you would loose 8 ms here. <br /><span style="font-size: 150%; line-height: 116%;"> <strong class="text-strong"> EDIT : ( ok I see you are doing this here gamepad_report_1.report_id=1; ) then see comment below.  </strong></span><br /><div class="codebox"><p>Code: </p><pre><code>usbSendHidReport((void *)&amp;gamepad_report_1, sizeof(gamepad_report_1), 1);<br />usbSendHidReport((void *)&amp;gamepad_report_1, sizeof(gamepad_report_1), 2);<br /><br />void usbSendHidReport(uchar * data, uchar len, reportID)<br />{<br />   while(1)<br />   {   DBG1(0x03, 0, 0);   /* debug output: interrupt report prepared */<br />      usbPoll();<br />      if (usbInterruptIsReady())<br />      {<br />         DBG1(0x04, 0, 0);   /* debug output: interrupt report prepared */<br />         data&#91;0&#93; = rereportID;//what report to write to<br />         usbSetInterrupt(data, len);<br />         break;<br />      }<br />   }<br />}<br /></code></pre></div><br /><br />now if you want to use another in end pipe you need to define it? I have never left the config open like that so maybe you know more then I but this is how most of us set the config up.<br /><div class="codebox"><p>Code: </p><pre><code>char usbDescriptorConfiguration&#91;&#93; = { 0 }; // dummy<br /><br /><br />uchar my_usbDescriptorConfiguration&#91;&#93; = {    /* USB configuration descriptor */<br />     9,          /* sizeof(usbDescriptorConfiguration): length of descriptor in bytes */<br />    USBDESCR_CONFIG,    /* descriptor type */<br />    18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + 7 /** USB_CFG_HAVE_INTRIN_ENDPOINT3 + 7*/ + 9, 0,<br />                /* total length of data returned (including inlined descriptors) */<br />    1,          /* number of interfaces in this configuration */<br />    1,          /* index of this configuration */<br />    0,          /* configuration name string index */<br />    USB_CFG_IS_SELF_POWERED,  /* attributes */<br /><br />    USB_CFG_MAX_BUS_POWER/2,            /* max USB current in 2mA units */<br />/* interface descriptor follows inline: */<br />    9,          /* sizeof(usbDescrInterface): length of descriptor in bytes */<br />    USBDESCR_INTERFACE, /* descriptor type */<br />    0,          /* index of this interface */<br />    0,          /* alternate setting for this interface */<br />    1 + USB_CFG_HAVE_INTRIN_ENDPOINT /*+ USB_CFG_HAVE_INTRIN_ENDPOINT3*/,   /* endpoints excl 0: number of endpoint descriptors to follow */<br />    USB_CFG_INTERFACE_CLASS,<br />    USB_CFG_INTERFACE_SUBCLASS,<br />    USB_CFG_INTERFACE_PROTOCOL,<br />    0,          /* string index for interface */<br /><br /><br />    9,          /* sizeof(usbDescrHID): length of descriptor in bytes */<br />    USBDESCR_HID,   /* descriptor type: HID */<br />    0x10, 0x01, /* BCD representation of HID version */<br />    0x00,       /* target country code */<br />    0x01,       /* number of HID Report (or other HID class) Descriptor infos to follow */<br />    0x22,       /* descriptor type: report */<br />    USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0,  /* total length of report descriptor *///<br />//#endif<br /><br /><br />#if USB_CFG_HAVE_INTRIN_ENDPOINT    /* endpoint descriptor for endpoint 1 */<br />    7,          /* sizeof(usbDescrEndpoint) */ <br />    USBDESCR_ENDPOINT,  /* descriptor type = endpoint */<br />    //0x81,       /* IN endpoint number 1 */<br />   0x81,       // bulk IN endpoint number 1 <br />    0x03,       /* attrib: Interrupt endpoint */<br />    8, 0,       /* maximum packet size */ <br />    0x04, /* in ms */<br /><br />//the output.<br /><br />    7,          // sizeof(usbDescrEndpoint)<br />    5,  // descriptor type = endpoint<br />    0x02,      // out endpoint number 2 <br />    0x03,       // attrib: Interrupt endpoint <br />    8, 0,       // maximum packet size <br />    USB_CFG_INTR_POLL_INTERVAL, // in ms <br /><br />#endif<br /></code></pre></div><br />now that does not include a 3rd pipe but maybe it will show you how to properly configure it. Outside of that your doing it in a way I can not help you, In your pic above I only see the default 80 and one end point 81 not the 3rd.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Tue Jun 25, 2013 4:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mega_mozg_13]]></name></author>
		<updated>2013-06-25T16:50:28+02:00</updated>

		<published>2013-06-25T16:50:28+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25499#p25499</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25499#p25499"/>
		<title type="html"><![CDATA[Re: Endless loop. usbInterruptIsReady3() usbSetInterrupt3()]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8450&amp;p=25499#p25499"><![CDATA[
<blockquote><div><cite>ulao wrote:</cite> Is there a reason you are trying to do this on its own pipe? Speed maybe?</div></blockquote><br />Yes. I want more reports per second, with legal tricks.<br /><br /><blockquote><div><cite>ulao wrote:</cite> If your going to do something like adding a pipe you need to define it in the config.</div></blockquote><br />config is made by &quot;v-usb&quot; engine. you can see my &quot;USBLyser report&quot;.<br /><br />I think, two devices must be on two interfaces and have each endpoint.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=11426">mega_mozg_13</a> — Tue Jun 25, 2013 4:50 pm</p><hr />
]]></content>
	</entry>
	</feed>
