SD Card Interface class. Log raw data bytes to memory addresses of your choice, or format the card and use the FAT file system to write files.
Diff: FATFileSystem/Interface/FATDirHandle.cpp
- Revision:
- 4:9a5878d316d5
- Parent:
- 3:210eb67b260c
--- a/FATFileSystem/Interface/FATDirHandle.cpp Mon Aug 23 07:12:13 2010 +0000 +++ b/FATFileSystem/Interface/FATDirHandle.cpp Fri Aug 27 00:59:28 2010 +0000 @@ -1,50 +1,50 @@ -/* mbed Microcontroller Library - FATDirHandle - Copyright (c) 2008, sford */ - -//Modified by Thomas Hamilton, Copyright 2010 - -#include "FATDirHandle.h" - -FATDirHandle::FATDirHandle(FAT_DIR InputDirStr) -{ - DirectoryObject = InputDirStr; -} - -int FATDirHandle::closedir() -{ - delete this; - return 0; -} - -struct dirent* FATDirHandle::readdir() -{ - FILINFO FileInfo; - FRESULT Result = f_readdir(&DirectoryObject, &FileInfo); - if (Result || !FileInfo.fname[0]) - { - return NULL; - } - else - { - for (unsigned char i = 0; i < 13; i++) - { - CurrentEntry.d_name[i] = ((char*)FileInfo.fname)[i]; - } - return &CurrentEntry; - } -} - -void FATDirHandle::rewinddir() -{ - DirectoryObject.index = 0; -} - -off_t FATDirHandle::telldir() -{ - return (off_t)DirectoryObject.index; -} - -void FATDirHandle::seekdir(off_t location) -{ - DirectoryObject.index = (WORD)location; +/* mbed Microcontroller Library - FATDirHandle + Copyright (c) 2008, sford */ + +//Modified by Thomas Hamilton, Copyright 2010 + +#include "FATDirHandle.h" + +FATDirHandle::FATDirHandle(FAT_DIR InputDirStr) +{ + DirectoryObject = InputDirStr; +} + +int FATDirHandle::closedir() +{ + delete this; + return 0; +} + +struct dirent* FATDirHandle::readdir() +{ + FILINFO FileInfo; + FRESULT Result = f_readdir(&DirectoryObject, &FileInfo); + if (Result || !FileInfo.fname[0]) + { + return NULL; + } + else + { + for (unsigned char i = 0; i < 13; i++) + { + CurrentEntry.d_name[i] = ((char*)FileInfo.fname)[i]; + } + return &CurrentEntry; + } +} + +void FATDirHandle::rewinddir() +{ + DirectoryObject.index = 0; +} + +off_t FATDirHandle::telldir() +{ + return (off_t)DirectoryObject.index; +} + +void FATDirHandle::seekdir(off_t location) +{ + DirectoryObject.index = (WORD)location; } \ No newline at end of file