<?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=15202&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2016-04-24T14:32:52+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=15202&amp;mode</id>
<entry>
<author><name><![CDATA[k_mirek]]></name></author>
<updated>2016-04-24T14:32:52+01:00</updated>
<published>2016-04-24T14:32:52+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159165#p159165</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159165#p159165"/>
<title type="html"><![CDATA[Re: #define i sklejanie nazw]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159165#p159165"><![CDATA[
[syntax=c]#define PORT(x) SPORT(x)<br />#define SPORT(x) (PORT##x)[/syntax]<br /><br />Wielkie dzieki Panowie, tak to właśnie wychodzi jak się wydaję że się coś wie, a na bloga nie chce się zajrzeć, a się zastanawiam jak moglem o tym zapomnieć:D <br /><br />Pozdrawiam.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=499">k_mirek</a> — 24 kwi 2016, o 14:32</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[anshar]]></name></author>
<updated>2016-04-24T14:26:54+01:00</updated>
<published>2016-04-24T14:26:54+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159164#p159164</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159164#p159164"/>
<title type="html"><![CDATA[Re: #define i sklejanie nazw]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159164#p159164"><![CDATA[
<a href="http://mirekk36.blogspot.co.uk/2011/12/jezyk-c-makra-upraszczajace-dostep-do.html"  class="postlink">http://mirekk36.blogspot.co.uk/2011/12/jezyk-c-makra-upraszczajace-dostep-do.html</a><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=7157">anshar</a> — 24 kwi 2016, o 14:26</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[rskup]]></name></author>
<updated>2016-04-24T14:23:15+01:00</updated>
<published>2016-04-24T14:23:15+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159163#p159163</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159163#p159163"/>
<title type="html"><![CDATA[Re: #define i sklejanie nazw]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159163#p159163"><![CDATA[
A gdzie masz linie z #define dla DDR() i PORT()?<br />Zasady składania opisuje Mirek w BB oraz chyba także na swoim blogu.<br /><br />-- <br />Pozdrawiam,<br />Robert<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 3 minutach ]</span></strong><br /><br />Na Mirka blogu jest artykuł pod linkiem <!-- m --><a class="postlink" href="http://mirekk36.blogspot.com/2011/12/jezyk-c-makra-upraszczajace-dostep-do.html" >http://mirekk36.blogspot.com/2011/12/je ... ep-do.html</a><!-- m --> a na forum <!-- l --><a class="postlink-local" href="http://forum.atnel.pl/post974.html#p974" >post974.html#p974</a><!-- l --><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=3427">rskup</a> — 24 kwi 2016, o 14:23</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[k_mirek]]></name></author>
<updated>2016-04-24T14:15:30+01:00</updated>
<published>2016-04-24T14:15:30+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159162#p159162</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159162#p159162"/>
<title type="html"><![CDATA[#define i sklejanie nazw]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=15202&amp;p=159162#p159162"><![CDATA[
Witam.<br /><br />Napisalem cos takiego do pliku .h Chodzi o to aby sklejać nazwy dla PORTx i PINx, jednak kompilator krzyczy błędem. No nie mogę dojść o co mu chodzi, ale jeśli zamiast sklejania wpiszę PORTD i PIND program kompiluje sie poprawnie. Może mógłby ktoś podpowiedzieć o czym zapomniałem.<br /><br />[syntax=c]#define DIO_PORTD<br />#define DIO_PIN1<br /><br />#define CLK_PORTD<br />#define CLK_PIN0<br /><br /><br />#define DIO_INDDR(DIO_PORT) &amp;= ~(1&lt;&lt;DIO_PIN)<br />#define DIO_OUTDDR(DIO_PORT) |= (1&lt;&lt;DIO_PIN)<br />#define DIO_LOPORT(DIO_PORT) &amp;= ~(1&lt;&lt;DIO_PIN)<br />#define DIO_HIPORT(DIO_PORT) |= (1&lt;&lt;DIO_PIN)<br />#define DIOPIN(DIO_PORT) &amp; (1&lt;&lt;DIO_PIN)<br /><br />#define CLK_LOPORT(CLK_PORT) &amp;= ~(1&lt;&lt;CLK_PIN)<br />#define CLK_HIPORT(CLK_PORT) |= (1&lt;&lt;CLK_PIN)<br /><br />extern volatile uint8_t cyfry&#91;&#93;;[/syntax]<br /><br />Console:<br /><br />[syntax=c]15:06:49 **** Build of configuration Release for project tm1673_lib ****<br />make all <br />'Building file: ../tm1763/tm1673.c'<br />'Invoking: AVR Compiler'<br />avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega32 -DF_CPU=8000000UL -MMD -MP -MF&quot;tm1763/tm1673.d&quot; -MT&quot;tm1763/tm1673.o&quot; -c -o &quot;tm1763/tm1673.o&quot; &quot;../tm1763/tm1673.c&quot;<br />../tm1763/tm1673.c:14:25: warning: 'cyfry' initialized and declared 'extern' &#91;enabled by default&#93;<br /> extern volatile uint8_t cyfry&#91;&#93;={<br />                         ^<br />../tm1763/tm1673.c: In function 'I2Cstart':<br />../tm1763/tm1673.c:34:2: warning: implicit declaration of function 'PORT' &#91;-Wimplicit-function-declaration&#93;<br />  CLK_HI;<br />  ^<br />In file included from ../tm1763/tm1673.c:11:0:<br />../tm1763/tm1673.h:17:18: error: 'D' undeclared (first use in this function)<br /> #define CLK_PORT D<br />                  ^<br />../tm1763/tm1673.h:28:22: note: in expansion of macro 'CLK_PORT'<br /> #define CLK_HI  PORT(CLK_PORT) |= (1&lt;&lt;CLK_PIN)<br />                      ^<br />../tm1763/tm1673.c:34:2: note: in expansion of macro 'CLK_HI'<br />  CLK_HI;<br />  ^<br />../tm1763/tm1673.h:17:18: note: each undeclared identifier is reported only once for each function it appears in<br /> #define CLK_PORT D<br />                  ^<br />../tm1763/tm1673.h:28:22: note: in expansion of macro 'CLK_PORT'<br /> #define CLK_HI  PORT(CLK_PORT) |= (1&lt;&lt;CLK_PIN)<br />                      ^<br />../tm1763/tm1673.c:34:2: note: in expansion of macro 'CLK_HI'<br />  CLK_HI;<br />  ^<br />../tm1763/tm1673.c:35:2: warning: implicit declaration of function 'DDR' &#91;-Wimplicit-function-declaration&#93;<br />  DIO_OUT;<br />  ^<br />In file included from ../tm1763/tm1673.c:11:0:<br />../tm1763/tm1673.c: In function 'I2Cask':<br />../tm1763/tm1673.h:17:18: error: 'D' undeclared (first use in this function)<br /> #define CLK_PORT D<br />                  ^<br />../tm1763/tm1673.h:27:22: note: in expansion of macro 'CLK_PORT'<br /> #define CLK_LO  PORT(CLK_PORT) &amp;= ~(1&lt;&lt;CLK_PIN)<br />                      ^<br />../tm1763/tm1673.c:41:2: note: in expansion of macro 'CLK_LO'<br />  CLK_LO;<br />  ^<br />../tm1763/tm1673.c:44:2: warning: implicit declaration of function 'PIN' &#91;-Wimplicit-function-declaration&#93;<br />  while(DIO);<br />  ^<br />In file included from ../tm1763/tm1673.c:11:0:<br />../tm1763/tm1673.c: In function 'I2Cstop':<br />../tm1763/tm1673.h:17:18: error: 'D' undeclared (first use in this function)<br /> #define CLK_PORT D<br />                  ^<br />../tm1763/tm1673.h:27:22: note: in expansion of macro 'CLK_PORT'<br /> #define CLK_LO  PORT(CLK_PORT) &amp;= ~(1&lt;&lt;CLK_PIN)<br />                      ^<br />../tm1763/tm1673.c:50:2: note: in expansion of macro 'CLK_LO'<br />  CLK_LO;<br />  ^<br />../tm1763/tm1673.c: In function 'I2Cwrbyte':<br />../tm1763/tm1673.h:17:18: error: 'D' undeclared (first use in this function)<br /> #define CLK_PORT D<br />                  ^<br />../tm1763/tm1673.h:27:22: note: in expansion of macro 'CLK_PORT'<br /> #define CLK_LO  PORT(CLK_PORT) &amp;= ~(1&lt;&lt;CLK_PIN)<br />                      ^<br />../tm1763/tm1673.c:62:3: note: in expansion of macro 'CLK_LO'<br />   CLK_LO;<br />   ^<br />make: *** &#91;tm1763/tm1673.o&#93; Błąd 1<br /><br />15:06:50 Build Finished (took 1s.342ms)[/syntax]<br /><br />Pozdrawiam.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=499">k_mirek</a> — 24 kwi 2016, o 14:15</p><hr />
]]></content>
</entry>
</feed>