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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2009-09-21T21:51:34+02:00</updated>

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

		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2009-09-21T21:51:34+02:00</updated>

		<published>2009-09-21T21:51:34+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3122&amp;p=11042#p11042</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=11042#p11042"/>
		<title type="html"><![CDATA[Re: Knowing when a transfer is complete.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=11042#p11042"><![CDATA[
The clean method would be to use your own usbFunctionRead() and wait until bytesRemaining is zero. If you also want to wait until the host has read the last chunk, use Grendel's trick.<br /><br />If you want to use the built-in usbFunctionRead for static memory blocks, have a look at usbMsgPtr. If it has advanced beyond your buffer, the last chunk is being transferred. Again, use Grendel's trick if you must make sure it has reached the host.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Mon Sep 21, 2009 9:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[maxi]]></name></author>
		<updated>2009-08-16T17:54:51+02:00</updated>

		<published>2009-08-16T17:54:51+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10557#p10557</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10557#p10557"/>
		<title type="html"><![CDATA[Re: Knowing when a transfer is complete.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10557#p10557"><![CDATA[
Ok, from what I can make of the driver source what I actually need here is usbMsgLen, unfortunately this has been declared static in usbdrv.c.<br />By changing this to volatile I am able to include it externally but am not sure of the full implications of so doing.<br /><br />The last thing I wanted to do was hack the API. If anyone has a better suggestion then please let me know.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2570">maxi</a> — Sun Aug 16, 2009 5:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[maxi]]></name></author>
		<updated>2009-08-26T02:45:57+02:00 </updated>

		<published>2009-08-13T18:58:40+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10540#p10540</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10540#p10540"/>
		<title type="html"><![CDATA[Re: Knowing when a transfer is complete.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10540#p10540"><![CDATA[
hmm, I think I may have marked this as solved prematurely  <img class="smilies" src="./../../../images/smilies/icon_redface.gif" alt=":oops:" title="Embarassed" /> <br /><br />Something tells me this is not telling me that the tx has fully completed, only that the transmit system is idle.<br />From usbPoll()<br /><br /><div class="codebox"><p>Code: </p><pre><code>    if(usbTxLen &amp; 0x10){    /* transmit system idle */<br />        if(usbMsgLen != USB_NO_MSG){    /* transmit data pending? */<br />            usbBuildTxBlock();<br />        }<br />    }<br /></code></pre></div><br /><br />Perhaps I am misunderstanding?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2570">maxi</a> — Thu Aug 13, 2009 6:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[maxi]]></name></author>
		<updated>2009-08-26T02:45:31+02:00 </updated>

		<published>2009-08-13T02:54:11+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10524#p10524</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10524#p10524"/>
		<title type="html"><![CDATA[Re: Knowing when a transfer is complete.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10524#p10524"><![CDATA[
That is exactly what I was looking for <br /><br />Thank you very much!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2570">maxi</a> — Thu Aug 13, 2009 2:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Grendel]]></name></author>
		<updated>2009-08-13T02:13:48+02:00</updated>

		<published>2009-08-13T02:13:48+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10523#p10523</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10523#p10523"/>
		<title type="html"><![CDATA[Re: Knowing when a transfer is complete.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10523#p10523"><![CDATA[
Try this (see usbPoll()):<br /><br /><div class="codebox"><p>Code: </p><pre><code>    extern volatile uchar usbTxLen ;<br /><br />    tx_complete = (usbTxLen &amp; 0x10) ;</code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=101">Grendel</a> — Thu Aug 13, 2009 2:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[maxi]]></name></author>
		<updated>2009-08-13T18:58:56+02:00 </updated>

		<published>2009-08-12T22:51:50+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10521#p10521</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10521#p10521"/>
		<title type="html"><![CDATA[Knowing when a transfer is complete.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=3122&amp;p=10521#p10521"><![CDATA[
Simple question really, is there anyway of knowing (device-side) when an endpoint0 transfer to the host has completed?<br /><br />I would prefer to not use usbFunctionRead as my data is contained in a static RAM buffer that could be easily read by usbFunctionSetup alone.<br />I currently have something like this but I am not entirely sure that the driver is fully done even with that:<br /><br /><div class="codebox"><p>Code: </p><pre><code>uchar usbFunctionRead(uchar *data, uchar len)<br />{<br />    uchar i;<br />    if(len &gt; bytesRemaining)<br />        len = bytesRemaining;<br />    bytesRemaining -= len;<br />    for(i = 0; i &lt; len; i++)<br />        data&#91;i&#93; = getData(currentPosition);<br /><br />    if(len &lt; 8)<br />        tx_complete = 1;<br /><br />    return len; <br />}<br /></code></pre></div><br />Any suggestions?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2570">maxi</a> — Wed Aug 12, 2009 10:51 pm</p><hr />
]]></content>
	</entry>
	</feed>
