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 5050
5151*/
5252
53- #include " SD.h"
53+ #include < SD.h>
5454
5555namespace SDLib {
5656
@@ -366,6 +366,19 @@ namespace SDLib {
366366 root.openRoot (volume);
367367 }
368368
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+
369382 // call this when a card is removed. It will allow you to insert and initialise a new card.
370383 void SDClass::end () {
371384 root.close ();
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ namespace SDLib {
106106 return rmdir (filepath.c_str ());
107107 }
108108
109+ uint32_t getvolumesize ();
110+
109111 private:
110112
111113 // This is used to determine the mode used to open a file
You can’t perform that action at this time.
0 commit comments