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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2013-07-15T21:26:32+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2013-07-15T21:26:32+02:00</updated>

		<published>2013-07-15T21:26:32+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=8539&amp;p=25583#p25583</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=8539&amp;p=25583#p25583"/>
		<title type="html"><![CDATA[reorder discriptor on the fly.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=8539&amp;p=25583#p25583"><![CDATA[
ok so I have an issue with the low speed limits of 8 bytes. I have the following.<br /><br /><div class="codebox"><p>Code: </p><pre><code>reportBuffer&#91;0&#93;=0;//report id<br />reportBuffer&#91;1&#93;=128;//X-Axis ( main stick )<br />reportBuffer&#91;2&#93;=128;//Y-Axis ( main stick )<br />reportBuffer&#91;3&#93;=128;//Z-Axis<br />reportBuffer&#91;4&#93;=128;//X-rotate(  second stick )<br />reportBuffer&#91;5&#93;=128;//Y-rotate ( second stick )<br />reportBuffer&#91;6&#93;=128;//Z-rotate<br />reportBuffer&#91;7&#93;=128;//slider( right trig )psx presure 1<br />reportBuffer&#91;8&#93;=128;//dial ( left trig )psx presure 2<br />reportBuffer&#91;9&#93; =0;//buttons 1<br />reportBuffer&#91;10&#93;=0;//buttons 2 <br />reportBuffer&#91;11&#93;=0;//buttons 3</code></pre></div><br /><br /><br />now this is a generic template that works with a large number of controller. The reality is that non of those controllers use more then 8 packets but I must be able to change controllers on the fly so I can just make a project for each controller. We can skip the id bit [0] as it does not count.<br /><br />examples:<br /><br />jaguar uses 1,2,9,10,11<br />psx uses 1,2,4,3,7,8,9,10<br />wii nun chuck uses 1,2,3,4,5,6,7,8<br /><br />So in order to support the nun chuck I need all available analogs but no buttons, to use the jaguar I need all 3 rows of buttons. So the only way to do that is to have the entire usb hid report. I wish there was a way to compress the data in to 8 packets but the user end software is not with in my jurisdiction. So the only way I could do this is patch the descriptor on the fly and always use 8 bytes. From what I know that is not possible once the usb is negotiated. <br /><br />so why 8 packets and why not just sent it twice?  Well I do that now.<br /><div class="codebox"><p>Code: </p><pre><code>while (!usbInterruptIsReady()){usbPoll(); } usbSetInterrupt((void *)&amp;reportBuffer + 0, 8);<br />while (!usbInterruptIsReady()){usbPoll(); }   usbSetInterrupt((void *)&amp;reportBuffer + 8, 5);<br /></code></pre></div><br /><br />The issue is that low speed means two pulls 16 total ms and its possible the user will see a frame skip &quot;lag&quot; on a monitor running more then 60 fps. Now that is debatable I would guess. Can anyone notice an occasional frame skip? Personally I dont but I'd like to advertise 8ms poll rates.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Mon Jul 15, 2013 9:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
