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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2017-09-01T21:37:56+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=19102&amp;mode</id>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2017-09-01T21:37:56+01:00</updated>
<published>2017-09-01T21:37:56+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194362#p194362</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194362#p194362"/>
<title type="html"><![CDATA[Re: Kompilator nie wykrywa plików uint8_t]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194362#p194362"><![CDATA[
<div class="quotetitle">zb111112 napisał(a):</div><div class="quotecontent"><br />ta biblioteka się tylko inaczej nazywa i ma inne nazwy funkcji<br /></div><br />no to jak robisz po swojemu to ja się na razie wyłączam ...<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 1 wrz 2017, o 21:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[zb111112]]></name></author>
<updated>2017-09-01T17:04:35+01:00</updated>
<published>2017-09-01T17:04:35+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194349#p194349</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194349#p194349"/>
<title type="html"><![CDATA[Re: Kompilator nie wykrywa plików uint8_t]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194349#p194349"><![CDATA[
ta biblioteka się tylko inaczej nazywa i ma inne nazwy funkcji ale kod tych funkcji jest taki sam jak w BB, jest ona w pełni działająca. Tylko nie wiem co to ma wspólnego z warningami dotyczącymi zapisu i odczytu do karty SD?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=15085">zb111112</a> — 1 wrz 2017, o 17:04</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2017-09-01T16:34:10+01:00</updated>
<published>2017-09-01T16:34:10+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194348#p194348</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194348#p194348"/>
<title type="html"><![CDATA[Re: Kompilator nie wykrywa plików uint8_t]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194348#p194348"><![CDATA[
A czemu używasz jakiejś dziwnej biblioteki do LCD zamiast tej z Bluebooka ?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 1 wrz 2017, o 16:34</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[zb111112]]></name></author>
<updated>2017-09-01T14:35:35+01:00</updated>
<published>2017-09-01T14:35:35+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194345#p194345</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194345#p194345"/>
<title type="html"><![CDATA[Re: Kompilator nie wykrywa plików uint8_t]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194345#p194345"><![CDATA[
l<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 26 minutach ]</span></strong><br /><br />Zdecydowałem się od nowa odpalić tą bibliotekę ze strony elmChain, pierwszy problem napotykam tutaj:<br />widok konsoli:<br />[syntax=c]avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -Wstrict-aliasing=1 -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega32 -DF_CPU=8000000UL -MMD -MP -MF&quot;main.d&quot; -MT&quot;main.d&quot; -c -o &quot;main.o&quot; &quot;../main.c&quot;<br />../main.c: In function 'main':<br />../main.c:60:8: warning: passing argument 3 of 'pf_read' from incompatible pointer type &#91;enabled by default&#93;<br />In file included from ../main.c:13:0:<br />../PetitFS/pff.h:102:9: note: expected 'UINT *' but argument is of type 'WORD *'<br />../main.c:77:9: warning: passing argument 3 of 'pf_write' from incompatible pointer type &#91;enabled by default&#93;<br />In file included from ../main.c:13:0:<br />../PetitFS/pff.h:103:9: note: expected 'UINT *' but argument is of type 'WORD *'<br />../main.c:78:25: error: 'w' undeclared (first use in this function)<br />../main.c:78:25: note: each undeclared identifier is reported only once for each function it appears in<br />make: *** &#91;main.o&#93; Błąd 1[/syntax]<br /><br />Tutaj mam kod z main.c<br />[syntax=c]#include &lt;avr/io.h&gt;<br />#include &lt;util/delay.h&gt;<br />#include &lt;stdio.h&gt;<br /><br />#include &quot;PetitFS/diskio.h&quot;<br />#include &quot;PetitFS/pff.h&quot;<br />#include &quot;LCD/lcd.h&quot;<br /><br />char file_name&#91;&#93; = &quot;test.txt&quot;;<br />char bufor&#91;128&#93;;<br /><br /><br />int main(void)<br />{<br />DDRA |= (1&lt;&lt;PA7);<br />PORTA |= (1&lt;&lt;PA7);<br /><br />BYTE res;<br />WORD s1;<br /><br />FATFS fs;<br />//DIR dir;<br />//FILINFO fno;<br /><br />#define SCK PB7<br />#define MOSI PB5<br />#define CS PB4<br />DDRB |= (1&lt;&lt;CS)|(1&lt;&lt;MOSI)|(1&lt;&lt;SCK);<br />PORTB |= (1&lt;&lt;CS);<br />SPCR |= (1&lt;&lt;SPE)|(1&lt;&lt;MSTR);<br /><br />    LcdInit();<br /><br />    LCD(&quot;odczyt: test.txt&quot;);<br />    LcdXY(1,0);<br /><br />    _delay_ms(100);<br />    uint8_t i=255;<br />    //inicjalizacja karty SD<br />    while(i-- &amp;&amp; (res = disk_initialize()));<br />    if(res == FR_OK)<br />    {<br />    res = pf_mount(&amp;fs);   //inicjalizacja napędu logicznego w strukturze fs<br />    if(res == FR_OK)<br />    {<br />    res = pf_open(file_name);   // otwieramy konkretny plik<br />    if(res == FR_OK)<br />    {<br /><br /><br /><br />    //odczytujemy dane z pliku do bufora<br />    res = pf_read(bufor, sizeof(bufor), &amp;s1);   /////////////////////////////////////////warning<br /><br />    if(res == FR_OK)<br />    {<br />    bufor&#91;s1+1&#93; = 0;<br />    LCD(bufor);<br /><br />    _delay_ms(3000);<br /><br />    LcdXY(0,0);<br />    LCD(&quot;zapis-&gt; test.txt&quot;);<br />    //modyfikacja pliku na karte<br />    if(bufor&#91;0&#93; == 't')<br />    sprintf(bufor, &quot;TEST ****&quot;);<br />    else sprintf(bufor, &quot;test ----&quot;);<br /><br />    s1 = 4;<br />    res = pf_write(bufor, sizeof(bufor), &amp;s1);   ///////////////////////////////warning<br />    pf_write(0, 0, &amp;w);                                 ///////////////////////////////warning oraz error <br /><br />    if(res != FR_OK)<br />    {<br />    LcdXY(0, 0);<br />    LCD(&quot;write file error&quot;);<br /><br />    } else {LcdXY(1, 0); LCD(&quot;OK, zresetuj&quot;);}<br /><br />    pf_mount(NULL);<br />    //write_close();                                              //&lt;------------<br />    } else LCD(&quot;read error&quot;);<br />    } else LCD(&quot;open file error&quot;);<br />    } else LCD(&quot;mount error&quot;);<br />    } else LCD(&quot;disk init error&quot;);<br /><br />    while(1);<br />}[/syntax]<br /><br />Pojawiło mi się też info do pliku pff.h :<br />[syntax=c]FRESULT pf_read (void* buff, UINT btr, UINT* br);/* Read data from the open file */<br />FRESULT pf_write (const void* buff, UINT btw, UINT* bw);/* Write data to the open file */[/syntax]<br />i nie działa XD<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=15085">zb111112</a> — 1 wrz 2017, o 14:35</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2017-08-31T07:18:45+01:00</updated>
<published>2017-08-31T07:18:45+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194269#p194269</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194269#p194269"/>
<title type="html"><![CDATA[Re: Kompilator nie wykrywa plików uint8_t]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194269#p194269"><![CDATA[
przykłady z książki są żelaznymi przykładami - ZAWSZE działają - i można się na nich wzorować później, sprawdzać swoje aplikacje, porównywać itp itd<br /><br />a jeśli komuś nie działa przykład z książki - to najgorszym co może zrobić to uznać od razu z marszu że w książce jest babol i mieszać po swojemu tym bardziej gdy nadal nie wychodzi ... gdy nie działa przykład z książki to wtedy warto wejść na forum - opisać problem i podpytać co tu źle robię, że nie daję rady odpalić ... wtedy zawsze szybko można pomóc<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 31 sie 2017, o 07:18</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[zb111112]]></name></author>
<updated>2017-08-31T00:59:42+01:00</updated>
<published>2017-08-31T00:59:42+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194265#p194265</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194265#p194265"/>
<title type="html"><![CDATA[Re: Kompilator nie wykrywa plików uint8_t]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194265#p194265"><![CDATA[
No faktycznie chyba zajrzę na tą płytę DVD z tą biblioteką i zobaczę czy działa. Wcześniej maina przepisałem z BB, a petita ściągłem z elmchaina ale coś nie pykło<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=15085">zb111112</a> — 31 sie 2017, o 00:59</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2017-08-31T00:52:21+01:00</updated>
<published>2017-08-31T00:52:21+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194264#p194264</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194264#p194264"/>
<title type="html"><![CDATA[Re: Kompilator nie wykrywa plików uint8_t]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194264#p194264"><![CDATA[
którą masz wersję Bluebooka? Bo na Pendrive nowego wydania w twardej oprawie, jest specjalnie przeportowana przeze mnie biblioteka PetitFS pod nowy Atmel toolchain<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 31 sie 2017, o 00:52</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[zb111112]]></name></author>
<updated>2017-08-31T00:35:52+01:00</updated>
<published>2017-08-31T00:35:52+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194262#p194262</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194262#p194262"/>
<title type="html"><![CDATA[Re: Kompilator nie wykrywa plików uint8_t]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194262#p194262"><![CDATA[
Zrobiłem tak jak pan mówi, lecz w konsoli otrzymałem następujące komunikaty:<br />[syntax=c]../main.c:78:9: warning: passing argument 3 of 'pf_write' from incompatible pointer type &#91;enabled by default&#93;<br />In file included from ../main.c:13:0:<br />../PetitFS/pff.h:105:9: note: expected 'uint8_t *' but argument is of type 'WORD *'[/syntax]<br /><br />Pierwszy komunikat to warning odwołujący się do main.c, dokładnie do linijki:<br />[syntax=c]res = pf_write(bufor, sizeof(bufor), &amp;s1);[/syntax]<br /><br />Drugi komunikat to jakieś info do pff.h :<br />[syntax=c]FRESULT pf_write (const void* buff, UINT btw, uint8_t * bw);/* Write data to the open file */[/syntax]<br /><br />No ja już nie wiem co jest nie tak XD<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=15085">zb111112</a> — 31 sie 2017, o 00:35</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[mirekk36]]></name></author>
<updated>2017-08-31T00:19:50+01:00</updated>
<published>2017-08-31T00:19:50+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194261#p194261</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194261#p194261"/>
<title type="html"><![CDATA[Re: Kompilator nie wykrywa plików uint8_t]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194261#p194261"><![CDATA[
coś musiałeś namieszać ale nie wiem co <br /><br />dodaj na razie w pliku *.h takiego inkluda<br /><br />&lt;stdint.h&gt;<br /><br />to uint8_t będzie rozpoznawane<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=54">mirekk36</a> — 31 sie 2017, o 00:19</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[zb111112]]></name></author>
<updated>2017-08-31T00:12:09+01:00</updated>
<published>2017-08-31T00:12:09+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194260#p194260</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194260#p194260"/>
<title type="html"><![CDATA[Kompilator nie wykrywa plików uint8_t]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19102&amp;p=194260#p194260"><![CDATA[
Chcę odpalić bibliotekę PetitFS i mam taki kłopot że w pliku pff.c jak mam funkcję z takimi argumentami:<br />[syntax=c]#include &lt;avr/io.h&gt;<br /><br />FRESULT pf_write (<br />const void* buff,/* Pointer to the data to be written */<br />UINT btw,/* Number of bytes to write (0:Finalize the current write operation) */<br />uint8_t * bw/* Pointer to number of bytes written */<br />)<br />{<br />CLUST clst;<br />DWORD sect, remain;<br />const BYTE *p = buff;<br />BYTE cs;<br />UINT wcnt;<br />FATFS *fs = FatFs;<br /><br /><br />*bw = 0;<br />if (!fs) return FR_NOT_ENABLED;/* Check file system */<br />if (!(fs-&gt;flag &amp; FA_OPENED))/* Check if opened */<br />return FR_NOT_OPENED;<br /><br />if (!btw) {/* Finalize request */<br />if ((fs-&gt;flag &amp; FA__WIP) &amp;&amp; disk_writep(0, 0)) ABORT(FR_DISK_ERR);<br />fs-&gt;flag &amp;= ~FA__WIP;<br />return FR_OK;<br />} else {/* Write data request */<br />if (!(fs-&gt;flag &amp; FA__WIP))/* Round-down fptr to the sector boundary */<br />fs-&gt;fptr &amp;= 0xFFFFFE00;<br />}<br />remain = fs-&gt;fsize - fs-&gt;fptr;<br />if (btw &gt; remain) btw = (UINT)remain;/* Truncate btw by remaining bytes */<br /><br />while (btw){/* Repeat until all data transferred */<br />if ((UINT)fs-&gt;fptr % 512 == 0) {/* On the sector boundary? */<br />cs = (BYTE)(fs-&gt;fptr / 512 &amp; (fs-&gt;csize - 1));/* Sector offset in the cluster */<br />if (!cs) {/* On the cluster boundary? */<br />if (fs-&gt;fptr == 0)/* On the top of the file? */<br />clst = fs-&gt;org_clust;<br />else<br />clst = get_fat(fs-&gt;curr_clust);<br />if (clst &lt;= 1) ABORT(FR_DISK_ERR);<br />fs-&gt;curr_clust = clst;/* Update current cluster */<br />}<br />sect = clust2sect(fs-&gt;curr_clust);/* Get current sector */<br />if (!sect) ABORT(FR_DISK_ERR);<br />fs-&gt;dsect = sect + cs;<br />if (disk_writep(0, fs-&gt;dsect)) ABORT(FR_DISK_ERR);/* Initiate a sector write operation */<br />fs-&gt;flag |= FA__WIP;<br />}<br />wcnt = 512 - (UINT)fs-&gt;fptr % 512;/* Number of bytes to write to the sector */<br />if (wcnt &gt; btw) wcnt = btw;<br />if (disk_writep(p, wcnt)) ABORT(FR_DISK_ERR);/* Send data to the sector */<br />fs-&gt;fptr += wcnt; p += wcnt;/* Update pointers and counters */<br />btw -= wcnt; *bw += wcnt;<br />if ((UINT)fs-&gt;fptr % 512 == 0) {<br />if (disk_writep(0, 0)) ABORT(FR_DISK_ERR);/* Finalize the currtent secter write operation */<br />fs-&gt;flag &amp;= ~FA__WIP;<br />}<br />}<br /><br />return FR_OK;<br />}[/syntax]<br /><br />To uzyskuję w konsoli:<br />[syntax=c]../PetitFS/pff.h:103:47: error: unknown type name 'uint8_t'[/syntax]<br />Jest to bezpośrednie odwołanie do pff.h, czyli:<br />[syntax=c]FRESULT pf_write (const void* buff, UINT btw, uint8_t * bw);/* Write data to the open file */[/syntax]<br /><br />O co tu może chodzić przecież wszystko dobrze zinkludowałem. <br />Jeśli chodzi o kod z pliku main.c to mam identyczny jak z BB. Zastanawiałem się tylko skąd wziąć zmienną w, w np. pf_write(0, 0, &amp;w);<br />Bardzo bym prosił o pomoc.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=15085">zb111112</a> — 31 sie 2017, o 00:12</p><hr />
]]></content>
</entry>
</feed>