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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2014-06-11T09:04:49+02:00</updated>

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

		<entry>
		<author><name><![CDATA[blargg]]></name></author>
		<updated>2014-06-11T09:04:49+02:00</updated>

		<published>2014-06-11T09:04:49+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9023&amp;p=27043#p27043</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9023&amp;p=27043#p27043"/>
		<title type="html"><![CDATA[Re: Detect Suspend Mode]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9023&amp;p=27043#p27043"><![CDATA[
I've done this in my keyboard converter by putting the CPU to sleep regularly and having it woken by the USB interrupt or a timeout interrupt that fires when the host is suspended and thus doing no USB activity. Something like<br /><div class="codebox"><p>Code: </p><pre><code>static volatile bool usb_inactive;<br /><br />ISR(TIMER1_OVF_vect)<br />{<br />    usb_inactive = true;<br />}<br /><br />void check_inactive()<br />{<br />    TCNT1 = -inactive_timeout;<br />    usb_inactive = false;<br />    sleep_enable();<br />    sleep_cpu();<br />    if ( usb_inactive )<br />    {<br />        ...<br />    }<br />}<br /></code></pre></div><br /><br />You could use the USB_RESET_HOOK to detect when the host reawakens.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20076">blargg</a> — Wed Jun 11, 2014 9:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[AlexDigital]]></name></author>
		<updated>2014-06-08T21:10:05+02:00</updated>

		<published>2014-06-08T21:10:05+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9023&amp;p=27034#p27034</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9023&amp;p=27034#p27034"/>
		<title type="html"><![CDATA[Detect Suspend Mode]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9023&amp;p=27034#p27034"><![CDATA[
Hi guys,<br /><br />I have an USB application with the V-USB library and want to detect if the host is in suspend mode.<br />If it's true, then a LED should turn off. When the host wakes up, the LED should turn on.<br /><br />In my case, D- is connected to INT0. INT1 is already used by another hardware.<br /><br />Is there an easy method to do that?<br /><br />Cheers,<br />AlexDigital<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=20390">AlexDigital</a> — Sun Jun 08, 2014 9:10 pm</p><hr />
]]></content>
	</entry>
	</feed>
