<?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/4157" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2010-04-16T18:43:45+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2010-04-16T18:43:45+02:00</updated>

		<published>2010-04-16T18:43:45+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4157&amp;p=14146#p14146</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4157&amp;p=14146#p14146"/>
		<title type="html"><![CDATA[resolved - more then 8 packets fail on some computers]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4157&amp;p=14146#p14146"><![CDATA[
Not sure how I go about doing this but here is what I see.<br /><br />On some, unfortunately I dont know what the difference is but on some computers I can not use more then an 8 packet descriptor. If I do no packets get sent. The computers that had the issues were formatted and had a new version of xp on them. Test each sp 1,2 and 3. <br /><br />symptom: No packets are sent. <br /><br />this desc fails<br /><br /><div class="codebox"><p>Code: </p><pre><code>const char analog_usbHidReportDescriptor&#91;&#93; PROGMEM = {<br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x05,                    // USAGE (Gamepad)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />   <br />    0x09, 0x01,                    //   USAGE (Pointer)    <br />   0xa1, 0x00,                    //   COLLECTION (Physical)<br />   0x05, 0x01,                    //     USAGE_PAGE (Generic Desktop)<br />    0x09, 0x30,                    //     USAGE (X)<br />    0x09, 0x31,                    //     USAGE (Y)<br />   <br />   0x09, 0x33,                  //     USAGE (Rx)<br />   0x09, 0x34,                  //     USAGE (Ry)<br /><br />   0x09, 0x35,                  //     USAGE (Rz)   <br />   0x09, 0x36,                  //     USAGE (Slider)   <br /><br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x26, 0xFF, 0x00,              //     LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,                    //     REPORT_SIZE (8)<br />    0x95, 0x06,                    //     REPORT_COUNT (6)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />   0xc0,                          //   END_COLLECTION (Physical)<br /><br />    0x05, 0x09,                    //   USAGE_PAGE (Button)<br />    0x19, 0x01,                    //   USAGE_MINIMUM (Button 1)<br />    0x29, 0x18,                    //   USAGE_MAXIMUM (Button 24)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,                    //   REPORT_SIZE (1)<br />    0x95, 0x18,                    //   REPORT_COUNT (24)<br />    0x81, 0x02,                    //   INPUT (Data,Var,Abs)<br /><br />    0xc0<br />};</code></pre></div><br /><br />this one works<br /><br /><div class="codebox"><p>Code: </p><pre><code>const char analog_usbHidReportDescriptor&#91;&#93; PROGMEM = {<br />    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)<br />    0x09, 0x05,                    // USAGE (Gamepad)<br />    0xa1, 0x01,                    // COLLECTION (Application)<br />   <br />    0x09, 0x01,                    //   USAGE (Pointer)    <br />   0xa1, 0x00,                    //   COLLECTION (Physical)<br />   0x05, 0x01,                    //     USAGE_PAGE (Generic Desktop)<br />    0x09, 0x30,                    //     USAGE (X)<br />    0x09, 0x31,                    //     USAGE (Y)<br />   <br />   0x09, 0x33,                  //     USAGE (Rx)<br />   0x09, 0x34,                  //     USAGE (Ry)<br /><br />   0x09, 0x35,                  //     USAGE (Rz)   <br />   0x09, 0x36,                  //     USAGE (Slider)   <br /><br />    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)<br />    0x26, 0xFF, 0x00,              //     LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,                    //     REPORT_SIZE (8)<br />    0x95, 0x06,                    //     REPORT_COUNT (6)<br />    0x81, 0x02,                    //     INPUT (Data,Var,Abs)<br />   0xc0,                          //   END_COLLECTION (Physical)<br /><br />    0x05, 0x09,                    //   USAGE_PAGE (Button)<br />    0x19, 0x01,                    //   USAGE_MINIMUM (Button 1)<br />    0x29, 0x18,                    //   USAGE_MAXIMUM (Button 24)<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)<br />    0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,                    //   REPORT_SIZE (1)<br />    0x95, 0x10,                    //   REPORT_COUNT (16)<br />    0x81, 0x02,                    //   INPUT (Data,Var,Abs)<br /><br />    0xc0<br />};<br /></code></pre></div> As you can see the only change were the number of buttons making it less then 8 packets. <br /><br />FYI I send more then 8 via<br /><div class="codebox"><p>Code: </p><pre><code>      while (!usbInterruptIsReady()) usbPoll();<br />      usbSetInterrupt((void *)&amp;reportBuffer + 0, curGamepad-&gt;report_size);<br /><br />      while (!usbInterruptIsReady()) usbPoll();<br />      usbSetInterrupt((void *)&amp;reportBuffer + 8, curGamepad-&gt;report_size);<br /></code></pre></div><br />Will do some more testing here but I dont have a computer in front of me that has the issue at the moment.<br /><br /><br />Fix:: <br />Had to make sure I only did the correct  number of packets. <br /><div class="codebox"><p>Code: </p><pre><code>      while (!usbInterruptIsReady()) usbPoll();<br />      usbSetInterrupt((void *)&amp;reportBuffer + 0, curGamepad-&gt;report_size);<br /><br />      while (!usbInterruptIsReady()) usbPoll();<br />      usbSetInterrupt((void *)&amp;reportBuffer + 8, 1);<br /></code></pre></div> The odd things is on some computers its not needed. Not sure why?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Fri Apr 16, 2010 6:43 pm</p><hr />
]]></content>
	</entry>
	</feed>
