File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 50
50
51
51
*/
52
52
53
- #include " SD.h"
53
+ #include < SD.h>
54
54
55
55
namespace SDLib {
56
56
@@ -366,6 +366,19 @@ namespace SDLib {
366
366
root.openRoot (volume);
367
367
}
368
368
369
+ /* *
370
+ Get information about the volume size
371
+
372
+ @return Returns the volume size in kB of the first volume/partition
373
+ */
374
+ uint32_t SDClass::getvolumesize ()
375
+ {
376
+ uint32_t volumesize = volume.blocksPerCluster (); // clusters are collections of blocks
377
+ volumesize *= volume.clusterCount (); // we'll have a lot of clusters
378
+ volumesize /= 2 ;
379
+ return (volumesize); // 2 blocks make 1kB
380
+ }
381
+
369
382
// call this when a card is removed. It will allow you to insert and initialise a new card.
370
383
void SDClass::end () {
371
384
root.close ();
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ namespace SDLib {
106
106
return rmdir (filepath.c_str ());
107
107
}
108
108
109
+ uint32_t getvolumesize ();
110
+
109
111
private:
110
112
111
113
// This is used to determine the mode used to open a file
You can’t perform that action at this time.
0 commit comments