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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2013-11-06T01:35:28+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=4677&amp;mode</id>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2013-11-06T01:35:28+01:00</updated>
<published>2013-11-06T01:35:28+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55603#p55603</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55603#p55603"/>
<title type="html"><![CDATA[Re: zasieg zmiennych]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55603#p55603"><![CDATA[
<div class="quotetitle">ixxl napisał(a):</div><div class="quotecontent"><br />Kod:<br />ST eep_dane EEMEM;<br />ST ram_dane;<br /><br /><br />deklaracja zmiennych ?<br /></div><br /><br />no widzisz <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /> ... nie nie nie .... to jest panie DEFINICJA zmiennych .... toż definiujesz je w pliku *.c (źródłowym) i od razu kompilator rezerwuje pamięć<br /><br />więc przypomnij sobie jednak z bluebooka bo jak widzisz miałem rację że będzie się to ciągnąć za tobą ....<br /><br />tak jak mówi kolega wyżej<br /><br />a gdy dasz to w pliku nagłówkowym ale ze specyfikatorem extern to dopiero będzie DEKLARACJA bo wtedy kompilator nie rezerwuje pamięci na te zmienne tylko rozgłasza ich nazwy w innych modułach gdy się inkluduje plik *.h<br /><br />czyli:<br /><br />[syntax=c]extern ST eep_dane EEMEM;<br />extren ST ram_dane;[/syntax]<br /><br />w tym samym pliku nagłówkowym oczywiście umieść swoją definicję typu ST (chociaż nazwa typu dwu-literowa to też mega porażka) ale dasz dłuższą i coś mówiącą nazwę i będzie ok <img src="https://forum.atnel.pl/images/smilies/icon_e_wink.gif" alt=";)" title="Puszcza oko" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 6 lis 2013, o 01:35</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ixxl]]></name></author>
<updated>2013-11-05T19:05:18+01:00</updated>
<published>2013-11-05T19:05:18+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55549#p55549</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55549#p55549"/>
<title type="html"><![CDATA[Re: zasieg zmiennych]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55549#p55549"><![CDATA[
Mirku, oczywiście (albo wydaje mi się) wiem co to jest deklaracja i definicja. Ze zwykłymi zmiennymi nie mam problemu. Jednak pierwszy raz zmierzyłem się na poważnie ze strukturami i się zgubiłem <img src="https://forum.atnel.pl/images/smilies/icon_e_sad.gif" alt=":(" title="Smutny" /><br /><br />z tego co rozumiem , to <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">typedef struct {<br />   uint8_t temp1;<br />   uint8_t temp2;<br />   uint8_t min1;<br />   uint8_t min2;<br />   uint8_t hist;<br />}ST;<br /></div><br /><br />jest definicja typu strukturalnego , natomiast <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">ST eep_dane EEMEM;<br />ST ram_dane;</div><br /><br />deklaracja zmiennych ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=67">ixxl</a> — 5 lis 2013, o 19:05</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2013-11-05T10:32:45+01:00</updated>
<published>2013-11-05T10:32:45+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55466#p55466</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55466#p55466"/>
<title type="html"><![CDATA[Re: zasieg zmiennych]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55466#p55466"><![CDATA[
<div class="quotetitle">ixxl napisał(a):</div><div class="quotecontent"><br />w pliku nagłówkowym , to kompilator zgłasza błąd:<br /><br />&quot; multiple definition of `eep_dane'&quot;<br /></div><br /><br />A czytałeś w Bluebooku co to jest DEFINICJA a co to jest DEKLARACJA zmiennych ? Bo to od razu rozwiązałoby ci sprawę ...<br /><br />Tak samo o podziale projektu na pliki - tym bardziej że masz tam ładną tabelkę i pokazane jak to robić...<br /><br />Bez zrozumienia różnicy co to deklaracja a co to definicja zmiennych wciąż będziesz miał z tym problemy.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 5 lis 2013, o 10:32</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ixxl]]></name></author>
<updated>2013-11-05T08:38:15+01:00</updated>
<published>2013-11-05T08:38:15+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55459#p55459</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55459#p55459"/>
<title type="html"><![CDATA[Re: zasieg zmiennych]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55459#p55459"><![CDATA[
jak umieszczam całość czyli:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">typedef struct {<br />   uint8_t temp1;<br />   uint8_t temp2;<br />   uint8_t min1;<br />   uint8_t min2;<br />   uint8_t hist;<br />}ST;<br /><br />ST eep_dane EEMEM;<br />ST ram_dane;</div><br /><br /> w pliku nagłówkowym , to kompilator zgłasza błąd:<br /><br />&quot; multiple definition of `eep_dane'&quot;<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=67">ixxl</a> — 5 lis 2013, o 08:38</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[arturf209]]></name></author>
<updated>2013-11-05T00:20:42+01:00</updated>
<published>2013-11-05T00:20:42+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55450#p55450</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55450#p55450"/>
<title type="html"><![CDATA[Re: zasieg zmiennych]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55450#p55450"><![CDATA[
A gdzie je definiujesz? Bo jeżeli są globalne to powinieneś mieć dostęp.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=801">arturf209</a> — 5 lis 2013, o 00:20</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[ixxl]]></name></author>
<updated>2013-11-04T23:04:33+01:00</updated>
<published>2013-11-04T23:04:33+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55438#p55438</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55438#p55438"/>
<title type="html"><![CDATA[zasieg zmiennych]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=4677&amp;p=55438#p55438"><![CDATA[
hmm, w pliku main.c mam taką strukturę:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">typedef struct {<br />   uint8_t temp1;<br />   uint8_t temp2;<br />   uint8_t min1;<br />   uint8_t min2;<br />   uint8_t hist;<br />}ST;</div><br /><br />oczywiście przepisałem je do ramu <br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">//ST eep_dane EEMEM;<br />//ST ram_dane;</div><br /><br />Dwie z tych zmiennych muszę zmieniać w funkcjach znajdujących się w innym pliku projektu. W tej chwili realizuję to przez zmienne pomocnicze, jednak wolałbym operować bezpośrednio na np. ram_dane.hist. Jak to zrobić ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=67">ixxl</a> — 4 lis 2013, o 23:04</p><hr />
]]></content>
</entry>
</feed>