<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.6000.16762" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=750503509-12122008><FONT face=Arial 
size=2>Zdravim,</FONT></SPAN></DIV>
<DIV><SPAN class=750503509-12122008><FONT face=Arial size=2>ted me dostala 
optimalizace casti kodu, kterou jsem necekal...</FONT></SPAN></DIV>
<DIV><SPAN class=750503509-12122008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=750503509-12122008><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;BYTE idx;<BR>&nbsp;&nbsp;&nbsp;PDS18X20_DESC pd = 
&amp;DsTSensDesc[0];<BR>&nbsp;&nbsp;&nbsp;for (idx=0; idx&lt;DsTSensCount; 
idx++)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;pd++-&gt;status = 
TSENS_ERR_HW;<BR>&nbsp;&nbsp;&nbsp;}<BR></FONT></SPAN></DIV>
<DIV><SPAN class=750503509-12122008><FONT face=Arial size=2>je prelozeno 
takto:</FONT></SPAN></DIV>
<DIV><SPAN class=750503509-12122008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=750503509-12122008><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;BYTE idx;<BR>&nbsp;&nbsp;&nbsp;PDS18X20_DESC pd = 
&amp;DsTSensDesc[0];<BR>&nbsp;&nbsp;&nbsp;for (idx=0; idx&lt;DsTSensCount; 
idx++)<BR>&nbsp;bee:&nbsp;90 91 78 02 &nbsp;lds&nbsp;r25, 
0x0278<BR>&nbsp;bf2:&nbsp;e0 e0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;ldi&nbsp;r30, 0x00&nbsp;; 0<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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;adiw&nbsp;r30, 0x0c&nbsp;; 12<BR>&nbsp;&nbsp;wStartTicks = 
GetTicks1ms();<BR>&nbsp;&nbsp;if (bRes != 
DS18X20_OK)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;BYTE 
idx;<BR>&nbsp;&nbsp;&nbsp;PDS18X20_DESC pd = 
&amp;DsTSensDesc[0];<BR>&nbsp;&nbsp;&nbsp;for (idx=0; idx&lt;DsTSensCount; 
idx++)<BR>&nbsp;c0a:&nbsp;e8 17&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;cp&nbsp;r30, r24<BR>&nbsp;c0c:&nbsp;f9 
07&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;cpc&nbsp;r31, 
r25<BR>&nbsp;c0e:&nbsp;d9 f7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;brne&nbsp;.-10&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;; 0xc06 
&lt;TSens_SrvFunc+0x42&gt;<BR>&nbsp;c10:&nbsp;30 
c0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;rjmp&nbsp;.+96&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;; 0xc72 
&lt;TSens_SrvFunc+0xae&gt;<BR></FONT></SPAN></DIV>
<DIV><SPAN class=750503509-12122008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=750503509-12122008><FONT face=Arial size=2>(prolozeni textu je 
trosku ujete, pointa je v tom, ze se prekladac uplne vyhne pouziti promenne idx 
a ukonceni cyklu provede na zaklade porovnani ukazatele na strukturu s max. 
hodnotou (pocet polozek je na adrese 0x278) Je to evidentne funkcni a logicke, 
rekl bych ale, ze s pouzitim idx by kod vysel kratsi, coz byl muj 
zamer...)</DIV></FONT></SPAN></BODY></HTML>