Updated get_fattime to use rtc and provide a date/time. This has been an annoying missing feature.

Dependents:   IoTGateway_Basic y_XBeeTest_5_read CameraC1098_picture LifeCam ... more

Committer:
SomeRandomBloke
Date:
Mon Apr 02 22:06:35 2012 +0000
Revision:
1:5baba5d5b728
Parent:
0:93acdd9f65f4

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
SomeRandomBloke 0:93acdd9f65f4 1 /* mbed Microcontroller Library - FATFileSystem
SomeRandomBloke 0:93acdd9f65f4 2 * Copyright (c) 2008, sford
SomeRandomBloke 0:93acdd9f65f4 3 */
SomeRandomBloke 0:93acdd9f65f4 4
SomeRandomBloke 0:93acdd9f65f4 5 /* Library: FATFileSystem.h
SomeRandomBloke 0:93acdd9f65f4 6 * A library of stuff to make a fat filesystem on top of a block device
SomeRandomBloke 0:93acdd9f65f4 7 */
SomeRandomBloke 0:93acdd9f65f4 8
SomeRandomBloke 0:93acdd9f65f4 9 #ifndef MBED_FATFILESYSTEM_H
SomeRandomBloke 0:93acdd9f65f4 10 #define MBED_FATFILESYSTEM_H
SomeRandomBloke 0:93acdd9f65f4 11
SomeRandomBloke 0:93acdd9f65f4 12 #ifndef FFSDEBUG_ENABLED
SomeRandomBloke 0:93acdd9f65f4 13 #define FFSDEBUG_ENABLED 0
SomeRandomBloke 0:93acdd9f65f4 14 #endif
SomeRandomBloke 0:93acdd9f65f4 15
SomeRandomBloke 0:93acdd9f65f4 16 #if FFSDEBUG_ENABLED
SomeRandomBloke 0:93acdd9f65f4 17 #define FFSDEBUG(FMT, ...) printf(FMT, ##__VA_ARGS__)
SomeRandomBloke 0:93acdd9f65f4 18 #else
SomeRandomBloke 0:93acdd9f65f4 19 #define FFSDEBUG(FMT, ...)
SomeRandomBloke 0:93acdd9f65f4 20 #endif
SomeRandomBloke 0:93acdd9f65f4 21
SomeRandomBloke 0:93acdd9f65f4 22 #include "FileSystemLike.h"
SomeRandomBloke 0:93acdd9f65f4 23 #include "FileHandle.h"
SomeRandomBloke 0:93acdd9f65f4 24 #include "ff.h"
SomeRandomBloke 0:93acdd9f65f4 25 #include "diskio.h"
SomeRandomBloke 0:93acdd9f65f4 26
SomeRandomBloke 0:93acdd9f65f4 27 namespace mbed {
SomeRandomBloke 0:93acdd9f65f4 28 /* Class: FATFileSystem
SomeRandomBloke 0:93acdd9f65f4 29 * The class itself
SomeRandomBloke 0:93acdd9f65f4 30 */
SomeRandomBloke 0:93acdd9f65f4 31 class FATFileSystem : public FileSystemLike {
SomeRandomBloke 0:93acdd9f65f4 32 public:
SomeRandomBloke 0:93acdd9f65f4 33
SomeRandomBloke 0:93acdd9f65f4 34 FATFileSystem(const char* n);
SomeRandomBloke 0:93acdd9f65f4 35 virtual ~FATFileSystem();
SomeRandomBloke 0:93acdd9f65f4 36
SomeRandomBloke 0:93acdd9f65f4 37 /* Function: open
SomeRandomBloke 0:93acdd9f65f4 38 * open a file on the filesystem. never called directly
SomeRandomBloke 0:93acdd9f65f4 39 */
SomeRandomBloke 0:93acdd9f65f4 40 virtual FileHandle *open(const char* name, int flags);
SomeRandomBloke 0:93acdd9f65f4 41 virtual int remove(const char *filename);
SomeRandomBloke 0:93acdd9f65f4 42 virtual int format();
SomeRandomBloke 0:93acdd9f65f4 43 virtual DirHandle *opendir(const char *name);
SomeRandomBloke 0:93acdd9f65f4 44 virtual int mkdir(const char *name, mode_t mode);
SomeRandomBloke 0:93acdd9f65f4 45
SomeRandomBloke 0:93acdd9f65f4 46 FATFS _fs; // Work area (file system object) for logical drive
SomeRandomBloke 0:93acdd9f65f4 47 static FATFileSystem *_ffs[_VOLUMES]; // FATFileSystem objects, as parallel to FatFs drives array
SomeRandomBloke 0:93acdd9f65f4 48 int _fsid;
SomeRandomBloke 0:93acdd9f65f4 49
SomeRandomBloke 0:93acdd9f65f4 50 virtual int disk_initialize() { return 0; }
SomeRandomBloke 0:93acdd9f65f4 51 virtual int disk_status() { return 0; }
SomeRandomBloke 0:93acdd9f65f4 52 virtual int disk_read(char *buffer, int sector) = 0;
SomeRandomBloke 0:93acdd9f65f4 53 virtual int disk_write(const char *buffer, int sector) = 0;
SomeRandomBloke 0:93acdd9f65f4 54 virtual int disk_sync() { return 0; }
SomeRandomBloke 0:93acdd9f65f4 55 virtual int disk_sectors() = 0;
SomeRandomBloke 0:93acdd9f65f4 56
SomeRandomBloke 0:93acdd9f65f4 57 };
SomeRandomBloke 0:93acdd9f65f4 58
SomeRandomBloke 0:93acdd9f65f4 59 }
SomeRandomBloke 0:93acdd9f65f4 60
SomeRandomBloke 0:93acdd9f65f4 61 #endif