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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2017-11-10T18:38:54+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2017-11-10T18:38:54+02:00</updated>

		<published>2017-11-10T18:38:54+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=11049&amp;p=33270#p33270</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=11049&amp;p=33270#p33270"/>
		<title type="html"><![CDATA[Re: check if USB is idle]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=11049&amp;p=33270#p33270"><![CDATA[
check for the arrest<br /><br /><br />usbPoll(); //issue at least one for the check below<br />if (USB_INTR_PENDING &amp; (1&lt;&lt;USB_INTR_PENDING_BIT)) // Usbpoll() collided with data packet<br />{<br />uint8_t ctr;<br /><br />// loop takes 5 cycles<br />asm volatile(<br />&quot; ldi %0,%1 \n\t&quot;<br />&quot;loop%=: sbis %2,%3 \n\t&quot;<br />&quot; ldi %0,%1 \n\t&quot;<br />&quot; subi %0,1 \n\t&quot;<br />&quot; brne loop%= \n\t&quot;<br />: &quot;=&amp;d&quot; (ctr)<br />: &quot;M&quot; ((uint8_t)(8.8f*(F_CPU/1.0e6f)/5.0f+0.5)), &quot;I&quot; (_SFR_IO_ADDR(USBIN)), &quot;M&quot; (USB_CFG_DMINUS_BIT)<br />);<br />USB_INTR_PENDING = 1&lt;&lt;USB_INTR_PENDING_BIT;<br />}<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Fri Nov 10, 2017 6:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2017-09-29T13:54:34+02:00</updated>

		<published>2017-09-29T13:54:34+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=11049&amp;p=33095#p33095</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=11049&amp;p=33095#p33095"/>
		<title type="html"><![CDATA[Re: check if USB is idle]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=11049&amp;p=33095#p33095"><![CDATA[
Been going down this road all month....<br /><br />Do you use any control transfers? If so things get twice as hard. <br /><br />Assuming you have a normal interrupt based USB poll every 8-10ms you can tie everything to the usbpoll.  Somewhere in your code you should have a line like so.<br /> while (!usbInterruptIsReady()) usbPoll(); usbSetInterrupt( reportBuffer, <img class="smilies" src="./../../../images/smilies/icon_cool.gif" alt="8)" title="Cool" />; <br />//add code here..<br /><br />If you do your pages at this point  you have 8 ms of free time to play. Now if you are using a control transfer to tell the driver to do page writes, things get a bit more complicated. I set a global bit that I turn on after the control transfer completes them check for that bit where I added the comment above and do the work. This will worked for any software written in c or c++ but forget about c#.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Fri Sep 29, 2017 1:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2017-09-26T10:49:19+02:00</updated>

		<published>2017-09-26T10:49:19+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=11049&amp;p=33082#p33082</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=11049&amp;p=33082#p33082"/>
		<title type="html"><![CDATA[check if USB is idle]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=11049&amp;p=33082#p33082"><![CDATA[
Is there a way to know that there is no pending transfers are going on USB?<br /><br />Specifically, i want to know that we already ACK'ed STATUS of my current SETUP.<br /><br />I am calling SPM to erase/flash pages and this causes a significant enough delay to cause URB to error on a host side.<br /><br /><br />Thanks!<p>Statistics: Posted by Guest — Tue Sep 26, 2017 10:49 am</p><hr />
]]></content>
	</entry>
	</feed>
