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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2007-01-11T22:52:57+02:00</updated>

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

		<entry>
		<author><name><![CDATA[Grendel]]></name></author>
		<updated>2007-01-11T22:52:57+02:00</updated>

		<published>2007-01-11T22:52:57+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=33&amp;p=627#p627</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=33&amp;p=627#p627"/>
		<title type="html"><![CDATA[2 Devices with one AVR]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=33&amp;p=627#p627"><![CDATA[
This is all outlined in <a href="http://www.usb.org/developers/devclass_docs/HID1_11.pdf" class="postlink">Device Class Definition for HID 1.11</a> and <a href="http://www.usb.org/developers/devclass_docs/Hut1_12.pdf" class="postlink">HID Usage Tables 1.12</a> found on usb.org's <a href="http://www.usb.org/developers/hidpage/" class="postlink">HID Information</a> page.. Very good reads (hint, hint <img class="smilies" src="./../../../images/smilies/icon_razz.gif" alt=":P" title="Razz" />.)<br /><br />Edit: Whatdoyouknow -- there's a standard controller for magic carpets..<br /><br /><blockquote><div><cite>HID Usage Tables 1.12 wrote:</cite><strong class="text-strong">5.7 Miscellaneous Simulation Devices</strong><br /><br />Magic Carpet Simulation Device<br /><br />CA – Allows a device to be generally classified as one that uses the <strong class="text-strong">standard control of a magic carpet</strong>. This control is a bar, grasped by both hands, that controls the Yaw, Pitch and Roll of the carpet.<br /><br />The bar, at which the pilot sits, may be pushed forward or pulled back to cause the carpet to dive or rise, respectively. In the zero position, the carpet is in level flight. Pushing forward on the bar causes the carpet to nose down and generates negative values. Pulling back on the bar causes the carpet to nose up and generates positive values.<br /><br />Turning the bar turns the carpet. In the zero position, the carpet travels straight ahead. Pulling back on the right side turns the carpet to the right and generates positive values. Pulling back on the left side turns the carpet to the left and generates negative values.<br /><br />Rotating the bar rolls the carpet. In the zero position, the carpet travels level. Rotating the bar in a clockwise direction rolls the carpet to the right and generates positive values. Rotating the bar in the counterclockwise direction rolls the carpet to the left and generates negative values.</div></blockquote><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=101">Grendel</a> — Thu Jan 11, 2007 10:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ksz]]></name></author>
		<updated>2007-01-11T17:44:05+02:00</updated>

		<published>2007-01-11T17:44:05+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=33&amp;p=624#p624</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=33&amp;p=624#p624"/>
		<title type="html"><![CDATA[2 Devices with one AVR]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=33&amp;p=624#p624"><![CDATA[
<blockquote><div><cite>Anonymous wrote:</cite>Yes, I've used this to create my first mouse report..<br />What I didn't know is what wrote os:<br /><br />&quot;ReportID byte is the first byte of the buffer if you use it in the HID Report Descriptor. ........... &quot;<br /><br />Yes, os, this helps, thanks a lot!</div></blockquote><br /><br />Sorry, not logged in, this was me - ksz<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=127">ksz</a> — Thu Jan 11, 2007 5:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2007-01-11T17:42:17+02:00</updated>

		<published>2007-01-11T17:42:17+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=33&amp;p=623#p623</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=33&amp;p=623#p623"/>
		<title type="html"><![CDATA[2 Devices with one AVR]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=33&amp;p=623#p623"><![CDATA[
<blockquote><div><cite>christian wrote:</cite>Did you know that the USB Implementers Forum (<!-- m --><a class="postlink" href="http://www.usb.org">http://www.usb.org</a><!-- m -->) offers an application which creates HID descriptors? I can't find it right now, but it must be somewhere in the Downloads area of the Developer section.</div></blockquote><br /><br />Yes, I've used this to create my first mouse report..<br />What I didn't know is what wrote os:<br />[quote=&quot;os&quot;]<br />ReportID byte is the first byte of the buffer if you use it in the HID Report Descriptor. ...........[quote]<br />Yes, os, this helps, thanks a lot!<p>Statistics: Posted by Guest — Thu Jan 11, 2007 5:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[os]]></name></author>
		<updated>2007-01-11T09:21:26+02:00</updated>

		<published>2007-01-11T09:21:26+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=33&amp;p=620#p620</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=33&amp;p=620#p620"/>
		<title type="html"><![CDATA[2 Devices with one AVR]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=33&amp;p=620#p620"><![CDATA[
<blockquote><div><cite>ksz wrote:</cite>And where shoud I add information, which REPORT_ID is comming (I meen in which byte of buffer)..</div></blockquote><br />ReportID byte is the first byte of the buffer if you use it in the HID Report Descriptor.<br /><br />You may see my implementation of RC USB controller (downloadable from ObDev web site). out_joystick_btn.c implements two reports for HID-compatible joystick with buttons. One report is for axes, the second - for buttons.<br /><br />If host requests a specific ReportID then it is checked in usbFunctionSetup(). If it was an USB Interrupt In transfer then HID reports are sent by turns. In that case the firmware keeps track of which ReportID is to be sent this time (and you may use different repeat intervals for them if you wish, e.g. send the reports as 1, 1, 1, 2, 1, 1, 1, 2, ...). Note that WinXP usually uses Interrupt transfer, and PC application simply reads data from WinXP buffers (a lot of them by default, up to 512 buffers software controllable, 32 (?) by default).<br /><br />Hope this helps.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=67">os</a> — Thu Jan 11, 2007 9:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Grendel]]></name></author>
		<updated>2007-01-11T01:46:38+02:00</updated>

		<published>2007-01-11T01:46:38+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=33&amp;p=616#p616</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=33&amp;p=616#p616"/>
		<title type="html"><![CDATA[2 Devices with one AVR]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=33&amp;p=616#p616"><![CDATA[
Can be found <a href="http://www.usb.org/developers/hidpage/" class="postlink">here</a>.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=101">Grendel</a> — Thu Jan 11, 2007 1:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2007-01-11T00:10:34+02:00</updated>

		<published>2007-01-11T00:10:34+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=33&amp;p=614#p614</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=33&amp;p=614#p614"/>
		<title type="html"><![CDATA[2 Devices with one AVR]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=33&amp;p=614#p614"><![CDATA[
Did you know that the USB Implementers Forum (<!-- m --><a class="postlink" href="http://www.usb.org">http://www.usb.org</a><!-- m -->) offers an application which creates HID descriptors? I can't find it right now, but it must be somewhere in the Downloads area of the Developer section.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Thu Jan 11, 2007 12:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ksz]]></name></author>
		<updated>2007-01-10T23:37:37+02:00</updated>

		<published>2007-01-10T23:37:37+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=33&amp;p=613#p613</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=33&amp;p=613#p613"/>
		<title type="html"><![CDATA[2 Devices with one AVR]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=33&amp;p=613#p613"><![CDATA[
<blockquote><div><cite>os wrote:</cite><blockquote><div><cite>christian wrote:</cite>You don't need two HID descriptors, just one with a collection around two functions.</div></blockquote><br />I tried to implement a USB device with 4 game controllers. They were identical but I think it does not matter. The key is to use two (or more) Application collections with two (or more) different report IDs. </div></blockquote><br /><br />And where shoud I add information, which REPORT_ID is comming (I meen in which byte of buffer).. I want to build a mouse which I want to control by IR remote and by buttons on it.. Buttons part I've already done, it's got standard mouse descriptor:<br /><div class="codebox"><p>Code: </p><pre><code>    <br />    0x05, 0x01,                    // USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x09, 0x02,                    // USAGE &#40;Mouse&#41;<br />    0xa1, 0x01,                    // COLLECTION &#40;Application&#41;<br />    0x09, 0x01,                    //   USAGE &#40;Pointer&#41;<br />    0xa1, 0x00,                    //   COLLECTION &#40;Physical&#41;<br />                                        // I guess here goes the REPORT_ID<br />    0x05, 0x09,                    //     USAGE_PAGE &#40;Button&#41;<br />    0x19, 0x01,                    //     USAGE_MINIMUM &#40;Button 1&#41;<br />    0x29, 0x03,                    //     USAGE_MAXIMUM &#40;Button 3&#41;<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM &#40;0&#41;<br />    0x25, 0x01,                    //     LOGICAL_MAXIMUM &#40;1&#41;<br />    0x95, 0x03,                    //     REPORT_COUNT &#40;3&#41;<br />    0x75, 0x01,                    //     REPORT_SIZE &#40;1&#41;<br />    0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />    0x95, 0x01,                    //     REPORT_COUNT &#40;1&#41;<br />    0x75, 0x05,                    //     REPORT_SIZE &#40;5&#41;<br />    0x81, 0x03,                    //     INPUT &#40;Cnst,Var,Abs&#41;<br />    0x05, 0x01,                    //     USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x09, 0x30,                    //     USAGE &#40;X&#41;<br />    0x09, 0x31,                    //     USAGE &#40;Y&#41;<br />    0x15, 0x81,                    //     LOGICAL_MINIMUM &#40;-127&#41;<br />    0x25, 0x7f,                    //     LOGICAL_MAXIMUM &#40;127&#41;<br />    0x75, 0x08,                    //     REPORT_SIZE &#40;8&#41;<br />    0x95, 0x02,                    //     REPORT_COUNT &#40;2&#41;<br />    0x81, 0x06,                    //     INPUT &#40;Data,Var,Rel&#41;<br />    0xc0,                          //   END_COLLECTION<br />    0xc0                           // END_COLLECTION</code></pre></div><br /><br />The second descriptor will be the same..<br />But how in buildReport function add which REPORT_ID I want use..?<br />More info about my device:<br />buttons are checked every 22us, if changed - buildReportButtons() updates reportBufferButtons[] and sends to host.. <br />IR transmition will be detected in interrupts, after receive full IR frame, it will be prepared to send in buildReportIR() and send..<br />How in this functions add select e.g. REPORT_ID(1) for buttons, 2 - IR?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=127">ksz</a> — Wed Jan 10, 2007 11:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[os]]></name></author>
		<updated>2006-11-30T23:49:51+02:00</updated>

		<published>2006-11-30T23:49:51+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=33&amp;p=236#p236</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=33&amp;p=236#p236"/>
		<title type="html"><![CDATA[2 Devices with one AVR]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=33&amp;p=236#p236"><![CDATA[
<blockquote><div><cite>christian wrote:</cite>You don't need two HID descriptors, just one with a collection around two functions.</div></blockquote><br />I tried to implement a USB device with 4 game controllers. They were identical but I think it does not matter. The key is to use two (or more) Application collections with two (or more) different report IDs. The sample HID Report Descriptor may be like this:<br /><br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM const char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; =<br />&#123;<br />    // Controller #1<br />    0x05, 0x01,                    // USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x09, 0x04,                    // USAGE &#40;Joystick&#41;<br />    0xa1, 0x01,                    // COLLECTION &#40;Application&#41;<br />    0x09, 0x01,                    //   USAGE &#40;Pointer&#41;<br />    0xa1, 0x00,                    //   COLLECTION &#40;Physical&#41;<br />    0x85, 0x01,                    //     REPORT_ID &#40;1&#41;<br />    0x09, 0x30,                    //     USAGE &#40;X&#41;<br />    0x09, 0x31,                    //     USAGE &#40;Y&#41;<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM &#40;0&#41;<br />    0x26, 0xff, 0x00,              //     LOGICAL_MAXIMUM &#40;255&#41;<br />    0x75, 0x08,                    //     REPORT_SIZE &#40;8&#41;<br />    0x95, 0x02,                    //     REPORT_COUNT &#40;2&#41;<br />    0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM &#40;0&#41;<br />    0x25, 0x01,                    //     LOGICAL_MAXIMUM &#40;1&#41;<br />    0x95, 0x0c,                    //     REPORT_COUNT &#40;12&#41;<br />    0x75, 0x01,                    //     REPORT_SIZE &#40;1&#41;<br />    0x05, 0x09,                    //     USAGE_PAGE &#40;Button&#41;<br />    0x19, 0x01,                    //     USAGE_MINIMUM &#40;Button 1&#41;<br />    0x29, 0x0c,                    //     USAGE_MAXIMUM &#40;Button 12&#41;<br />    0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />    0x75, 0x01,                    //     REPORT_SIZE &#40;1&#41;<br />    0x95, 0x04,                    //     REPORT_COUNT &#40;4&#41;<br />    0x81, 0x01,                    //     INPUT &#40;Constant&#41; - 4 bit padding<br />    0xc0,                          //   END_COLLECTION<br />    0xc0,                           // END_COLLECTION<br /><br />    // Controller #2<br />    0x05, 0x01,                    // USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x09, 0x04,                    // USAGE &#40;Joystick&#41;<br />    0xa1, 0x01,                    // COLLECTION &#40;Application&#41;<br />    0x09, 0x01,                    //   USAGE &#40;Pointer&#41;<br />    0xa1, 0x00,                    //   COLLECTION &#40;Physical&#41;<br />    0x85, 0x02,                    //     REPORT_ID &#40;2&#41;<br />    0x09, 0x30,                    //     USAGE &#40;X&#41;<br />    0x09, 0x31,                    //     USAGE &#40;Y&#41;<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM &#40;0&#41;<br />    0x26, 0xff, 0x00,              //     LOGICAL_MAXIMUM &#40;255&#41;<br />    0x75, 0x08,                    //     REPORT_SIZE &#40;8&#41;<br />    0x95, 0x02,                    //     REPORT_COUNT &#40;2&#41;<br />    0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM &#40;0&#41;<br />    0x25, 0x01,                    //     LOGICAL_MAXIMUM &#40;1&#41;<br />    0x95, 0x0c,                    //     REPORT_COUNT &#40;12&#41;<br />    0x75, 0x01,                    //     REPORT_SIZE &#40;1&#41;<br />    0x05, 0x09,                    //     USAGE_PAGE &#40;Button&#41;<br />    0x19, 0x01,                    //     USAGE_MINIMUM &#40;Button 1&#41;<br />    0x29, 0x0c,                    //     USAGE_MAXIMUM &#40;Button 12&#41;<br />    0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />    0x75, 0x01,                    //     REPORT_SIZE &#40;1&#41;<br />    0x95, 0x04,                    //     REPORT_COUNT &#40;4&#41;<br />    0x81, 0x01,                    //     INPUT &#40;Constant&#41; - 4 bit padding<br />    0xc0,                          //   END_COLLECTION<br />    0xc0,                           // END_COLLECTION<br />&#125;;<br /><br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=67">os</a> — Thu Nov 30, 2006 11:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2006-11-16T09:52:01+02:00</updated>

		<published>2006-11-16T09:52:01+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=33&amp;p=89#p89</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=33&amp;p=89#p89"/>
		<title type="html"><![CDATA[2 Devices with one AVR]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=33&amp;p=89#p89"><![CDATA[
You don't need two HID descriptors, just one with a collection around two functions. I must admit that I never understood the fine details of USB descriptor parsing and always experimented until the operating system accepted the descriptor.<br /><br />If you can find a composite device (e.g. keyboard with trackball), use that as a starting point.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Thu Nov 16, 2006 9:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[chefpro]]></name></author>
		<updated>2006-11-16T01:15:45+02:00</updated>

		<published>2006-11-16T01:15:45+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=33&amp;p=86#p86</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=33&amp;p=86#p86"/>
		<title type="html"><![CDATA[2 Devices with one AVR]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=33&amp;p=86#p86"><![CDATA[
Do someone have an example, how to implement this ?<br />I was searching the half day, but I cant see where to start.<br />Is this done with another report descriptor or is there more ?<br />Until now this is my (not all, borrowed some) code:<br /><div class="codebox"><p>Code: </p><pre><code><br />... stuff<br /><br />char usbHidReportDescriptor&#91;73&#93; = &#123;<br />    0x05, 0x01,                    // USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x15, 0x00,                    // LOGICAL_MINIMUM &#40;0&#41;<br />    0x09, 0x04,                    // USAGE &#40;Joystick&#41;<br />    0xa1, 0x01,                    // COLLECTION &#40;Application&#41;<br />    0x05, 0x02,                    //   USAGE_PAGE &#40;Simulation Controls&#41;<br />    0x09, 0xbb,                    //   USAGE &#40;Throttle&#41;<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM &#40;0&#41;<br />    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM &#40;255&#41;<br />    0x75, 0x08,                    //   REPORT_SIZE &#40;8&#41;<br />    0x95, 0x01,                    //   REPORT_COUNT &#40;1&#41;<br />    0x81, 0x02,                    //   INPUT &#40;Data,Var,Abs&#41;<br />    0x05, 0x01,                    //   USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x05, 0x09,                    //   USAGE_PAGE &#40;Button&#41;<br />    0x19, 0x01,                    //   USAGE_MINIMUM &#40;Button 1&#41;<br />    0x29, 0x0d,                    //   USAGE_MAXIMUM &#40;Button 13&#41;<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM &#40;0&#41;<br />    0x25, 0x01,                    //   LOGICAL_MAXIMUM &#40;1&#41;<br />    0x75, 0x01,                    //   REPORT_SIZE &#40;1&#41;<br />    0x95, 0x0d,                    //   REPORT_COUNT &#40;13&#41;<br />    0x55, 0x00,                    //   UNIT_EXPONENT &#40;0&#41;<br />    0x65, 0x00,                    //   UNIT &#40;None&#41;<br />    0x81, 0x02,                    //   INPUT &#40;Data,Var,Abs&#41;<br />    0x95, 0x01,                    //   REPORT_COUNT &#40;1&#41;<br />    0x75, 0x03,                    //   REPORT_SIZE &#40;3&#41;<br />    0x81, 0x01,                    //   INPUT &#40;Cnst,Ary,Abs&#41;<br />    0xc0,                          // END_COLLECTION<br />    0x09, 0x01,                    // USAGE &#40;Vendor Usage 1&#41;<br />    0xa1, 0x01,                    // COLLECTION &#40;Application&#41;<br />    0x15, 0x00,                    //   LOGICAL_MINIMUM &#40;0&#41;<br />    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM &#40;255&#41;<br />    0x75, 0x08,                    //   REPORT_SIZE &#40;8&#41;<br />    0x85, 0x01,                    //   REPORT_ID &#40;1&#41;<br />    0x95, 0x01,                    //   REPORT_COUNT &#40;1&#41;<br />    0x09, 0x00,                    //   USAGE &#40;Undefined&#41;<br />    0xb2, 0x02, 0x01,              //   FEATURE &#40;Data,Var,Abs,Buf&#41;<br />    0xc0                           // END_COLLECTION<br />&#125;;<br /><br />... more stuff<br /><br />uchar   usbFunctionWrite&#40;uchar *data, uchar len&#41;<br />&#123;<br />  if&#40; data&#91;0&#93; == 1 &#41;&#123; // set led<br />    if&#40; data&#91;1&#93; == 0x00 &#41;&#123;<br />      resetLED&#40;&#41;;<br />    &#125; else &#123;<br />      setLED&#40;&#41;;<br />    &#125;<br />  &#125;<br />  return 1;<br />&#125;<br /><br />... some stuff<br /><br />uchar   usbFunctionSetup&#40;uchar data&#91;8&#93;&#41;<br />&#123;<br />rq = &#40;void *&#41;data;<br /><br />    usbMsgPtr = reportBuffer;<br />    if&#40;&#40;rq-&gt;bmRequestType &amp; USBRQ_TYPE_MASK&#41; == USBRQ_TYPE_CLASS&#41;&#123;    /* class request type */<br />        if&#40;rq-&gt;bRequest == USBRQ_HID_GET_REPORT&#41;&#123;  /* wValue: ReportType &#40;highbyte&#41;, ReportID &#40;lowbyte&#41; */<br />            makeNewReport&#40;&#41;;<br />            return sizeof&#40;reportBuffer&#41;;<br />        &#125;else if&#40;rq-&gt;bRequest == USBRQ_HID_SET_REPORT&#41;&#123;  /* wValue: ReportType &#40;highbyte&#41;, ReportID &#40;lowbyte&#41; */<br />            return 0xff;<br />        &#125;else if&#40;rq-&gt;bRequest == USBRQ_HID_GET_IDLE&#41;&#123;<br />            usbMsgPtr = &amp;idleRate;<br />            return 1;<br />        &#125;else if&#40;rq-&gt;bRequest == USBRQ_HID_SET_IDLE&#41;&#123;<br />            idleRate = rq-&gt;wValue.bytes&#91;1&#93;;<br />        &#125;<br />    &#125;else&#123;<br />        /* no vendor specific requests implemented */<br />    &#125;<br />   return 0;<br />&#125;<br /><br />... something<br /></code></pre></div><br />Which works.<br />So, where start make it stop working ? <img class="smilies" src="./../../../images/smilies/icon_biggrin.gif" alt=":D" title="Very Happy" /><br />And make it work again different?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=13">chefpro</a> — Thu Nov 16, 2006 1:15 am</p><hr />
]]></content>
	</entry>
	</feed>
