From 5529188daeed70715ebf29e1799dcd13377301c3 Mon Sep 17 00:00:00 2001 From: ficeto Date: Sat, 16 May 2015 16:22:38 +0300 Subject: [PATCH] add info methods to SD class --- libraries/SD/src/SD.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/SD/src/SD.h b/libraries/SD/src/SD.h index 93c79138b..b0192dd2f 100644 --- a/libraries/SD/src/SD.h +++ b/libraries/SD/src/SD.h @@ -106,6 +106,14 @@ public: boolean rmdir(char *filepath); + size_t type(){ return card.type(); } + size_t fatType(){ return volume.fatType(); } + size_t blocksPerCluster(){ return volume.blocksPerCluster(); } + size_t totalClusters(){ return volume.clusterCount(); } + size_t blockSize(){ return (size_t)0x200; } + size_t totalBlocks(){ return (totalClusters() / blocksPerCluster()); } + size_t clusterSize(){ return blocksPerCluster() * blockSize(); } + size_t size(){ return (clusterSize() * totalClusters()); } private: // This is used to determine the mode used to open a file