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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2014-12-25T16:40:29+02:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2014-12-25T16:40:29+02:00</updated>

		<published>2014-12-25T16:40:29+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=9561&amp;p=29009#p29009</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=9561&amp;p=29009#p29009"/>
		<title type="html"><![CDATA[Detection Suspend Mode - example.]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=9561&amp;p=29009#p29009"><![CDATA[
I have no opportunity to use the usbSofCount variable therefore I realized another method of detection of a suspend mode:<br /><br /><br /><div class="codebox"><p>Code: </p><pre><code>    for(;;){                /* main event loop */<br />       <br />        usbPoll();<br />         <br />      if(IsBusy){          <br />             StartProcess();<br />            IsBusy = 0;<br />    <br />       }else Sleep();      <br />   <br />    }<br /></code></pre></div><br /><br /><br /><div class="codebox"><p>Code: </p><pre><code>void Sleep()<br />{<br />   <br />   <br />unsigned int a = 1024, taqt = 0;;<br />unsigned char val = 0, val_2 = 0;<br /><br /><br />   val = PINB&amp;0x01;<br />   <br /><br />   while(--a){             <br />      <br />      val_2 = PINB&amp;0x01;<br />      <br />      if(val!=val_2)<br />         taqt++;      <br />      <br />      val = val_2;<br />            <br />   }<br />   <br />   if(taqt){<br />      OnLed();<br />   }else OffLed();<br />    <br />    <br />}<br /></code></pre></div><br /><br /><br />I don't use the mode of the low-energy consumption but only I disconnect a LED.<br /><br />It is an example, possibly, it is written not absolutely correctly <img class="smilies" src="./../../../images/smilies/icon_smile.gif" alt=":)" title="Smile" /> You don't judge strictly <img class="smilies" src="./../../../images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by Guest — Thu Dec 25, 2014 4:40 pm</p><hr />
]]></content>
	</entry>
	</feed>
