<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=4&amp;t=13474&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2015-11-05T23:45:59+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=13474&amp;mode</id>
<entry>
<author><name><![CDATA[rskup]]></name></author>
<updated>2015-11-05T23:45:59+01:00</updated>
<published>2015-11-05T23:45:59+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=13474&amp;p=144565#p144565</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=13474&amp;p=144565#p144565"/>
<title type="html"><![CDATA[Re: PSTR w argumencie funkcji, mający w argumencie %d, %s it]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=13474&amp;p=144565#p144565"><![CDATA[
Po przeczytaniu nie wiem czego Ci brakuje? Przecież zamieszczasz fragmenty kodu rozwiązujące Twój problem, więc wystarczy zrobić z tego funkcję i już masz tak jak chcesz.<br /><br />Najlepiej utwórz tę funkcję a jak będziesz miał problem z jej działaniem to ją wklej a na pewno ktoś Ci pomoże <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><br /><br />-- <br />Pozdrawiam,<br />Robert<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3427">rskup</a> — 5 lis 2015, o 23:45</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[JungleMan]]></name></author>
<updated>2015-11-05T23:28:29+01:00</updated>
<published>2015-11-05T23:28:29+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=13474&amp;p=144563#p144563</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=13474&amp;p=144563#p144563"/>
<title type="html"><![CDATA[PSTR w argumencie funkcji, mający w argumencie %d, %s itp.]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=13474&amp;p=144563#p144563"><![CDATA[
Chciałbym stworzyć funkcję: [c]void usart_putstring_P(const char str*, ...);[/c] <br />która będzie wywoływana w np. taki sposób:<br />[c]usart_putstring(PSTR(&quot;%u %s&quot;), number, str);[/c]<br />z tym, że nie chcę rozwiązywać problemu w taki sposób, że:<br />[c]<br />void usart_putstring_P(const char *str, ...)<br />{<br />char buffer[40];<br />va_list args;<br />va_start(args, str);<br />vsnprintf_P(buffer, sizeof(buffer), str, args);<br />usart_putstring(buffer);<br />va_end(args);<br />}<br />[/c]<br />a bardziej z użyciem (Wyśw. LCD - BB - str. 230/231):<br />[c]<br />while((letter = pgm_read_byte(str++))) {<br />if(letter == '%u') put_uint(arg1);<br />if(letter == '%s') put_string(arg2);<br />put_char(letter);<br />}<br />[/c]<br />Rzecz w tym, że nie chcę używać pamięciożernej funkcji vsnprintf_P, bo wiem, że w argumentach dostanę na pewno uint'a oraz string'a i właśnie w tej kolejności, a nie wiem jak sprawdzić, że w danym miejscu jest &quot;%u&quot; lub &quot;%s&quot;. Pytanie to: jak to sprawdzić?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3945">JungleMan</a> — 5 lis 2015, o 23:28</p><hr />
]]></content>
</entry>
</feed>