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

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2017-08-28T14:32:09+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=4&amp;t=19075&amp;mode</id>
<entry>
<author><name><![CDATA[jaca_76]]></name></author>
<updated>2017-08-28T14:32:09+01:00</updated>
<published>2017-08-28T14:32:09+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19075&amp;p=194105#p194105</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19075&amp;p=194105#p194105"/>
<title type="html"><![CDATA[Re: PetitFS wykrywa error w funkcji disk_readp()]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19075&amp;p=194105#p194105"><![CDATA[
Wydaje mi się że masz różnicę w typach przy definicji i deklaracji. funkcji disk_readp.<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=2479">jaca_76</a> — 28 sie 2017, o 14:32</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[zb111112]]></name></author>
<updated>2017-08-27T21:56:48+01:00</updated>
<published>2017-08-27T21:56:48+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=19075&amp;p=194077#p194077</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=19075&amp;p=194077#p194077"/>
<title type="html"><![CDATA[PetitFS wykrywa error w funkcji disk_readp()]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=19075&amp;p=194077#p194077"><![CDATA[
Witam, chciałbym odpalić bibliotekę PetitFS, zrobiłem wszystko tak jak pisało w BlueBooku lecz pojawił mi się dodatkowy error i nie wiem o co chodzi. Problem dotyczy funkcji disk_readp(). Prosiłbym o pomoc.<br />[syntax=c]DRESULT disk_readp (         //do tej lini wyswietla sie error<br />BYTE *buff,/* Pointer to the read buffer (NULL:Read bytes are forwarded to the stream) */<br />DWORD lba,/* Sector number (LBA) */<br />WORD ofs,/* Byte offset to read from (0..511) */<br />WORD cnt/* Number of bytes to read (ofs + cnt mus be &lt;= 512) */<br />)<br />{<br />DRESULT res;<br />BYTE rc;<br />WORD bc;<br /><br /><br />if (!(CardType &amp; CT_BLOCK)) lba *= 512;/* Convert to byte address if needed */<br /><br />res = RES_ERROR;<br />if (send_cmd(CMD17, lba) == 0) {/* READ_SINGLE_BLOCK */<br /><br />bc = 40000;<br />do {/* Wait for data packet */<br />rc = rcv_spi();<br />} while (rc == 0xFF &amp;&amp; --bc);<br /><br />if (rc == 0xFE) {/* A data packet arrived */<br />bc = 514 - ofs - cnt;<br /><br />/* Skip leading bytes */<br />if (ofs) {<br />do rcv_spi(); while (--ofs);<br />}<br /><br />/* Receive a part of the sector */<br />if (buff) {/* Store data to the memory */<br />do {<br />*buff++ = rcv_spi();<br />} while (--cnt);<br />}<br /><br />/* Skip trailing bytes and CRC */<br />do rcv_spi(); while (--bc);<br /><br />res = RES_OK;<br />}<br />}[/syntax]<br /><br />a w konsoli otrzymuje coś takiego<br />[syntax=c]../PetitFS/mmc.c:170:9: error: conflicting types for 'disk_readp'[/syntax]<br /><br />A i mam jeszcze takie pytanie. Przed modyfikacją plików w PetitFS w pliku main.c były deklaracje funkcji void put_rc (FRESULT rc), void put_drc (BYTE res), void get_line (char *buff, BYTE len) i void put_dump (const BYTE *buff, DWORD ofs, int cnt) i jakiegoś bufora. Nie wiedziałem co z tym zrobić to wziołem to jako komentarz. Czy dobrze zrobiłem?<br /><br /><strong><span style="color: #808000">------------------------ [ Dodano po: 14 minutach ]</span></strong><br /><br />Dobra, zrobiłem coś takiego że w pliku nagłówkowym diskio.h dałem w komentarz jedną linijkęi to pomogło:<br />[syntax=c]//DRESULT disk_readp (BYTE* buff, DWORD sector, UINT offset, UINT count);[/syntax]<br /><br />Za to wyświetliło mi się mnustwo errorów do pliku pff.c :<br />[syntax=c]../PetitFS/pff.c:53:2: error: #error Wrong _FS_FATxx setting.<br />../PetitFS/pff.c:229:2: error: #error Unknown code page.<br />../PetitFS/pff.c: In function 'get_fat':<br />../PetitFS/pff.c:353:7: warning: unused variable 'buf' &#91;-Wunused-variable&#93;<br />../PetitFS/pff.c: In function 'get_clust':<br />../PetitFS/pff.c:421:21: error: '_FS_FAT32' undeclared (first use in this function)<br />../PetitFS/pff.c:421:21: note: each undeclared identifier is reported only once for each function it appears in<br />../PetitFS/pff.c:423:3: warning: left shift count &gt;= width of type &#91;enabled by default&#93;<br />../PetitFS/pff.c: In function 'dir_rewind':<br />../PetitFS/pff.c:448:6: error: '_FS_FAT32' undeclared (first use in this function)<br />../PetitFS/pff.c: In function 'dir_find':<br />../PetitFS/pff.c:522:3: warning: implicit declaration of function 'disk_readp' &#91;-Wimplicit-function-declaration&#93;<br />../PetitFS/pff.c: In function 'create_name':<br />../PetitFS/pff.c:618:8: error: '_USE_LCC' undeclared (first use in this function)<br />../PetitFS/pff.c: In function 'check_fs':<br />../PetitFS/pff.c:733:6: error: '_FS_FAT32' undeclared (first use in this function)<br />../PetitFS/pff.c: In function 'pf_mount':<br />../PetitFS/pff.c:801:6: error: '_FS_FAT12' undeclared (first use in this function)<br />../PetitFS/pff.c:803:6: error: '_FS_FAT16' undeclared (first use in this function)<br />../PetitFS/pff.c:805:6: error: '_FS_FAT32' undeclared (first use in this function)<br />make: *** &#91;PetitFS/pff.o&#93; Błąd 1[/syntax]<br />Posiedzę przy tm jeszcze trochę, a jak nie to spróbuje od nowa tą bibliotekę uruchomić. Ktoś może miał podobny problem?<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=15085">zb111112</a> — 27 sie 2017, o 21:56</p><hr />
]]></content>
</entry>
</feed>