?? storage_8h.html
字號:
</td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Give a hint to the storage that the next sector we will read is sectorN. <p>If the storage device supports performing a separate seek before the data is read (for instance MMC card that can be taken off-line between seek and read), storage seeks in this function. The user should not need to worry about this and calling PrepareToReadDiskSector is voluntary. <p>Definition at line <a class="el" href="storage_8c-source.html#l00071">71</a> of file <a class="el" href="storage_8c-source.html">storage.c</a>.<p>References <a class="el" href="board_8h-source.html#l00280">Public</a>, <a class="el" href="mmc_8c-source.html#l00431">SeekSector()</a>, and <a class="el" href="mmc_8h-source.html#l00008">storageFlags</a>.<p>Referenced by <a class="el" href="vs10xx_8c-source.html#l00202">PlayDiskSectors()</a>.<p><pre class="fragment"><div>00071 {00072 00073 <span class="preprocessor">#ifdef MMCDEBUG</span>00074 <span class="preprocessor"></span> ConsoleWrite(<span class="stringliteral">"<strategy:"</span>);00075 ConsolePutUInt(sectorN);00076 ConsoleWrite(<span class="stringliteral">" Flags:"</span>);00077 ConsolePutHex8(storageFlags);00078 <span class="preprocessor">#endif</span>00079 <span class="preprocessor"></span>00080 <span class="keywordflow">if</span> (!<a class="code" href="mmc_8h.html#a0">storageFlags</a>){00081 <span class="comment">//Storage device supports seek-before-read</span>00082 <span class="keywordflow">if</span> (<a class="code" href="mmc_8h.html#a2">SeekSector</a>(sectorN)){00083 00084 <span class="preprocessor">#ifdef MMCDEBUG</span>00085 <span class="preprocessor"></span> ConsoleWrite(<span class="stringliteral">"Seek Error. strategy>"</span>); 00086 <span class="preprocessor">#endif</span>00087 <span class="preprocessor"></span>00088 <span class="keywordflow">return</span> 0x0f; <span class="comment">//seek error code</span>00089 }00090 <a class="code" href="mmc_8h.html#a0">storageFlags</a> |= 0x02; <span class="comment">//flag: a sector is seeked for reading</span>00091 00092 <span class="preprocessor">#ifdef MMCDEBUG</span>00093 <span class="preprocessor"></span> ConsoleWrite(<span class="stringliteral">"Seeked. strategy>"</span>);00094 <span class="preprocessor">#endif</span>00095 <span class="preprocessor"></span>00096 <span class="keywordflow">return</span> 0; <span class="comment">//ok return</span>00097 }00098 00099 <span class="preprocessor">#ifdef MMCDEBUG</span>00100 <span class="preprocessor"></span> ConsoleWrite(<span class="stringliteral">"strategy>"</span>);00101 <span class="preprocessor">#endif</span>00102 <span class="preprocessor"></span>00103 <span class="keywordflow">return</span> 0; <span class="comment">//ok return</span>00104 }</div></pre><p>Here is the call graph for this function:<p><center><img src="storage_8h_a1_cgraph.png" border="0" usemap="#storage_8h_a1_cgraph_map" alt=""></center><map name="storage_8h_a1_cgraph_map"><area href="mmc_8h.html#a2" shape="rect" coords="228,56,305,79" alt=""><area href="mmc_8c.html#a7" shape="rect" coords="353,6,548,30" alt=""><area href="mmc_8c.html#a0" shape="rect" coords="596,81,692,105" alt=""><area href="mmc_8c.html#a4" shape="rect" coords="410,105,490,129" alt=""></map> </td> </tr></table><a class="anchor" name="a2" doxytag="storage.h::ReadDiskSector" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> unsigned char ReadDiskSector </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned long </td> <td class="mdname1" valign="top" nowrap> <em>sectorN</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Read a disk sector to global buffer. <p>Returns 0 when successful, error code 6 otherwise. <p>Definition at line <a class="el" href="storage_8c-source.html#l00110">110</a> of file <a class="el" href="storage_8c-source.html">storage.c</a>.<p>References <a class="el" href="board_8h-source.html#l00280">Public</a>, <a class="el" href="mmc_8c-source.html#l00463">ReadPhysicalSector()</a>, <a class="el" href="mmc_8c-source.html#l00431">SeekSector()</a>, and <a class="el" href="mmc_8h-source.html#l00008">storageFlags</a>.<p>Referenced by <a class="el" href="filesys_8c-source.html#l00401">BuildFragmentTable()</a>, <a class="el" href="filesys_8c-source.html#l00561">FGetChar()</a>, <a class="el" href="aviplay_8c-source.html#l00015">GetAVIBlock()</a>, <a class="el" href="filesys_8c-source.html#l00085">GetFatEntry()</a>, <a class="el" href="filesys_8c-source.html#l00303">GetNextSector()</a>, <a class="el" href="filesys_8c-source.html#l00923">InitFileSystem()</a>, <a class="el" href="filesys_8c-source.html#l00541">LoadNextSector()</a>, <a class="el" href="filesys_8c-source.html#l00610">OpenFile()</a>, <a class="el" href="aviplay_8c-source.html#l00144">PlayAvi()</a>, <a class="el" href="vs10xx_8c-source.html#l00202">PlayDiskSectors()</a>, <a class="el" href="record_8c-source.html#l00101">Record()</a>, and <a class="el" href="filesys_8c-source.html#l00129">WriteClusterChain()</a>.<p><pre class="fragment"><div>00110 {00111 00112 00113 <span class="preprocessor">#ifdef MMCDEBUG</span>00114 <span class="preprocessor"></span> ConsoleWrite(<span class="stringliteral">"<read"</span>); <span class="comment">//Read called (strategy, not yet actual read)</span>00115 <span class="preprocessor">#endif</span>00116 <span class="preprocessor"></span>00117 <span class="comment">//if a sector has not already been seeked, seek now.</span>00118 <span class="keywordflow">if</span> (!(<a class="code" href="mmc_8h.html#a0">storageFlags</a>&0x02)){ 00119 <span class="preprocessor">#ifdef MMCDEBUG</span>00120 <span class="preprocessor"></span> ConsoleWrite(<span class="stringliteral">"F"</span>);00121 <span class="preprocessor">#endif</span>00122 <span class="preprocessor"></span> <span class="keywordflow">if</span> (<a class="code" href="mmc_8h.html#a2">SeekSector</a>(sectorN)) <span class="keywordflow">return</span> 0x0f; <span class="comment">//seek error</span>00123 }00124 00125 <a class="code" href="mmc_8h.html#a0">storageFlags</a> &= 0xfd; <span class="comment">//clear sector-already-seeked flag</span>00126 <span class="keywordflow">if</span> (<a class="code" href="mmc_8c.html#a9">ReadPhysicalSector</a>()){00127 ConsoleWrite(<span class="stringliteral">"error read>"</span>);00128 <span class="keywordflow">return</span> 0x10; <span class="comment">//read error</span>00129 }00130 00131 <span class="preprocessor">#ifdef MMCDEBUG</span>00132 <span class="preprocessor"></span> ConsoleWrite(<span class="stringliteral">"read>"</span>);00133 <span class="preprocessor">#endif</span>00134 <span class="preprocessor"></span>00135 <span class="keywordflow">return</span> 0; <span class="comment">/* All OK return */</span>00136 }</div></pre><p>Here is the call graph for this function:<p><center><img src="storage_8h_a2_cgraph.png" border="0" usemap="#storage_8h_a2_cgraph_map" alt=""></center><map name="storage_8h_a2_cgraph_map"><area href="mmc_8c.html#a9" shape="rect" coords="329,56,454,80" alt=""><area href="mmc_8h.html#a2" shape="rect" coords="169,141,247,165" alt=""><area href="mmc_8c.html#a1" shape="rect" coords="541,6,650,30" alt=""><area href="board_8h.html#a50" shape="rect" coords="704,105,778,129" alt=""><area href="mmc_8c.html#a6" shape="rect" coords="538,105,653,129" alt=""><area href="mmc_8c.html#a7" shape="rect" coords="295,104,489,128" alt=""><area href="mmc_8c.html#a0" shape="rect" coords="548,153,644,177" alt=""><area href="mmc_8c.html#a4" shape="rect" coords="352,202,432,226" alt=""></map> </td> </tr></table><a class="anchor" name="a4" doxytag="storage.h::WriteDiskSector" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void WriteDiskSector </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned long </td> <td class="mdname1" valign="top" nowrap> <em>sectorN</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Write current buffer memory to sectorN. <p>Sector address (0=first 512B sector, 1=2nd. sector, etc.) is in extern global unsigned long sectorAddress <dl compact><dt><b>Warning:</b></dt><dd>Unimplemented! </dd></dl><p>Definition at line <a class="el" href="storage_8c-source.html#l00183">183</a> of file <a class="el" href="storage_8c-source.html">storage.c</a>.<p>References <a class="el" href="buffer_8h-source.html#l00107">DiskBlock::Raw::buf</a>, <a class="el" href="buffer_8c-source.html#l00013">dataBufPtr</a>, <a class="el" href="buffer_8c-source.html#l00010">diskSect</a>, <a class="el" href="buffer_8h-source.html#l00129">Address::l</a>, <a class="el" href="board_8h-source.html#l00280">Public</a>, <a class="el" href="unionDiskBlock.html#o1">DiskBlock::raw</a>, <a class="el" href="buffer_8c-source.html#l00015">sectorAddress</a>, and <a class="el" href="mmc_8c-source.html#l00484">WritePhysicalSector()</a>.<p>Referenced by <a class="el" href="filesys_8c-source.html#l00610">OpenFile()</a>, <a class="el" href="record_8c-source.html#l00101">Record()</a>, and <a class="el" href="filesys_8c-source.html#l00129">WriteClusterChain()</a>.<p><pre class="fragment"><div>00183 {00184 <a class="code" href="buffer_8c.html#a2">sectorAddress</a>.<a class="code" href="unionAddress.html#o0">l</a> = sectorN;00185 <a class="code" href="buffer_8c.html#a1">dataBufPtr</a> = <a class="code" href="buffer_8c.html#a0">diskSect</a>.<a class="code" href="unionDiskBlock.html#o1">raw</a>.<a class="code" href="structDiskBlock_1_1Raw.html#o0">buf</a>;00186 <a class="code" href="mmc_8c.html#a10">WritePhysicalSector</a>();00187 }</div></pre><p>Here is the call graph for this function:<p><center><img src="storage_8h_a4_cgraph.png" border="0" usemap="#storage_8h_a4_cgraph_map" alt=""></center><map name="storage_8h_a4_cgraph_map"><area href="mmc_8c.html#a10" shape="rect" coords="173,57,301,81" alt=""><area href="mmc_8c.html#a0" shape="rect" coords="350,57,446,81" alt=""><area href="board_8h.html#a50" shape="rect" coords="497,33,571,57" alt=""><area href="board_8c.html#a1" shape="rect" coords="495,81,573,105" alt=""></map> </td> </tr></table><hr><FONT SIZE="-1">All software copyright 2000-2004 <a href="http://www.vlsi.fi/"> VLSI Solution OY.</a>Redistribution of these software modules are limited to promotional use onlyand only with the VS1011 / VS1002 / VS1003 MP3-Evakit evaluation boards. Free orcommercial use of these software modules in MP3 players is ok if theproduct includes MP3 decoder chip(s) from VLSI. You can request the complete(compilable) package from mp3@vlsi.fi</FONT>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -