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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2011-12-22T15:18:58+02:00</updated>

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

		<entry>
		<author><name><![CDATA[schwa226]]></name></author>
		<updated>2011-12-22T15:18:58+02:00</updated>

		<published>2011-12-22T15:18:58+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=6306&amp;p=20504#p20504</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=6306&amp;p=20504#p20504"/>
		<title type="html"><![CDATA[Sending more Data with usbSetInterrupt]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=6306&amp;p=20504#p20504"><![CDATA[
Hi,<br /><br />i want to send more usbSetInterrupt in a row.<br /><br /><div class="codebox"><p>Code: </p><pre><code>void log_usb (unsigned char ch)<br />{<br />   while (!usbInterruptIsReady())                                    // check if USB int is ready<br />   {<br />      wdt_reset();<br />      usbPoll();<br />   }<br />   <br />   memcpy(&amp;replyBuf&#91;0&#93;, &amp;NewLogCharAvailable, sizeof(uchar));            // copy report id to replybuffer<br />   memcpy(&amp;replyBuf&#91;1&#93;, &amp;ch, sizeof(uchar));                                     // copy data to replybuffer      <br />   usbSetInterrupt(&amp;replyBuf&#91;0&#93;, sizeof(uchar) + sizeof(uchar));         // send ReportID + data         <br />}</code></pre></div><br /><br />If I now use the log_usb like this:<br /><div class="codebox"><p>Code: </p><pre><code>for (i == 0; i &lt; LOG_LENGTH; i++)<br />{<br />  log_usb (MyLOG&#91;i&#93;);<br />}</code></pre></div><br /><br />With only LOG_LENGTH = 1 it is working. If LOG_LENGTH &gt;= 2 then the device will be reseted!?<br />The LOG_LENGTH is unknown so I have to send each byte seperate.<br /><br />EDIT:<br />Is it possible to send ~704 Bytes to the host in 8 Byte pakets?<br /><br />Like:<br /><div class="codebox"><p>Code: </p><pre><code>    0x85, 0x0B,                    //   REPORT_ID (11)<br />    0x96, 0xC0, 0x02,                    //   REPORT_COUNT (704)<br />    0x09, 0x00,                    //   USAGE (Undefined)<br />    0x82, 0x00, 0x01,              //   INPUT (Data,Ary,Abs,Buf)</code></pre></div><br /><br />And than like:<br /><div class="codebox"><p>Code: </p><pre><code>i = 0;<br /><br />   while (!usbInterruptIsReady())                                    // check if USB int is ready<br />   {<br />      wdt_reset();<br />      usbPoll();<br />   }<br />  usbSetInterrupt(&amp;NewLOGReportID, 1);<br /><br />while (i &lt; 704)<br />{<br />   while (!usbInterruptIsReady())                                    // check if USB int is ready<br />   {<br />      wdt_reset();<br />      usbPoll();<br />   }<br />  usbSetInterrupt(&amp;buffer, 8);<br />  i += 8;<br />}</code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=3520">schwa226</a> — Thu Dec 22, 2011 3:18 pm</p><hr />
]]></content>
	</entry>
	</feed>
