8000 Correct calculation of totalBlocks() in SD.h and SDFS.h (#1899) · LinusHeu/arduino-pico@c4f3617 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit c4f3617

Browse files
authored
Correct calculation of totalBlocks() in SD.h and SDFS.h (earlephilhower#1899)
1 parent 3068cd0 commit c4f3617

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libraries/SD/src/SD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class SDClass {
128128
}
129129

130130
size_t totalBlocks() {
131-
return (totalClusters() / blocksPerCluster());
131+
return (totalClusters() * blocksPerCluster());
132132
}
133133

134134
size_t clusterSize() {

libraries/SDFS/src/SDFS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class SDFSImpl : public FSImpl {
183183
return _fs.vol()->clusterCount();
184184
}
185185
size_t totalBlocks() {
186-
return (totalClusters() / blocksPerCluster());
186+
return (totalClusters() * blocksPerCluster());
187187
}
188188
size_t clusterSize() {
189189
return _fs.vol()->bytesPerCluster();

0 commit comments

Comments
 (0)
0