#include "storage.h"
#include "board.h"
#include "console.h"
#include "mmc.h"
#include "buffer.h"
Include dependency graph for storage.c:
Go to the source code of this file.
Functions | |
Public unsigned char | InitStorage () |
Initialize the storage system. | |
Public unsigned char | PrepareToReadDiskSector (unsigned long sectorN) |
Give a hint to the storage that the next sector we will read is sectorN. | |
Public unsigned char | ReadDiskSector (unsigned long sectorN) |
Read a disk sector to global buffer. | |
Public void | DumpDiskSector () |
Do a hex dump on console of current sector in memory. | |
Public void | WriteDiskSector (unsigned long sectorN) |
Write current buffer memory to sectorN. | |
Variables | |
xdata unsigned char | storageFlags = 0 |
Storage status flags. |
Implemented Disk interface: MMC.
v0.5: added support for more MMC card brands, rewritten code for better clarity.
This module reads and writes blocks of disk data to/from a global buffer. The logical place to define these globals is where they are needed most: the module that contains the file system functions. By default that means filesys.c. These globals are needed (see filesys.h):
Definition in file storage.c.
|
Do a hex dump on console of current sector in memory.
Definition at line 141 of file storage.c. References DiskBlock::Raw::buf, diskSect, Address::l, Public, DiskBlock::raw, and sectorAddress.
|
|
Initialize the storage system.
Definition at line 43 of file storage.c. References InitMMC(), Public, and storageFlags. Referenced by InitFileSystem().
Here is the call graph for this function: |
|
Give a hint to the storage that the next sector we will read is sectorN. 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. Definition at line 71 of file storage.c. References Public, SeekSector(), and storageFlags. Referenced by PlayDiskSectors().
Here is the call graph for this function: |
|
Read a disk sector to global buffer. Returns 0 when successful, error code 6 otherwise. Definition at line 110 of file storage.c. References Public, ReadPhysicalSector(), SeekSector(), and storageFlags. Referenced by BuildFragmentTable(), FGetChar(), GetAVIBlock(), GetFatEntry(), GetNextSector(), InitFileSystem(), LoadNextSector(), OpenFile(), PlayAvi(), PlayDiskSectors(), Record(), and WriteClusterChain().
Here is the call graph for this function: |
|
Write current buffer memory to sectorN. Sector address (0=first 512B sector, 1=2nd. sector, etc.) is in extern global unsigned long sectorAddress
Definition at line 183 of file storage.c. References DiskBlock::Raw::buf, dataBufPtr, diskSect, Address::l, Public, DiskBlock::raw, sectorAddress, and WritePhysicalSector(). Referenced by OpenFile(), Record(), and WriteClusterChain().
Here is the call graph for this function: |
|
Storage status flags.
Definition at line 34 of file storage.c. Referenced by InitStorage(), PrepareToReadDiskSector(), and ReadDiskSector(). |